/**
 * Phase 1A - Enhanced Game Mechanics Styling
 * Action Points, Victory Paths, Confidence System
 * Game-like feel with animations and feedback
 */

/* ===== Game-like Animations ===== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    60% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.8), 0 0 30px rgba(102, 126, 234, 0.6);
    }
}

/* ===== Action Points Display ===== */
.ap-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    animation: slideInUp 0.6s ease-out;
}

.ap-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.ap-counter {
    font-size: 1.4rem;
    font-weight: bold;
    text-align: center;
    padding: 0.25rem;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ap-counter.ap-warning {
    background-color: #ff9800;
    animation: pulse-warning 2s ease-in-out infinite;
}

.ap-counter.ap-depleted {
    background-color: #f44336;
    animation: pulse-danger 1s ease-in-out infinite, shake 0.5s ease-in-out;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes pulse-danger {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.ap-info {
    font-size: 0.9rem;
    text-align: center;
    margin-top: 0.5rem;
    opacity: 0.9;
}

.ap-cost {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-left: 0.5rem;
    font-weight: 600;
}

.ap-cost.high-cost {
    background-color: rgba(255, 152, 0, 0.3);
}

/* ===== Confidence Level Selector ===== */
.confidence-selector {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    animation: slideInUp 0.7s ease-out 0.2s both;
}

.confidence-selector h5 {
    margin-bottom: 1.25rem;
    color: #2c3e50;
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
}

.confidence-option {
    display: block;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #fafafa;
    position: relative;
}

.confidence-option:last-child {
    margin-bottom: 0;
}

.confidence-option:hover:not(.locked) {
    border-color: #667eea;
    background-color: #f0f4ff;
    transform: translateX(6px);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.15);
}

.confidence-option.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e7f0ff 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
    transform: translateX(6px);
    animation: glow 2s ease-in-out infinite;
}

.confidence-option.locked {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

.confidence-option.locked:hover {
    border-color: #dee2e6;
    background-color: #f5f5f5;
    transform: none;
}

.confidence-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.confidence-name {
    font-weight: 600;
    font-size: 1rem;
}

.confidence-icon {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.confidence-requirements {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.confidence-scoring {
    font-size: 0.8rem;
    color: #28a745;
    margin-top: 0.25rem;
}

.confidence-scoring .penalty {
    color: #dc3545;
}

/* ===== Differential Diagnosis Input ===== */
.differential-input {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 6px;
}

.differential-input h6 {
    margin-bottom: 0.75rem;
    color: #856404;
    font-weight: 600;
}

.differential-diagnosis-field {
    margin-bottom: 0.5rem;
}

.differential-diagnosis-field label {
    font-size: 0.85rem;
    color: #856404;
    margin-bottom: 0.25rem;
}

.differential-diagnosis-field input {
    border-color: #ffc107;
}

/* ===== Victory Path Display ===== */
.victory-paths {
    background-color: white;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.victory-paths h5 {
    margin-bottom: 1rem;
    color: #495057;
}

.path {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

.path:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.path.efficiency {
    border-left: 4px solid #007bff;
}

.path.thoroughness {
    border-left: 4px solid #28a745;
}

.path.patient-centered {
    border-left: 4px solid #dc3545;
}

.path-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.path-progress {
    width: 100%;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.path-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #8BC34A 100%);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.path-progress-bar.gold {
    background: linear-gradient(90deg, #FFD700 0%, #FFA500 100%);
    animation: glow 2s ease-in-out infinite;
}

.path-progress-bar.silver {
    background: linear-gradient(90deg, #C0C0C0 0%, #A9A9A9 100%);
}

.path-progress-bar.bronze {
    background: linear-gradient(90deg, #CD7F32 0%, #8B4513 100%);
}

.path-score {
    font-size: 1.1rem;
    font-weight: bold;
    color: #495057;
}

/* ===== Medal Display ===== */
.medal-display {
    text-align: center;
    padding: 2rem;
    margin: 1rem 0;
    animation: slideInUp 0.6s ease-out;
}

.medal-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: medal-bounce 1s ease-in-out, popIn 0.8s ease-out;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

@keyframes medal-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.medal-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #495057;
}

/* ===== Enhanced Modal Styling ===== */
.modal-content.victory {
    border-top: 5px solid #28a745;
    animation: slideInUp 0.5s ease-out;
}

.modal-content.game-over {
    border-top: 5px solid #dc3545;
    animation: slideInUp 0.5s ease-out;
}

@keyframes celebrate {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
}

.modal.show .modal-content.victory {
    animation: slideInUp 0.5s ease-out, celebrate 0.6s ease-in-out 0.5s;
}

.modal-body .performance-summary {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
}

.performance-summary h6 {
    color: #495057;
    margin-bottom: 0.75rem;
}

.performance-metric {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #dee2e6;
}

.performance-metric:last-child {
    border-bottom: none;
}

.metric-label {
    font-weight: 500;
    color: #6c757d;
}

.metric-value {
    font-weight: 600;
    color: #495057;
}

.metric-value.good {
    color: #28a745;
}

.metric-value.warning {
    color: #ffc107;
}

.metric-value.danger {
    color: #dc3545;
}

/* ===== Turn Counter with AP Info ===== */
.turn-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

#total-turns {
    font-weight: 600;
    color: #495057;
}

/* ===== Locked Confidence Level ===== */
.confidence-locked-icon::after {
    content: " 🔒";
    color: #6c757d;
}

/* ===== Knowledge Counter ===== */
.knowledge-counter {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    text-align: center;
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.15);
    transition: all 0.3s ease;
    animation: slideInUp 0.5s ease-out 0.1s both;
}

.knowledge-counter:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(33, 150, 243, 0.2);
}

.knowledge-counter-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1976d2;
    letter-spacing: 1px;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.knowledge-counter-value.updated {
    animation: popIn 0.5s ease-out;
}

.knowledge-counter-label {
    font-size: 0.8rem;
    color: #546e7a;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* ===== Responsive Adjustments ===== */

/* Tablets and smaller laptops */
@media (max-width: 992px) {
    .doctor-section {
        margin-bottom: 1.5rem !important;
    }

    .doctor-header h4, .score-header h4 {
        font-size: 1rem;
        padding: 0.6rem;
    }

    .ap-display {
        padding: 0.6rem 0.8rem;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    /* AP Counter */
    .ap-counter {
        font-size: 1.1rem;
    }

    .ap-display {
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.75rem;
    }

    .ap-info {
        font-size: 0.8rem;
    }

    /* Knowledge Counter */
    .knowledge-counter {
        padding: 0.6rem 0.8rem;
        margin: 0.75rem 0;
    }

    .knowledge-counter-value {
        font-size: 1.3rem;
    }

    .knowledge-counter-label {
        font-size: 0.75rem;
    }

    /* Confidence Selector */
    .confidence-selector {
        padding: 1rem;
        margin: 1rem 0;
    }

    .confidence-selector h5 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .confidence-option {
        padding: 0.75rem;
        margin-bottom: 0.6rem;
    }

    .confidence-name {
        font-size: 0.9rem;
    }

    .confidence-icon {
        font-size: 1rem;
    }

    .confidence-requirements,
    .confidence-scoring {
        font-size: 0.75rem;
    }

    /* Victory Paths */
    .victory-paths {
        padding: 0.75rem;
        margin: 0.75rem 0;
    }

    .victory-paths h5 {
        font-size: 1rem;
    }

    .path {
        padding: 0.6rem;
        margin-bottom: 0.75rem;
    }

    .path-name {
        font-size: 0.9rem;
    }

    .path-score {
        font-size: 1rem;
    }

    /* People Cards */
    .nurse-info, .pathology-info, .radiology-info {
        padding: 1rem;
        margin-bottom: 1rem !important;
        border-radius: 12px;
    }

    .nurse-info > div:first-child,
    .pathology-info > div:first-child,
    .radiology-info > div:first-child {
        font-size: 1rem;
        flex-wrap: wrap;
    }

    .nurse-info > div:first-child b::before,
    .pathology-info > div:first-child b::before,
    .radiology-info > div:first-child b::before {
        font-size: 1.5rem;
        margin-right: 0.3rem;
    }

    .ask-question {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem !important;
    }

    .ask-question::after {
        font-size: 0.7rem;
    }

    /* Turn Counter */
    .turn-counter-container {
        padding: 0.5rem;
        margin-bottom: 1.5rem !important;
    }

    .turn-counter-container .turn {
        height: 2rem !important;
        margin: 0 0.1rem;
        border-width: 1px !important;
    }

    .turn-counter-container .turn.active.current span {
        font-size: 0.9rem;
    }

    /* Progress Icons */
    .icons {
        padding: 0.5rem;
        margin-top: 0.75rem !important;
    }

    .icons .col {
        padding: 0.15rem;
    }

    .icons .col span {
        width: 1.5rem !important;
        height: 1.5rem !important;
        border-width: 1.5px;
    }

    /* Headers */
    .doctor-header h4, .score-header h4 {
        font-size: 0.95rem;
        padding: 0.6rem;
    }

    .case-header, .diagnose-header {
        font-size: 0.95rem;
        padding: 0.6rem;
    }

    /* Turn Information */
    #turn-information .alert {
        font-size: 0.9rem;
        padding: 0.75rem;
    }

    /* Key Information */
    .key-info {
        padding: 1rem;
    }

    .key-info b {
        font-size: 1rem;
    }

    .key-info b::before {
        font-size: 1.3rem;
    }

    /* Medal Display */
    .medal-icon {
        font-size: 3rem;
    }

    .medal-text {
        font-size: 1.2rem;
    }

    /* Modal Performance Metrics */
    .performance-metric {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.4rem 0;
    }

    .metric-label,
    .metric-value {
        font-size: 0.9rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    /* Turn Counter - Stack vertically or hide extras */
    .turn-counter-container {
        padding: 0.4rem;
    }

    .turn-counter-container .turn {
        height: 1.75rem !important;
        margin: 0.05rem;
        font-size: 0.75rem;
    }

    /* People Cards - More compact */
    .nurse-info, .pathology-info, .radiology-info {
        padding: 0.75rem;
    }

    .nurse-info > div:first-child b::before,
    .pathology-info > div:first-child b::before,
    .radiology-info > div:first-child b::before {
        font-size: 1.2rem;
    }

    .ask-question {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem !important;
    }

    /* Icons - Smaller grid */
    .icons .col span {
        width: 1.25rem !important;
        height: 1.25rem !important;
    }

    /* AP Display */
    .ap-counter {
        font-size: 1rem;
    }

    .ap-info {
        font-size: 0.7rem;
    }

    /* Confidence Selector */
    .confidence-selector {
        padding: 0.75rem;
    }

    .confidence-option {
        padding: 0.6rem;
    }

    .confidence-option:hover:not(.locked) {
        transform: translateX(3px);
    }

    /* Headers */
    .doctor-header h4, .score-header h4 {
        font-size: 0.85rem;
        padding: 0.5rem;
    }

    /* Knowledge Counter */
    .knowledge-counter-value {
        font-size: 1.1rem;
    }

    .knowledge-counter-label {
        font-size: 0.7rem;
    }

    /* Reduce animations for performance */
    .turn-counter-container .turn,
    .confidence-option,
    button,
    .btn {
        transition: all 0.2s ease;
    }

    /* Locked badge smaller */
    .pathology-info > div.locked::after,
    .radiology-info > div.locked::after {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }
}

/* ===== Tooltips for AP Costs ===== */
.ap-tooltip {
    position: relative;
    display: inline-block;
}

.ap-tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
}

.ap-tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* ===== Button Enhancements ===== */
button, .btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

button:not(:disabled):hover, .btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

button:disabled, .btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Button click ripple effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

button.clicked::after, .btn.clicked::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ripple 0.6s ease-out;
}

/* ===== Celebration & Particle Effects ===== */
@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1) rotate(180deg);
    }
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100%) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.sparkle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #FFD700, #FFA500);
    border-radius: 50%;
    pointer-events: none;
    animation: sparkle 1s ease-out;
}

/* Success flash effect */
@keyframes success-flash {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(40, 167, 69, 0.2);
    }
}

