/* SoberLife III - Component Styles */
/* Specific UI component styling */

/* Avatar and Stress Meter */
.avatar-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin-right: 20px;
    transition: all 0.3s ease;
}

.stress-meter {
    width: 200px;
    height: 20px;
    background: #ddd;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #333;
}

.stress-fill {
    height: 100%;
    transition: all 0.5s ease;
    border-radius: 8px;
}

.zen-points {
    font-size: 24px;
    font-weight: bold;
    color: #2E8B57;
    margin: 10px 0;
}

/* Survey Section */
.survey {
    background: #FFF8DC;
    border: 2px solid #DAA520;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
}

.survey h3 {
    color: #B8860B;
    margin-bottom: 15px;
}

.survey-question {
    margin: 8px 0;
    text-align: left;
}

.survey-question strong {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

/* Task Info - Prominent Display */
.task-info {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    color: white;
    border: 3px solid #FF4757;
    border-radius: 20px;
    padding: 25px;
    margin: 25px 0;
    box-shadow: 0 12px 30px rgba(255, 107, 107, 0.4);
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: taskHighlight 0.8s ease-out;
    z-index: 10;
    transform: translateZ(0); /* Create stacking context */
}

.task-info::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #FF6B6B, #FF8E53, #FF6B6B, #FF8E53);
    background-size: 400% 400%;
    border-radius: 22px;
    z-index: -1;
    animation: borderGlow 3s ease-in-out infinite;
}

