/* משתנים כלליים */
:root {
    --primary-color: #1b4332;
    --secondary-color: #2d6a4f;
    --accent-color: #95d5b2;
    --light-color: #f5f5f5;
    --dark-color: #0d1b2a;
    --warning-color: #e63946;
    --success-color: #2a9d8f;
    --info-color: #457b9d;
    --border-radius: 12px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* איפוס ועיצוב בסיסי */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rubik', sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
    transition: var(--transition);
    min-height: 100vh;
    padding-bottom: 20px;
}

/* מצבי נגישות */
body.dark-mode {
    background-color: #121212;
    color: #f2f2f2;
}

body.dark-mode .container > * {
    background-color: #1e1e1e;
    color: #f2f2f2;
}

body.sepia-mode {
    background-color: #ffffe0;
    color: #5c4b37;
}

body.sepia-mode .container > * {
    background-color: #f5e9d0;
    color: #5c4b37;
}

body.blue-dark-mode {
    background-color: #0d1b2a;
    color: #e0e1dd;
}

body.blue-dark-mode .container > * {
    background-color: #1b263b;
    color: #e0e1dd;
}


/* קונטיינר ראשי */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* כותרת */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    color: white;
    position: relative;
    overflow: hidden;
}

header::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: 0;
}

header > * {
    position: relative;
    z-index: 1;
}

header h1 {
    margin-bottom: 10px;
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.game-subtitle {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.badge {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
}

/* לוח סטטיסטיקות מהיר */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border: 2px solid transparent;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-info {
    flex: 1;
}

.stat-label {
    display: block;
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* תיאור מקרה */
.case-description {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--box-shadow);
    border-left: 6px solid var(--info-color);
}

.case-description h2 {
    color: var(--info-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.case-text-container {
    background-color: #e9f5db;
    color: var(--info-color);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-right: 4px solid var(--accent-color);
}

#case-text {
    font-size: 1.3rem;
    line-height: 1.8;
}

.case-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.case-tag {
    background-color: #f0f0f0;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--dark-color);
}

.difficulty-נמוך {
    background-color: #d4edda;
    color: #155724;
}

.difficulty-בינוני {
    background-color: #fff3cd;
    color: #856404;
}

.difficulty-גבוה {
    background-color: #f8d7da;
    color: #721c24;
}

/* לוח שליטה */
.control-panel {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--box-shadow);
}

.control-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* כפתורים */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-icon {
    min-width: 180px;
}

.btn-large {
    padding: 18px 40px;
    font-size: 1.2rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background-color: var(--info-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #1d3557;
    transform: translateY(-3px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #21867a);
    color: white;
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-warning {
    background-color: #ffaa00;
    color: white;
}

.btn-warning:hover {
    background-color: #e69500;
    transform: translateY(-3px);
}

/* קטגוריות שאלות */
.section-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    background: white;
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.section-tab {
    flex: 1;
    min-width: 180px;
    padding: 18px;
    background-color: #f8f9fa;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--dark-color);
    position: relative;
}

.section-tab:hover {
    background-color: #e9ecef;
    transform: translateY(-3px);
}

.section-tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: var(--accent-color);
}

.tab-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--warning-color);
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* שאלות */
.questions-container {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--box-shadow);
    min-height: 200px;
}

.question-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.question-btn {
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    font-size: 1.1rem;
    text-align: right;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.question-btn:hover:not(:disabled) {
    background-color: var(--accent-color);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.question-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.question-btn.asked {
    background-color: #d8f3dc;
    border-color: var(--success-color);
    color: #1b4332;
}

.question-btn.unavailable {
    background-color: #f8d7da;
    border-color: var(--warning-color);
    color: #721c24;
}

.asked-icon {
    color: var(--success-color);
    font-size: 1.2rem;
}

.unavailable-icon {
    color: var(--warning-color);
    font-size: 1.2rem;
}

.no-questions {
    text-align: center;
    padding: 40px;
    color: var(--secondary-color);
    font-size: 1.2rem;
}

/* חלון תשובה */
.answer-section {
    background-color: white;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: all 0.5s ease;
}

.answer-section.show {
    max-height: 500px;
    opacity: 1;
}

.answer-header {
    background: linear-gradient(135deg, var(--info-color), #1d3557);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-answer {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.close-answer:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.answer-content {
    padding: 30px;
}

#current-question-text {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

#current-answer-text {
    font-size: 1.2rem;
    line-height: 1.8;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-right: 4px solid var(--accent-color);
}

/* שאלות שנשאלו */
.asked-questions {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--box-shadow);
}

.asked-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.asked-header h3 {
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.asked-count {
    color: var(--info-color);
    font-weight: bold;
}

.asked-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.asked-item {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid var(--accent-color);
    transition: var(--transition);
}

.asked-item:hover {
    transform: translateX(-5px);
}

.asked-question {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-weight: 500;
}

.asked-answer {
    color: var(--dark-color);
    padding-right: 20px;
    line-height: 1.6;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--secondary-color);
    font-size: 1.2rem;
    opacity: 0.7;
}

/* הודעות */
.game-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    z-index: 1000;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.5s ease;
}

.game-message.show {
    opacity: 1;
    transform: translateX(0);
}

.game-message.success {
    border-left: 6px solid var(--success-color);
}

.game-message.error {
    border-left: 6px solid var(--warning-color);
}

.game-message.warning {
    border-left: 6px solid #ffaa00;
}

.game-message.info {
    border-left: 6px solid var(--info-color);
}

.message-icon {
    font-size: 1.5rem;
}

.message-icon .fa-check-circle {
    color: var(--success-color);
}

.message-icon .fa-exclamation-circle {
    color: var(--warning-color);
}

.message-icon .fa-exclamation-triangle {
    color: #ffaa00;
}

.message-icon .fa-info-circle {
    color: var(--info-color);
}

.message-text {
    flex: 1;
}

/* מודלים */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: white;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 25px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 30px;
}

/* חיפוש מצבים */
.search-box {
    position: relative;
    margin-bottom: 20px;
}

#condition-search {
    width: 100%;
    padding: 15px 20px 15px 50px;
    border: 2px solid #dee2e6;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    transition: var(--transition);
}