.success-flash {
    animation: success-flash 0.6s ease-out;
}

/* Error shake */
.error-shake {
    animation: shake 0.5s ease-in-out;
}

/* ===== Modern Question Tracker (Turn Counter) ===== */
.turn-counter-container {
    margin-bottom: 2rem !important;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.turn-counter-container .turn {
    height: 2.5rem !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 8px;
    margin: 0 0.2rem;
    background: white !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.turn-counter-container .turn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.turn-counter-container .turn:hover::before {
    opacity: 1;
}

.turn-counter-container .turn.active {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%) !important;
    border-color: #28a745 !important;
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(40, 167, 69, 0.3);
}

.turn-counter-container.warning .turn.active {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%) !important;
    border-color: #ffc107 !important;
    box-shadow: 0 3px 8px rgba(255, 193, 7, 0.3);
}

.turn-counter-container.danger .turn.active {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%) !important;
    border-color: #dc3545 !important;
    box-shadow: 0 3px 8px rgba(220, 53, 69, 0.3);
    animation: pulse-danger 1s ease-in-out infinite;
}

.turn-counter-container .turn.active.current {
    animation: glow 2s ease-in-out infinite;
}

.turn-counter-container .turn.active.current span {
    font-weight: 700;
    font-size: 1.1rem;
}

