/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 768px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Header */
.header {
    background: #1a1a1a;
    color: white;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.time {
    font-weight: 500;
}

.status-icons {
    display: flex;
    gap: 8px;
}

.icon-signal::before { content: '📶'; }
.icon-wifi::before { content: '📡'; }
.icon-battery::before { content: '🔋'; }

/* Main Content */
.main-content {
    padding: 24px;
    transition: filter 0.3s ease;
}

.main-content.locked {
    filter: blur(8px);
    pointer-events: none;
}

.app-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 24px;
    letter-spacing: 1px;
}

/* Fuel Type Buttons */
.fuel-types {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.fuel-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-size: 18px;
    font-weight: 700;
    color: white;
    min-height: 140px;
}

.fuel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.fuel-btn:active {
    transform: translateY(0);
}

.fuel-btn-avgas {
    background: linear-gradient(135deg, #D84B4B 0%, #C93939 100%);
}

.fuel-btn-jet {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
}

.fuel-icon {
    margin-bottom: 12px;
}

.fuel-label {
    font-size: 20px;
    letter-spacing: 0.5px;
}

/* Menu Grid */
.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.menu-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 140px;
}

.menu-item:hover {
    border-color: #4A90E2;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
    transform: translateY(-2px);
}

.menu-item:active {
    transform: translateY(0);
}

.menu-icon {
    margin-bottom: 12px;
}

.menu-label {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
    line-height: 1.4;
}

/* Overview Panel */
.overview-panel {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
}

.overview-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.overview-list {
    list-style: none;
    padding-left: 0;
}

.overview-list li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    color: #555;
    font-size: 15px;
}

.overview-list li::before {
    content: '•';
    position: absolute;
    left: 8px;
    color: #4A90E2;
    font-weight: bold;
    font-size: 18px;
}

/* Lock Overlay */
.lock-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lock-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.lock-content {
    text-align: center;
    padding: 40px;
    max-width: 400px;
    color: white;
}

.lock-icon {
    margin-bottom: 24px;
    animation: lockPulse 2s ease-in-out infinite;
}

@keyframes lockPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.lock-content h2 {
    font-size: 24px;
    margin-bottom: 12px;
    color: white;
}

.lock-content p {
    font-size: 16px;
    color: #ccc;
    margin-bottom: 32px;
}

.scan-btn {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    width: 100%;
}

.scan-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.manual-unlock-btn {
    background: transparent;
    color: #4A90E2;
    border: 2px solid #4A90E2;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.manual-unlock-btn:hover {
    background: #4A90E2;
    color: white;
}

/* Manual Unlock Form */
.manual-unlock-form {
    margin-top: 24px;
}

.unlock-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #4A90E2;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.unlock-input::placeholder {
    color: #999;
}

.unlock-submit-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.unlock-submit-btn:hover {
    background: #45a049;
}

/* QR Scanner Modal */
.qr-scanner-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.qr-scanner-modal.active {
    opacity: 1;
    pointer-events: all;
}

.scanner-content {
    width: 90%;
    max-width: 500px;
    background: #1a1a1a;
    border-radius: 16px;
    padding: 24px;
    position: relative;
}

.close-scanner {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.close-scanner:hover {
    background: rgba(255, 255, 255, 0.1);
}

.scanner-content h3 {
    color: white;
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
}

.scanner-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

#qrVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-box {
    width: 70%;
    height: 70%;
    border: 3px solid #4A90E2;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: scannerPulse 2s ease-in-out infinite;
}

@keyframes scannerPulse {
    0%, 100% { border-color: #4A90E2; }
    50% { border-color: #357ABD; }
}

.scanner-box::before,
.scanner-box::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid #4CAF50;
}

.scanner-box::before {
    top: -3px;
    left: -3px;
    border-right: none;
    border-bottom: none;
}

.scanner-box::after {
    bottom: -3px;
    right: -3px;
    border-left: none;
    border-top: none;
}

.scanner-instruction {
    color: #ccc;
    text-align: center;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 640px) {
    .app-title {
        font-size: 28px;
    }

    .fuel-btn {
        padding: 24px 12px;
        min-height: 120px;
    }

    .fuel-label {
        font-size: 18px;
    }

    .menu-item {
        padding: 20px 12px;
        min-height: 120px;
    }

    .menu-label {
        font-size: 14px;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 60px 24px;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.login-header p {
    font-size: 16px;
    color: #666;
}

.login-form {
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #4A90E2;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.error-message {
    background: #f44336;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.login-footer {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.demo-credentials {
    font-size: 13px;
    color: #666;
    line-height: 1.8;
}

.demo-credentials code {
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    color: #4A90E2;
}

/* Checklist Page */
.checklist-container {
    padding: 24px;
}

.checklist-header {
    text-align: center;
    margin-bottom: 32px;
}

.checklist-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.checklist-item.completed {
    border-color: #4CAF50;
    background: #f1f8f4;
}

.checklist-btn {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.checklist-btn-pass {
    background: white;
    border-color: #999;
    color: #999;
}

.checklist-btn-pass:disabled {
    background: #f5f5f5;
    border-color: #ccc;
    color: #ccc;
    opacity: 0.6;
    cursor: not-allowed !important;
}

.checklist-btn-pass.active {
    background: #4CAF50;
    color: white;
}

.checklist-submit {
    width: 100%;
    padding: 16px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.checklist-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ATA 103 Checklist Section Headers */
.checklist-section {
    margin-bottom: 32px;
}

.section-header {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
    display: flex;
    align-items: center;
}

.section-header::before {
    content: '📋';
    margin-right: 8px;
    font-size: 20px;
}
