/* Medical Questionnaire Styles - با پیشوند mq برای جلوگیری از کانفلیکت */

/* ===== RESET & BASE ===== */
.mq-wrapper * {
    box-sizing: border-box;
}

.mq-wrapper {
    max-width: 1270px;
    margin: 40px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: inherit;
    direction: rtl;
    text-align: right;
    position: relative;
}

/* ===== STEPS ===== */
.mq-step {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.mq-step.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ===== TYPOGRAPHY ===== */
.mq-title {
    color: #2c3e50;
    font-size: 28px;
    margin: 0 0 15px 0;
    font-weight: bold;
    border-bottom: 3px solid #2B7C71;
    padding-bottom: 10px;
    line-height: 1.4;
}

.mq-description {
    color: #7f8c8d;
    font-size: 16px;
    margin: 0 0 25px 0;
    line-height: 1.6;
}

/* ===== FORM FIELDS ===== */
.mq-field {
    margin-bottom: 25px;
}

.mq-field label {
    display: block;
    font-weight: bold;
    color: #34495e;
    margin-bottom: 8px;
    font-size: 16px;
}

.mq-select {
    width: 100%;
    padding: 5px 15px;
    font-size: 16px;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    background-color: #fff;
    transition: all 0.3s ease;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23333" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: left 10px center;
    background-size: 20px;
    padding-left: 40px;
}

.mq-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.mq-select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.mq-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.mq-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.mq-input::placeholder {
    color: #95a5a6;
}

.required {
    color: #e74c3c;
    font-weight: bold;
}

/* ===== CUSTOM BUTTONS ===== */
.mq-btn {
    display: inline-block;
    padding: 14px 30px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    line-height: 1.5;
    user-select: none;
}

.mq-btn:focus {
    outline: none;
}

.mq-btn:active {
    transform: scale(0.98);
}

.mq-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.mq-btn-primary {
    background: linear-gradient(135deg, #2B7C71, #2B7C71);
    color: white !important;
    border-radius:8px !important;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.mq-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #2B7C71, #2B7C71);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.mq-btn-secondary {
    background: #95a5a6;
    color: white ;
    border-radius:8px !important;
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

.mq-btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(149, 165, 166, 0.4);
}

.mq-btn-success {
    background: linear-gradient(135deg, #2B7C71, #2B7C71);
    color: white !important;
    border-radius:8px !important;
    margin-top:10px !important;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.mq-btn-success:hover {
    background: linear-gradient(135deg, #2B7C71, #2B7C71);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.mq-btn-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* ===== QUESTIONS ===== */
.mq-questions-form {
    margin: 0;
    padding: 0;
}

.mq-question {
    background: #f8f9fa;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    border-right: 4px solid #2B7C71;
    transition: all 0.3s ease;
}

.mq-question:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: #f5f7f9;
}

.mq-question-text {
    font-size: 16px;
    color: #2c3e50;
    margin: 0 0 15px 0;
    line-height: 1.8;
}

.mq-question-text strong {
    color: #2B7C71;
}

.mq-radio-group {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.mq-radio-label {
    display: flex;
    align-items: center;
    font-size: 16px;
    color: #34495e;
    cursor: pointer;
    transition: color 0.3s ease;
    user-select: none;
}

.mq-radio-label:hover {
    color: #3498db;
}

.mq-radio-label input[type="radio"] {
    margin-left: 8px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #2B7C71;
}

/* ===== RESULT SECTION ===== */
.mq-result {
    animation: mq-fadeIn 0.5s ease-in-out;
}

@keyframes mq-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mq-result-content {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
}

.mq-result-title {
    color: #ffffff;
    font-size: 26px;
    margin: 0 0 20px 0;
    text-align: center;
    background: linear-gradient(135deg, #2B7C71, #2B7C71);
    padding: 15px;
    border-radius: 8px;
    line-height: 1.4;
}

.mq-result-section {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.mq-result-section h4 {
    color: #2B7C71;
    font-size: 20px;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.mq-result-section p {
    color: #555;
    line-height: 1.8;
    font-size: 15px;
    margin: 0;
}

.mq-warning-box {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.mq-warning-box h4 {
    color: #856404;
    margin: 0 0 10px 0;
    font-size: 18px;
}

.mq-warning-box p {
    color: #856404;
    line-height: 1.7;
    font-size: 14px;
    margin: 0;
}

.mq-treatment-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.mq-treatment-section > h4 {
    color: #27ae60;
    font-size: 22px;
    margin: 0 0 20px 0;
    text-align: center;
    line-height: 1.4;
}

.mq-solution {
    background: #f8f9fa;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    border-right: 4px solid #27ae60;
}

.mq-solution h5 {
    color: #2c3e50;
    font-size: 17px;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.mq-solution p {
    color: #555;
    line-height: 1.7;
    font-size: 15px;
    margin: 0 0 10px 0;
}

.mq-solution p:last-child {
    margin-bottom: 0;
}

.mq-link {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.mq-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

.mq-note {
    background: #e8f4f8;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.6;
}

.mq-note strong {
    color: #2c3e50;
}

.mq-final-warning {
    background: #f8d7da;
    border: 2px solid #f5c6cb;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.mq-final-warning p {
    color: #721c24;
    margin: 0;
    line-height: 1.7;
    font-size: 14px;
}

.mq-final-warning strong {
    font-weight: bold;
}

/* ===== SUCCESS MESSAGE ===== */
.mq-success {
    text-align: center;
    padding: 40px 20px;
}

.mq-success-icon {
    width: 80px;
    height: 80px;
    color: #27ae60;
    margin: 0 auto 20px;
    display: block;
    stroke-width: 2;
}

.mq-success h2 {
    color: #27ae60;
    font-size: 26px;
    margin: 0 0 15px 0;
    line-height: 1.4;
}

.mq-success p {
    color: #555;
    font-size: 16px;
    line-height: 1.8;
    margin: 0 0 10px 0;
}

.mq-phone-info {
    background: #e8f4f8;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 15px;
    line-height: 1.6;
}

.mq-phone-info strong {
    color: #2c3e50;
}

/* ===== USER FORM ===== */
.mq-user-form {
    margin: 0;
    padding: 0;
}

/* ===== LOADER ===== */
#mq-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.mq-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    animation: mq-spin 1s linear infinite;
}

@keyframes mq-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .mq-wrapper {
        margin: 20px;
        padding: 20px;
    }
    
    .mq-title {
        font-size: 24px;
    }
    
    .mq-description {
        font-size: 14px;
    }
    
    .mq-btn-group {
        flex-direction: column;
    }
    
    .mq-btn {
        width: 100%;
        text-align: center;
    }
    
    .mq-radio-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .mq-result-title {
        font-size: 22px;
    }
    
    .mq-result-section h4 {
        font-size: 18px;
    }
    
    .mq-treatment-section > h4 {
        font-size: 20px;
    }
    
    .mq-success h2 {
        font-size: 22px;
    }
    
    .mq-success-icon {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .mq-wrapper {
        margin: 10px;
        padding: 15px;
    }
    
    .mq-title {
        font-size: 20px;
    }
    
    .mq-question {
        padding: 15px;
    }
    
    .mq-result-section {
        padding: 15px;
    }
    
    .mq-solution {
        padding: 12px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .mq-wrapper {
        box-shadow: none;
        padding: 0;
    }
    
    .mq-btn,
    #mq-loader {
        display: none !important;
    }
    
    .mq-step {
        display: none !important;
    }
    
    .mq-step.active {
        display: block !important;
    }
}

/* ===== ACCESSIBILITY ===== */
.mq-wrapper :focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.mq-radio-label input[type="radio"]:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* ===== ANIMATIONS ===== */
@keyframes mq-slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mq-question {
    animation: mq-slideIn 0.3s ease-out;
}

.mq-question:nth-child(1) { animation-delay: 0.05s; }
.mq-question:nth-child(2) { animation-delay: 0.1s; }
.mq-question:nth-child(3) { animation-delay: 0.15s; }
.mq-question:nth-child(4) { animation-delay: 0.2s; }
.mq-question:nth-child(5) { animation-delay: 0.25s; }

/* ===== UTILITY CLASSES ===== */
.mq-text-center {
    text-align: center;
}

.mq-mt-20 {
    margin-top: 20px;
}

.mq-mb-20 {
    margin-bottom: 20px;
}

/* ===== IE11 SUPPORT ===== */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    .mq-select {
        background-image: none;
        padding-left: 15px;
    }
}