/* ===== Modern People Cards ===== */
.nurse-info, .pathology-info, .radiology-info {
    margin-bottom: 1.5rem !important;
    padding: 1.5rem;
    border-radius: 16px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.nurse-info::before, .pathology-info::before, .radiology-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    transition: width 0.3s ease;
}

.nurse-info::before {
    background: linear-gradient(180deg, #fc033d 0%, #d10230 100%);
}

.pathology-info::before {
    background: linear-gradient(180deg, #03a9fc 0%, #0289d1 100%);
}

.radiology-info::before {
    background: linear-gradient(180deg, #fc7b03 0%, #d16702 100%);
}

.nurse-info:hover, .pathology-info:hover, .radiology-info:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.nurse-info:hover::before, .pathology-info:hover::before, .radiology-info:hover::before {
    width: 100%;
    opacity: 0.05;
}

.nurse-info.locked, .pathology-info.locked, .radiology-info.locked {
    opacity: 0.6;
    background: #f8f9fa;
    border-color: #dee2e6;
}

.nurse-info.locked::before, .pathology-info.locked::before, .radiology-info.locked::before {
    background: #6c757d;
}

/* Person header with emoji/icon */
.nurse-info > div:first-child,
.pathology-info > div:first-child,
.radiology-info > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.nurse-info > div:first-child b::before {
    content: '👨‍⚕️ ';
    font-size: 2rem;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.pathology-info > div:first-child b::before {
    content: '🔬 ';
    font-size: 2rem;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.radiology-info > div:first-child b::before {
    content: '🩻 ';
    font-size: 2rem;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Ask button styling */
.ask-question {
    border-radius: 8px !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
    padding: 0.6rem 1rem !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* AP Cost Badge on Ask Button */
.nurse-info .ask-question::after,
.pathology-info .ask-question::after,
.radiology-info .ask-question::after {
    content: ' (1 AP)';
    font-size: 0.75rem;
    opacity: 0.9;
    margin-left: 0.25rem;
}

.pathology-info .ask-question::after,
.radiology-info .ask-question::after {
    content: ' (3 AP)';
}

.nurse-info .ask-question {
    background: linear-gradient(135deg, #fc033d 0%, #d10230 100%) !important;
    border-color: #fc033d !important;
}

.pathology-info .ask-question {
    background: linear-gradient(135deg, #03a9fc 0%, #0289d1 100%) !important;
    border-color: #03a9fc !important;
}

.radiology-info .ask-question {
    background: linear-gradient(135deg, #fc7b03 0%, #d16702 100%) !important;
    border-color: #fc7b03 !important;
}

.ask-question:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ask-question:active:not(:disabled) {
    transform: translateY(0);
}

/* Department Card Layout */
.department-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: all 0.3s ease;
}

.department-card:hover:not(.locked) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.deck-card {
    width: 80px;
    height: 110px;
    border-radius: 8px;
    border: 3px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Card back pattern */
.deck-card::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.deck-icon {
    font-size: 2rem;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.deck-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.deck-count {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.8);
    position: relative;
    z-index: 1;
}

/* Department-specific colors */
.nurse-info .deck-card {
    background: linear-gradient(135deg, #fc033d 0%, #c44569 100%);
    border-color: #fc033d;
}

.pathology-info .deck-card {
    background: linear-gradient(135deg, #03a9fc 0%, #0288d1 100%);
    border-color: #03a9fc;
}

.radiology-info .deck-card {
    background: linear-gradient(135deg, #fc7b03 0%, #f57c00 100%);
    border-color: #fc7b03;
}

/* Help button on deck cards */
.deck-help-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.7);
    color: #2c3e50;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.deck-help-btn:hover {
    background: white;
    transform: scale(1.15);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    border-color: white;
}

/* Ask button in card layout */
.department-card .ask-question {
    flex: 1;
    min-width: 100px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
}

/* Locked state */
.department-card.locked {
    opacity: 0.6;
}

.department-card.locked .deck-card {
    filter: grayscale(50%);
}

.locked-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Hide old icons system */
.icons {
    display: none !important;
}

/* Locked state badge */
.pathology-info > div.locked::after,
.radiology-info > div.locked::after {
    content: '🔒 Locked';
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #6c757d;
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: auto;
}

/* ===== Turn Recap Section Enhancements ===== */
.turn-recap-section {
    margin-bottom: 2rem !important;
}

#turn-information-header {
    border-radius: 12px !important;
    border-left: 5px solid #6c757d !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    animation: slideInUp 0.5s ease-out;
}

#turn-information .alert {
    border-radius: 12px !important;
    border: 2px solid #e9ecef !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    animation: slideInUp 0.4s ease-out;
}

#turn-information.nurse .alert {
    border-left: 5px solid #fc033d !important;
}

#turn-information.pathology .alert {
    border-left: 5px solid #03a9fc !important;
}

#turn-information.radiology .alert {
    border-left: 5px solid #fc7b03 !important;
}

/* Key Information Section */
.key-info {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border-radius: 12px;
    border: 2px solid #ffc107;
    box-shadow: 0 3px 10px rgba(255, 193, 7, 0.15);
}

.key-info b {
    font-size: 1.1rem;
    color: #856404;
    display: flex;
    align-items: center;
}

.key-info b::before {
    content: '⭐ ';
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

#keyInformationList {
    margin-top: 0.75rem;
    padding-left: 1.5rem;
}

#keyInformationList li {
    margin-bottom: 0.5rem;
    color: #856404;
    font-weight: 500;
}

/* Diagnose Section Enhancements */
.diagnose-section {
    margin-bottom: 2rem !important;
}

.case-header, .diagnose-header {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.diagnose-status {
    padding: 0.75rem;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    text-align: center;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Doctor Section Enhancements */
.doctor-section {
    margin-bottom: 2rem !important;
}

.doctor-header h4, .score-header h4 {
    margin: 0;
    padding: 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.score-header h4 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 2px 6px rgba(245, 87, 108, 0.3);
}

/* ===== Hearts/Lives System (Duolingo-style) ===== */
.hearts-display {
    margin: 1rem 0;
    animation: slideInUp 0.6s ease-out 0.15s both;
}

.hearts-container {
    background: linear-gradient(135deg, #ffe6f0 0%, #ffd6e8 100%);
    border: 2px solid #ff69b4;
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 3px 12px rgba(255, 105, 180, 0.2);
    transition: all 0.3s ease;
}

.hearts-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(255, 105, 180, 0.3);
}

.hearts-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #c71585;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.hearts-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    min-height: 2.5rem;
}

.heart {
    font-size: 2rem;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: inline-block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.heart.filled {
    animation: heartbeat 1.5s ease-in-out infinite;
}

.heart.empty {
    opacity: 0.3;
    filter: grayscale(100%) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
    transform: scale(0.8);
}

.heart.lost {
    animation: heartLoss 0.6s ease-out forwards;
}

.heart.gained {
    animation: heartGain 0.8s ease-out forwards;
}

/* Heart animations */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes heartLoss {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.3) rotate(10deg);
    }
    100% {
        transform: scale(0.8) rotate(0deg);
        opacity: 0.3;
        filter: grayscale(100%);
    }
}

@keyframes heartGain {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.hearts-text {
    font-size: 1rem;
    font-weight: 700;
    color: #c71585;
}

/* Hearts state indicators */
.hearts-container.critical {
    background: linear-gradient(135deg, #ffe6e6 0%, #ffd6d6 100%);
    border-color: #dc3545;
    animation: pulse-danger 1s ease-in-out infinite;
}

.hearts-container.critical .hearts-label,
.hearts-container.critical .hearts-text {
    color: #dc3545;
}

.hearts-container.low {
    background: linear-gradient(135deg, #fff8e6 0%, #ffefd6 100%);
    border-color: #ffc107;
}

.hearts-container.low .hearts-label,
.hearts-container.low .hearts-text {
    color: #856404;
}

/* Heart notification toast */
.heart-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    text-align: center;
    animation: popIn 0.5s ease-out;
}

.heart-notification.lost {
    border: 3px solid #dc3545;
}

.heart-notification.gained {
    border: 3px solid #28a745;
}

.heart-notification-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.heart-notification-message {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

.heart-notification-subtext {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

/* ===== Landing Page Redesign (Duolingo-style) ===== */

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 3rem 0 2rem 0;
    animation: slideInUp 0.8s ease-out;
}

.hero-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: popIn 1s ease-out 0.3s both;
}

.hero-svg {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.15));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    animation: slideInUp 0.8s ease-out 0.1s both;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: #6c757d;
    margin-bottom: 2rem;
    animation: slideInUp 0.8s ease-out 0.2s both;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    min-width: 120px;
    transition: all 0.3s ease;
    animation: popIn 0.6s ease-out both;
}

.stat-item:nth-child(1) { animation-delay: 0.4s; }
.stat-item:nth-child(2) { animation-delay: 0.5s; }
.stat-item:nth-child(3) { animation-delay: 0.6s; }
.stat-item:nth-child(4) { animation-delay: 0.7s; }

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-svg {
    width: 60px;
    height: 60px;
    transition: all 0.3s ease;
}

.stat-item:hover .stat-svg {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.3));
}

.stat-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Quick Start Card */
.quick-start-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    margin: 2rem 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    animation: slideInUp 0.8s ease-out 0.3s both;
}

.quick-start-card h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.quick-start-card > p {
    color: #6c757d;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Mode Selection */
.mode-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.mode-card {
    background: white;
    border: 3px solid #e9ecef;
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.mode-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.easy-mode-card {
    border-color: #28a745;
}

.easy-mode-card:hover {
    border-color: #20c997;
    background: linear-gradient(135deg, #f0fff4 0%, #e6fff0 100%);
}

.hard-mode-card {
    border-color: #dc3545;
}

.hard-mode-card:hover {
    border-color: #ff6b6b;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe6e6 100%);
}

.mode-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
}

.mode-badge.challenge {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

.mode-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
}

.mode-card h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-align: center;
}

.mode-features {
    list-style: none;
    padding: 0;
    margin-bottom: 2rem;
}

.mode-features li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f3f5;
    font-size: 1rem;
    color: #495057;
}

.mode-features li:last-child {
    border-bottom: none;
}

.mode-input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mode-input {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.mode-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.btn-start {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-start:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-start:disabled {
    background: #dee2e6;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-icon {
    font-size: 1.2rem;
}

/* How It Works Section */
.how-it-works {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
}

.how-it-works-toggle {
    width: 100%;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.how-it-works-toggle:hover {
    border-color: #667eea;
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.toggle-icon {
    font-size: 1.5rem;
}

.toggle-arrow {
    margin-left: auto;
    font-size: 1rem;
    color: #6c757d;
}

.how-it-works-content {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #dee2e6;
}

.how-it-works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.how-step {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.how-step:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.step-number {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.step-icon {
    font-size: 3rem;
    margin: 1rem 0;
}

.how-step h5 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.how-step p {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 0;
}

.game-features {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.game-features h5 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.feature {
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

/* Footer Info */
.footer-info {
    text-align: center;
    padding: 2rem 0;
    max-width: 800px;
    margin: 0 auto;
}

.info-note, .info-source {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.6;
}

.info-note {
    border-left: 4px solid #ffc107;
}

.info-source {
    border-left: 4px solid #17a2b8;
}

/* Responsive for Landing Page */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .hero-stats {
        gap: 1rem;
    }

    .hero-svg {
        width: 90px;
        height: 90px;
    }

    .stat-item {
        min-width: 100px;
        padding: 0.75rem;
    }

    .stat-icon {
        font-size: 2rem;
    }

    .stat-svg {
        width: 50px;
        height: 50px;
    }

    .quick-start-card {
        padding: 1.5rem;
    }

    .mode-selection {
        grid-template-columns: 1fr;
    }

    .how-it-works-grid {
        grid-template-columns: 1fr;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-icon {
        font-size: 3.5rem;
    }

    .hero-svg {
        width: 70px;
        height: 70px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .stat-item {
        min-width: 80px;
        padding: 0.5rem;
    }

    .stat-svg {
        width: 40px;
        height: 40px;
    }
}