#condition-search:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-box i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
}

/* רשימת מצבים רפואיים */
.conditions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.condition-card {
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.condition-card:hover {
    background-color: var(--accent-color);
    border-color: var(--primary-color);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.condition-name {
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.condition-tags {
    display: flex;
    gap: 5px;
    justify-content: center;
    flex-wrap: wrap;
}

.condition-tag {
    background-color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--secondary-color);
}

/* הוראות */
.instructions-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.instruction-step {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.step-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content h4 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.scoring-system {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: var(--border-radius);
    border: 2px dashed var(--accent-color);
}

.scoring-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.score-item {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid transparent;
}

.score-item.bonus {
    border-color: gold;
}

.score-points {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.score-desc {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.tips {
    background-color: #fff3cd;
    padding: 25px;
    border-radius: var(--border-radius);
    border-left: 6px solid #ffaa00;
}

.tips ul {
    padding-right: 20px;
    margin-top: 10px;
}

.tips li {
    margin-bottom: 8px;
}

/* רמז */
.hint-modal .modal-content {
    max-width: 500px;
}

.hint-cost {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffaa00;
    font-weight: bold;
    margin: 20px 0;
    padding: 15px;
    background-color: #fff9e6;
    border-radius: 8px;
}

/* תעודה */
.certificate {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.certificate.hidden {
    display: none;
}

.certificate-content {
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    border-radius: var(--border-radius);
    padding: 40px;
    width: 90%;
    max-width: 600px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    border: 15px solid var(--accent-color);
    position: relative;
    overflow: hidden;
}

.certificate-content::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(149, 213, 178, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: 0;
}

.certificate-content > * {
    position: relative;
    z-index: 1;
}

.certificate-header h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 2.5rem;
}

.trophy {
    font-size: 5rem;
    color: gold;
    margin: 20px 0;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-15px); }
}

#cert-condition {
    color: var(--secondary-color);
    font-size: 2.2rem;
    margin: 20px 0;
    padding: 15px;
    background-color: rgba(149, 213, 178, 0.3);
    border-radius: 8px;
    border: 3px dashed var(--accent-color);
}

.certificate-explanation {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: right;
}

.certificate-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
}

.cert-stat {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    min-width: 150px;
    border: 2px solid var(--accent-color);
}

.cert-stat-label {
    display: block;
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.cert-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* זיקוקים */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4000;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 20px;
    opacity: 0.8;
    animation: fall linear forwards;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

/* רספונסיביות */
@media (max-width: 1200px) {
    .question-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 992px) {
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .section-tab {
        min-width: 150px;
    }
    
    .conditions-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
    }
    
    .control-buttons {
        flex-direction: column;
    }
    
    .btn-icon {
        width: 100%;
    }
    
    .section-tabs {
        flex-direction: column;
    }
    
    .question-grid {
        grid-template-columns: 1fr;
    }
    
    .certificate-stats {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .case-description, .control-panel, .questions-container, .asked-questions {
        padding: 20px;
    }
    
    .accessibility-panel {
        width: 250px;
        left: 10px;
    }
}