/* Fly With Margot Hold Trainer - Compact Edition */

:root {
    --primary-dark: #0a0f1f;
    --primary-blue: #1a1f2f;
    --accent-blue: #00c6ff;
    --accent-purple: #0072ff;
    --text-primary: #ffffff;
    --text-secondary: #a0a0c0;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --success: #4CAF50;
    --warning: #FF9800;
    --danger: #F44336;
}

/* Base Container */
.flywithmargot-hold-trainer-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-blue) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 15px;
    max-width: 1000px;
    margin: 0 auto;
}

/* Header */
.hold-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.hold-header h1 {
    font-size: 1.8em;
    margin-bottom: 10px;
    text-align: center;
}

.gradient-text {
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.subtitle {
    font-size: 0.6em;
    color: var(--text-secondary);
    font-weight: normal;
    margin-left: 8px;
}

/* Usage Tracker */
.usage-tracker {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
}

.usage-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.user-welcome {
    color: var(--accent-blue);
    font-weight: 600;
}

.usage-count, .remaining-holds {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.remaining-holds {
    color: var(--success);
    font-weight: 600;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ATC Clearance Card */
.atc-clearance-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.atc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.atc-header h3 {
    margin: 0;
    color: var(--accent-blue);
    font-size: 1.2em;
}

.audio-controls {
    display: flex;
    gap: 8px;
}

.btn-audio {
    background: rgba(0, 114, 255, 0.2);
    border: 1px solid var(--accent-purple);
    color: var(--accent-blue);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.btn-audio:hover {
    background: rgba(0, 114, 255, 0.3);
}

#start-hold-btn {
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
    transition: transform 0.2s ease;
}

#start-hold-btn:hover {
    transform: translateY(-2px);
}

.atc-text {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid var(--accent-blue);
    font-style: italic;
    line-height: 1.5;
    font-size: 0.95em;
}

/* Main Training Area */
.main-training-area {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.hsi-display-section {
    flex: 2;
    min-width: 300px;
}

.navigation-panel {
    flex: 1;
    min-width: 250px;
}

/* HSI Display */
.hsi-canvas-wrapper {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    text-align: center;
}

#hsi-canvas {
    display: block;
    background: #000;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

/* Compact Controls */
.compact-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.compact-controls .control-group {
    flex: 1;
    min-width: 200px;
}

.control-group {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid var(--border-color);
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9em;
    text-align: center;
}

.input-with-buttons {
    display: flex;
    gap: 5px;
    align-items: center;
}

.input-with-buttons input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 1.1em;
    text-align: center;
    min-width: 60px;
}

.input-with-buttons input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.btn-step-fast {
    background: rgba(0, 114, 255, 0.2);
    border: 1px solid var(--accent-purple);
    color: var(--accent-blue);
    width: 36px;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-step-fast:hover {
    background: rgba(0, 114, 255, 0.3);
    transform: translateY(-1px);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-size: 0.95em;
}

.btn-primary {
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* Navigation Panel */
.navigation-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.instrument-row {
    display: flex;
    gap: 10px;
}

.instrument-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid var(--border-color);
}

.instrument-card.compact {
    flex: 1;
}

.instrument-title {
    color: var(--text-secondary);
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    text-align: center;
}

/* DME & Speed Displays */
.dme-display, .speed-display {
    text-align: center;
}

.dme-value, .speed-value {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--accent-blue);
    line-height: 1;
    margin-bottom: 2px;
}

.dme-unit, .speed-unit {
    color: var(--text-secondary);
    font-size: 0.8em;
}

/* Turn Controls */
.turn-controls {
    text-align: center;
}

.turn-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.turn-btn {
    flex: 1;
    padding: 10px 5px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
}

.btn-left {
    background: linear-gradient(135deg, var(--danger), #ff6b6b);
    color: white;
}

.btn-right {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    color: white;
}

.turn-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.turn-status {
    font-size: 0.9em;
    color: var(--text-secondary);
    padding: 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-weight: 600;
}

/* Entry Prediction */
.prediction-display {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recommended-entry, .your-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.recommended-entry {
    border-left: 3px solid var(--warning);
}

.your-entry {
    border-left: 3px solid var(--accent-blue);
}

.recommended-entry .label,
.your-entry .label {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.recommended-entry .value,
.your-entry .value {
    color: var(--text-primary);
    font-weight: bold;
    font-size: 1em;
}

.recommended-entry .value {
    color: var(--warning);
}

.your-entry .value {
    color: var(--accent-blue);
}

/* Progress Stages */
.progress-stages .stages-container {
    display: flex;
    justify-content: space-between;
    gap: 5px;
}

.stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.stage-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.stage-indicator.active {
    background: var(--accent-blue);
    box-shadow: 0 0 8px rgba(0, 198, 255, 0.5);
}

.stage-label {
    color: var(--text-secondary);
    font-size: 0.7em;
    text-align: center;
}

/* Flags Card */
.flags-card .flags-status {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.flag {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8em;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.flag.active {
    opacity: 1;
}

.flag.tofrom {
    background: rgba(255, 0, 255, 0.2);
    border-color: #FF00FF;
    color: #FF00FF;
}

/* Results Modal */
.results-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 15px;
}

.modal-content {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-blue) 100%);
    border-radius: 10px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--accent-blue);
    font-size: 1.3em;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

/* Score Card */
.score-card {
    margin-bottom: 20px;
}

.score-card h4 {
    color: var(--accent-blue);
    margin: 0 0 15px 0;
    text-align: center;
    font-size: 1.1em;
}

.score-breakdown {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 15px;
}

.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.score-row:last-child {
    border-bottom: none;
}

.score-row.total {
    border-top: 2px solid var(--accent-blue);
    padding-top: 10px;
    margin-top: 5px;
}

.score-label {
    color: var(--text-secondary);
}

.score-value {
    color: var(--accent-blue);
    font-weight: bold;
    font-size: 1.1em;
}

.score-value.correct {
    color: var(--success);
}

.score-value.incorrect {
    color: var(--danger);
}

/* Feedback Card */
.feedback-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.feedback-card h4 {
    color: var(--accent-blue);
    margin: 0 0 10px 0;
    font-size: 1.1em;
}

.feedback-card p {
    margin: 5px 0;
    color: var(--text-secondary);
}

.feedback-card strong {
    color: var(--text-primary);
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .flywithmargot-hold-trainer-container {
        padding: 10px;
    }
    
    .main-training-area {
        flex-direction: column;
    }
    
    .hsi-display-section, .navigation-panel {
        width: 100%;
    }
    
    .compact-controls {
        flex-direction: column;
    }
    
    .instrument-row {
        flex-direction: column;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .turn-buttons {
        flex-direction: column;
    }
    
    .stages-container {
        flex-wrap: wrap;
    }
    
    .stage {
        flex: 0 0 calc(50% - 5px);
        margin-bottom: 10px;
    }
    
    .usage-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .hold-header h1 {
        font-size: 1.5em;
    }
    
    .input-with-buttons {
        flex-wrap: wrap;
    }
    
    .btn-step-fast {
        width: 30px;
        height: 30px;
        font-size: 0.9em;
    }
    
    #hsi-canvas {
        max-width: 300px;
        height: 300px;
    }
}

/* Animations */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.pulsing {
    animation: pulse 1s ease-in-out infinite;
}

/* Focus States */
:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-10 { margin-top: 10px; }
.mb-10 { margin-bottom: 10px; }
.hidden { display: none !important; }

/* Top Action Button Row */
.action-buttons-top {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Entry Feedback Banner */
#entry-feedback-banner {
    margin: 15px 0;
    border-radius: 8px;
    padding: 15px;
    animation: slideIn 0.5s ease-out;
}

.feedback-correct {
    background: rgba(76, 175, 80, 0.15); /* Green tint */
    border: 2px solid #4CAF50;
    color: #d4edda;
}

.feedback-check {
    background: rgba(255, 193, 7, 0.15); /* Amber tint */
    border: 2px solid #FFC107;
    color: #fff3cd;
}

#entry-feedback-banner .btn-small {
    margin-top: 8px;
    padding: 5px 10px;
    font-size: 0.85em;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Disabled "Begin Flying" state */
#begin-flying-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--card-bg);
    border-color: var(--border-color);
}
/* Temporary hint styling */
.temp-hint {
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid #FFC107;
    border-radius: 6px;
    padding: 10px 15px;
    margin: 10px 0;
    color: #fff3cd;
    font-size: 0.9em;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Button states */
#begin-flying-btn:disabled {
    opacity: 0.7;
    cursor: default;
}