/* O2-Track Mobile - Global Styles */
/* Mobile-First Design */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
}

/* Headers */
.header {
    background-color: #007bff;
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.header h1 {
    font-size: 20px;
    margin-bottom: 5px;
}

.header .welcome {
    font-size: 16px;
    opacity: 0.9;
}

.header.login-header {
    background-color: #007bff;
}

.header.admin-header {
    background-color: #28a745;
}

.header.reports-header {
    background-color: #dc3545;
}

/* Navigation Links */
.back-link,
.logout-link {
    position: absolute;
    top: 20px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 4px;
    transition: background-color 0.3s;
}

.back-link {
    left: 20px;
}

.logout-link {
    right: 20px;
}

.back-link:hover,
.logout-link:hover {
    background-color: rgba(255,255,255,0.1);
}

/* Containers */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.login-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

/* Forms */
.form-card,
.add-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

label .required {
    color: #dc3545;
}

input[type="text"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #007bff;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.help-text {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Buttons - Touch-Friendly (min 44px) */
button[type="submit"],
button[type="button"],
.action-link,
.dashboard-button {
    width: 100%;
    min-height: 44px;
    padding: 12px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    line-height: 20px;
}

button[type="submit"]:hover,
button[type="button"]:hover,
.action-link:hover {
    background-color: #0056b3;
}

button[type="submit"]:active,
button[type="button"]:active {
    background-color: #004085;
}

/* Dashboard Buttons */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dashboard-button {
    background-color: white;
    color: #333;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 2px solid transparent;
}

.dashboard-button:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-color: #007bff;
    transform: translateY(-2px);
}

.dashboard-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dashboard-button.primary {
    background-color: #007bff;
    color: white;
}

.dashboard-button.primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.dashboard-button.admin-only {
    background-color: #28a745;
    color: white;
}

.dashboard-button.admin-only:hover {
    background-color: #218838;
    border-color: #218838;
}

/* Delete/Danger Buttons */
.delete-btn,
.btn-delete {
    background-color: #dc3545;
    color: white;
    min-height: 44px;
    min-width: 44px;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.delete-btn:hover,
.btn-delete:hover {
    background-color: #c82333;
}

.delete-btn:active,
.btn-delete:active {
    background-color: #bd2130;
}

/* Messages */
.message {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    background-color: white;
    border-bottom: 2px solid #ddd;
}

.nav-tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    font-size: 14px;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.nav-tab:hover {
    background-color: #f8f9fa;
}

.nav-tab.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.nav-tab.active.reports-active {
    color: #dc3545;
    border-bottom-color: #dc3545;
}

/* Cards */
.summary-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    text-align: center;
}

.summary-count {
    font-size: 48px;
    font-weight: 700;
    color: #dc3545;
    margin-bottom: 10px;
}

.summary-text {
    font-size: 16px;
    color: #666;
}

.cylinder-card,
.manufacturer-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.cylinder-card {
    border-left: 4px solid #007bff;
}

.cylinder-serial {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.cylinder-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.info-label {
    color: #666;
    font-weight: 500;
}

.info-value {
    color: #333;
    font-weight: 400;
}

.hydro-expired {
    color: #dc3545;
    font-weight: 700;
    font-size: 16px;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-hydro {
    background-color: #fff3cd;
    color: #856404;
}

.status-retired {
    background-color: #f8d7da;
    color: #721c24;
}

/* Barcode Display */
.barcode-value {
    font-family: 'Courier New', monospace;
    background-color: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
}

/* Manufacturer Cards */
.manufacturer-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.manufacturer-name {
    font-size: 16px;
    color: #333;
    font-weight: 500;
    flex: 1;
}

/* Section Titles */
.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 14px;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #28a745;
}

/* Search Section */
.search-section {
    background: white;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-form {
    display: flex;
    gap: 10px;
}

#searchInput {
    flex: 1;
    min-height: 44px;
    padding: 12px;
    border: 2px solid #007bff;
    border-radius: 4px;
    font-size: 16px;
}

#searchBtn {
    min-height: 44px;
    min-width: 80px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

/* Action Buttons */
.actions-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.actions-label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    margin-bottom: 8px;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.action-btn {
    flex: 1;
    min-width: 80px;
    min-height: 44px;
    padding: 10px 12px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.action-btn:active {
    transform: scale(0.95);
}

.btn-active {
    background-color: #28a745;
    color: white;
}

.btn-active:hover {
    background-color: #218838;
}

.btn-hydro {
    background-color: #ffc107;
    color: #333;
}

.btn-hydro:hover {
    background-color: #e0a800;
}

.btn-retired {
    background-color: #dc3545;
    color: white;
}

.btn-retired:hover {
    background-color: #c82333;
}

/* Notes Section */
.notes-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.notes-label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    margin-bottom: 4px;
}

.notes-text {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .header h1 {
        font-size: 24px;
    }
    
    .header .welcome {
        font-size: 18px;
    }
    
    .dashboard-button {
        font-size: 20px;
        padding: 25px;
    }
    
    .cylinder-serial {
        font-size: 24px;
    }
    
    .info-row {
        font-size: 16px;
    }
    
    .manufacturer-name {
        font-size: 18px;
    }
    
    .section-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .header {
        padding: 15px;
    }
    
    .back-link,
    .logout-link {
        top: 15px;
        padding: 5px 10px;
    }
}