.task-info h3 {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

.task-info p {
    font-size: 20px;
    font-weight: 600;
    margin: 12px 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    line-height: 1.4;
}

.task-info #taskDescription {
    font-size: 24px;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 12px;
    margin: 20px 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: taskPulse 2s ease-in-out infinite;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Task change animation trigger class */
.task-info.task-changing {
    animation: taskChange 1.2s ease-out;
}

/* Step indicator styling */
.task-info .step-indicator {
    display: inline-block;
    background: rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Visual hierarchy adjustments - make other elements less prominent */
.zen-activities {
    opacity: 0.9;
    z-index: 5;
    transition: all 0.3s ease;
}

.game-area {
    opacity: 0.95;
    z-index: 5;
    transition: all 0.3s ease;
}

.survey {
    opacity: 0.9;
    z-index: 5;
    transition: all 0.3s ease;
}

.avatar-container {
    transition: all 0.3s ease;
}

/* Game Area */
.game-area {
    background: #228B22;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    color: white;
}

.cards-container {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
}

.player-area,
.house-area {
    flex: 1;
    margin: 0 10px;
}

.cards {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.card {
    width: 60px;
    height: 80px;
    background: white;
    border: 2px solid #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
}

.card.red {
    color: #DC143C;
}

.score {
    font-size: 20px;
    font-weight: bold;
    margin: 10px 0;
}

.buttons {
    margin: 20px 0;
}

/* Zen Activities */
.zen-activities {
    background: linear-gradient(135deg, #E8F5E8 0%, #D4F1D4 100%);
    border: 2px solid #2ECC71;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.zen-activities h3 {
    color: #27AE60;
    margin-bottom: 10px;
}

.zen-activities p {
    color: #2C3E50;
    margin-bottom: 15px;
    font-size: 14px;
}

.activity-buttons {
    display: flex;
    justify-content: space-around;
    gap: 10px;
    flex-wrap: wrap;
}

.activity-btn {
    background: linear-gradient(135deg, #2ECC71 0%, #27AE60 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 120px;
    max-width: 150px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.activity-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.activity-btn:disabled {
    background: #BDC3C7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.activity-btn small {
    display: block;
    font-size: 11px;
    margin-top: 5px;
    opacity: 0.9;
}

/* Game Over Screen */
.game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.game-over-content {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 4px solid #FF4757;
}

.game-over-avatar {
    font-size: 80px;
    margin-bottom: 20px;
    animation: shake 0.5s infinite;
}

.game-over h2 {
    color: white;
    font-size: 32px;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-over-message {
    color: white;
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: bold;
}

.game-over-subtext {
    color: #FFE5E5;
    font-size: 14px;
    margin-bottom: 20px;
    font-style: italic;
}

.game-over-stats {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
}

.game-over-stats p {
    color: white;
    margin: 5px 0;
    font-weight: bold;
}

#tryAgainBtn {
    background: #2ECC71;
    font-size: 18px;
    padding: 15px 30px;
    margin-top: 20px;
}

#tryAgainBtn:hover {
    background: #27AE60;
}

/* Game Success Screen */
.game-success {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.game-success-content {
    background: linear-gradient(135deg, #2ECC71 0%, #F39C12 100%);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 4px solid #27AE60;
}

.game-success-avatar {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.game-success h2 {
    color: white;
    font-size: 32px;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-success-message {
    color: white;
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: bold;
}

.game-success-subtext {
    color: #E8F8F5;
    font-size: 14px;
    margin-bottom: 20px;
    font-style: italic;
}

.game-success-stats {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
}

.game-success-stats p {
    color: white;
    margin: 5px 0;
    font-weight: bold;
}

#playAgainBtn {
    background: #F39C12;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

#playAgainBtn:hover {
    background: #E67E22;
    transform: translateY(-2px);
}

/* Help Modal */
.help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.help-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.help-modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 3px solid #4169E1;
    animation: modalSlideIn 0.3s ease-out;
}

.help-modal-header {
    background: linear-gradient(135deg, #4169E1 0%, #1E90FF 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #1E90FF;
}

.help-modal-header h2 {
    margin: 0;
    font-size: 24px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.help-close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
}

.help-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.help-modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
    font-family: 'Comic Sans MS', sans-serif;
}

.help-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #E8E8E8;
}

.help-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.help-section h3 {
    color: #4169E1;
    font-size: 20px;
    margin-bottom: 12px;
    font-weight: bold;
}

.help-section p {
    color: #333;
    line-height: 1.6;
    margin-bottom: 10px;
}

.help-section ul,
.help-section ol {
    color: #333;
    line-height: 1.6;
    padding-left: 20px;
}

.help-section li {
    margin-bottom: 8px;
}

.help-section li.zen-activity {
    background: linear-gradient(135deg, #E8F5E8 0%, #D4F1D4 100%);
    padding: 8px 12px;
    border-radius: 8px;
    border-left: 4px solid #2ECC71;
    margin: 8px 0;
    font-weight: bold;
    list-style: none;
    margin-left: -20px;
    padding-left: 16px;
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Flavor Text */
.flavor-text {
    background: linear-gradient(135deg, #F8F9FA 0%, #E9ECEF 100%);
    border-left: 4px solid #6C757D;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 15px 0;
    animation: flavorFadeIn 0.5s ease-out;
}

.flavor-text p {
    margin: 0;
    font-style: italic;
    color: #495057;
    font-size: 16px;
    line-height: 1.4;
}

@keyframes flavorFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Progress
ive Flavor Text Animations */
@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Progressive Flavor Text Styling */
.progressive-flavor {
    animation: fadeInSlide 0.3s ease-out;
}

.progressive-flavor p {
    position: relative;
    overflow: hidden;
}

.progressive-flavor p::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(to bottom, #6c757d, #adb5bd);
    animation: expandHeight 0.3s ease-out;
}

@keyframes expandHeight {
    from {
        height: 0;
    }
    to {
        height: 100%;
    }
}

/* DMV Outcome Message Styling */
.outcome-message.dmv-themed {
    animation: fadeInSlide 0.4s ease-out;
}

.outcome-message.dmv-themed p:first-child {
    position: relative;
}

.outcome-message.dmv-themed p:first-child::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    height: 2px;
    width: 100%;
    background: linear-gradient(to right, #495057, transparent);
    animation: expandWidth 0.5s ease-out 0.2s both;
}

@keyframes expandWidth {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Stress Management Tip Styling */
.stress-tip {
    font-family: 'Comic Sans MS', sans-serif;
    line-height: 1.4;
}

.stress-tip strong {
    display: block;
    margin-bottom: 6px;
    color: #0d47a1;
}

/* Initial Flavor Text Modal */
.initial-flavor-modal-overlay {
    font-family: 'Comic Sans MS', sans-serif;
}

.initial-flavor-modal-content {
    position: relative;
    overflow: hidden;
}

.initial-flavor-modal-content::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #007bff, #0056b3, #007bff, #0056b3);
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    animation: modalBorderGlow 3s ease-in-out infinite;
}

/* Continue button hover effects */
.initial-flavor-modal-content button {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.initial-flavor-modal-content button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.initial-flavor-modal-content button:hover::before {
    width: 300px;
    height: 300px;
}

.initial-flavor-modal-content button:active {
    transform: scale(0.98);
}

/* Animations for Initial Flavor Text Modal */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalBorderGlow {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Responsive adjustments for initial flavor text modal */
@media (max-width: 767px) {
    .initial-flavor-modal-overlay {
        padding: 15px;
    }
    
    .initial-flavor-modal-content {
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .initial-flavor-modal-content h2 {
        font-size: 16px !important;
        margin-bottom: 8px !important;
    }
    
    .initial-flavor-modal-content p {
        font-size: 12px !important;
        line-height: 1.3 !important;
        margin-bottom: 8px !important;
    }
    
    .initial-flavor-modal-content button {
        font-size: 13px !important;
        padding: 8px 16px !important;
        min-width: 100px !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .initial-flavor-modal-content {
        border: 4px solid #000;
        background: #fff;
    }
    
    .initial-flavor-modal-content h2 {
        color: #000 !important;
    }
    
    .initial-flavor-modal-content p {
        color: #000 !important;
    }
    
    .initial-flavor-modal-content button {
        background: #000 !important;
        color: #fff !important;
        border: 2px solid #000 !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .initial-flavor-modal-overlay {
        animation: none;
    }
    
    .initial-flavor-modal-content {
        animation: none;
    }
    
    .initial-flavor-modal-content::before {
        animation: none;
    }
    
    .initial-flavor-modal-content button {
        transition: none;
    }
    
    .initial-flavor-modal-content button::before {
        transition: none;
    }
}