/* Hearing Test Plugin Styles */
.hearing-test-wrapper {
    font-family: 'Tahoma', 'Segoe UI', sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* هدر */
.test-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
}

.test-header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.test-header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.test-header .alert {
    background: rgba(255,255,255,0.2);
    border: none;
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
}

/* مراحل */
.test-steps {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
    position: relative;
}

.test-steps::before {
    content: '';
    position: absolute;
    top: 25px;
    left: 10%;
    right: 10%;
    height: 3px;
    background: #dee2e6;
    z-index: 1;
}

.step {
    text-align: center;
    position: relative;
    z-index: 2;
    flex: 1;
}

.step-circle {
    width: 50px;
    height: 50px;
    background: #dee2e6;
    color: #6c757d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 1.2rem;
    font-weight: bold;
    border: 3px solid white;
    transition: all 0.3s ease;
}

.step.active .step-circle {
    background: #28a745;
    color: white;
    transform: scale(1.1);
}

.step-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.step.active .step-label {
    color: #28a745;
    font-weight: bold;
}

/* کارت‌ها */
.section-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.section-card h3 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.3rem;
    border-bottom: 2px solid #f1f3f5;
    padding-bottom: 10px;
}

/* انتخاب گوش */
.ear-selection {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn-ear {
    flex: 1;
    max-width: 200px;
    padding: 25px 15px;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-ear:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.btn-ear.active {
    border-color: #007bff;
    background: #e7f1ff;
}

.btn-ear-right.active {
    border-color: #ff6384;
    background: #ffe6eb;
}

.btn-ear-left.active {
    border-color: #36a2eb;
    background: #e6f2ff;
}

.btn-ear i {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
    color: #6c757d;
}

.btn-ear.active i {
    color: inherit;
}

.btn-ear span {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.btn-ear small {
    font-size: 0.85rem;
    color: #6c757d;
}

/* اطلاعات تست */
.test-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.info-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.info-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #495057;
}

/* کنترل صدا */
.audio-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.btn-play {
    padding: 15px 30px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-play:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-play:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.volume-slider {
    display: flex;
    align-items: center;
    gap: 15px;
}

.volume-slider label {
    font-weight: 500;
    color: #495057;
    min-width: 80px;
}

.volume-slider input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #dee2e6;
    outline: none;
}

.volume-slider input[type="range"]::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
}

#volume-display {
    min-width: 40px;
    text-align: center;
    font-weight: 500;
}

/* دکمه‌های پاسخ */
.response-buttons {
    display: flex;
    gap: 20px;
}

.btn-response {
    flex: 1;
    padding: 20px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.btn-response i {
    font-size: 2rem;
    margin-bottom: 10px;
}

.btn-response span {
    margin-bottom: 5px;
}

.btn-response small {
    font-size: 0.85rem;
    opacity: 0.8;
}

.btn-heard {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.btn-heard:hover {
    background: #c3e6cb;
    transform: translateY(-3px);
}

.btn-not-heard {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.btn-not-heard:hover {
    background: #f5c6cb;
    transform: translateY(-3px);
}

.btn-response:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* فرکانس‌ها */
.frequencies {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.freq-item {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.freq-item.active {
    border-color: #007bff;
    background: #e7f1ff;
    transform: scale(1.05);
}

.freq-number {
    font-size: 1.8rem;
    font-weight: bold;
    color: #495057;
    margin-bottom: 5px;
}

.freq-label {
    font-size: 0.9rem;
    color: #6c757d;
}

.freq-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: #28a745;
    width: 0%;
    transition: width 0.3s ease;
}

/* پیشرفت */
.progress-container {
    margin-top: 10px;
}

.progress-bar {
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #6c757d;
}

/* نتایج */
.results-section {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.chart-wrapper {
    position: relative;
    height: 400px;
    margin: 20px 0;
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.legend-text {
    font-weight: 500;
}

/* نتیجه نهایی */
.final-result {
    margin: 30px 0;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
}

.result-normal {
    background: #d4edda;
    border: 2px solid #c3e6cb;
    color: #155724;
}

.result-warning {
    background: #fff3cd;
    border: 2px solid #ffeaa7;
    color: #856404;
}

.final-result h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.final-result p {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

/* اطلاعات دکتر */
.doctor-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #007bff;
    margin: 30px 0;
}

.doctor-header {
    background: #007bff;
    color: white;
    padding: 20px;
    text-align: center;
}

.doctor-header h3 {
    margin: 0;
    font-size: 1.4rem;
}

.doctor-body {
    padding: 25px;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.contact-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.contact-item i {
    font-size: 1.5rem;
    color: #007bff;
    margin-top: 5px;
}

.contact-item h4 {
    margin: 0 0 8px 0;
    color: #495057;
    font-size: 1.1rem;
}

.contact-item p {
    margin: 0;
    color: #6c757d;
    line-height: 1.5;
}

.phone-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
}

.phone-link:hover {
    text-decoration: underline;
}

/* دکمه‌های عمل */
.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

.btn-restart, .btn-print {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-restart {
    background: #6c757d;
    color: white;
}

.btn-restart:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-print {
    background: #17a2b8;
    color: white;
}

.btn-print:hover {
    background: #138496;
    transform: translateY(-2px);
}

/* پیام‌ها */
#test-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.message {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    color: white;
    animation: slideIn 0.3s ease;
    min-width: 300px;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
        to { transform: translateX(0); opacity: 1; }
}

.message.success {
    background: #28a745;
    border-left: 5px solid #1e7e34;
}

.message.error {
    background: #dc3545;
    border-left: 5px solid #bd2130;
}

.message.info {
    background: #17a2b8;
    border-left: 5px solid #117a8b;
}

.message.warning {
    background: #ffc107;
    color: #212529;
    border-left: 5px solid #d39e00;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .hearing-test-wrapper {
        padding: 15px;
    }
    
    .test-header h1 {
        font-size: 1.8rem;
    }
    
    .test-steps {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .test-steps::before {
        display: none;
    }
    
    .step {
        flex: 0 0 calc(50% - 15px);
    }
    
    .ear-selection {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-ear {
        max-width: 100%;
        width: 100%;
    }
    
    .response-buttons {
        flex-direction: column;
    }
    
    .frequencies {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-restart, .btn-print {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .test-info-grid {
        grid-template-columns: 1fr;
    }
    
    .frequencies {
        grid-template-columns: 1fr;
    }
    
    .step {
        flex: 0 0 100%;
    }
}

