:root {
    --primary: #4a6fa5;
    --secondary: #c6d8e8;
    --accent: #ff9a8d;
    --light: #f8f9fa;
    --dark: #2c3e50;
    --success: #66bb6a;
    --warning: #ffa726;
    --danger: #ef5350;
    --shadow: rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--light);
    color: #333;
    line-height: 1.6;
}

body[dir="rtl"] {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    text-align: right;
}

body[dir="ltr"] {
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: ltr;
    text-align: left;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Floating Language Toggle */
.floating-language-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

body[dir="ltr"] .floating-language-toggle {
    right: auto;
    left: 20px;
}

.floating-lang-btn {
    background: var(--primary);
    border: none;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    position: relative;
}

.floating-lang-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background: #3a5a8c;
}

.floating-lang-btn .lang-text {
    font-size: 0.9rem;
    position: absolute;
    bottom: -25px;
    width: 100px;
    text-align: center;
    left: 50%;
    transform: translateX(-50%);
    color: var(--dark);
    font-weight: 600;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--primary) 0%, #6a8bc5 100%);
    color: white;
    padding: 3rem 0 2rem;
    text-align: center;
    border-bottom: 8px solid var(--secondary);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.1;
}

.header-content {
    position: relative;
    z-index: 1;
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: white;
}

body[dir="ltr"] h1 {
    font-weight: 300;
}

.tagline {
    font-size: 1.2rem;
    font-weight: 300;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.9);
}

/* Main Content */
main {
    padding: 3rem 0;
    background-color: var(--light);
}

.section {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px var(--shadow);
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    transition: transform 0.3s ease;
    border-left: 6px solid var(--primary);
}

body[dir="rtl"] .section {
    border-left: none;
    border-right: 6px solid var(--primary);
}

.section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.section-title {
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--secondary);
    display: flex;
    align-items: center;
}

body[dir="rtl"] .section-title {
    flex-direction: row-reverse;
    text-align: right;
}

body[dir="ltr"] .section-title {
    text-align: left;
}

.section-title i {
    margin-right: 15px;
    background-color: var(--secondary);
    padding: 10px;
    border-radius: 50%;
    color: var(--primary);
}

body[dir="rtl"] .section-title i {
    margin-right: 0;
    margin-left: 15px;
}

.subsection {
    margin-bottom: 1.8rem;
}

.subsection-title {
    color: var(--dark);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

body[dir="rtl"] .subsection-title {
    flex-direction: row-reverse;
    text-align: right;
}

body[dir="ltr"] .subsection-title {
    text-align: left;
}

.subsection-title i {
    margin-right: 10px;
    color: var(--primary);
}

body[dir="rtl"] .subsection-title i {
    margin-right: 0;
    margin-left: 10px;
}

p {
    margin-bottom: 1rem;
    font-size: 1.05rem;
    text-align: justify;
    color: #444;
}

ul, ol {
    margin-bottom: 1.5rem;
}

body[dir="rtl"] ul, body[dir="rtl"] ol {
    margin-right: 1.5rem;
    padding-right: 1.5rem;
}

body[dir="ltr"] ul, body[dir="ltr"] ol {
    margin-left: 1.5rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.7rem;
    padding-left: 0.5rem;
    color: #555;
}

body[dir="rtl"] li {
    padding-left: 0;
    padding-right: 0.5rem;
}

/* Colored Boxes */
.highlight {
    background-color: var(--secondary);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid var(--primary);
}

body[dir="rtl"] .highlight {
    border-left: none;
    border-right: 4px solid var(--primary);
}

.myth-buster {
    background-color: #fff9e6;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid var(--warning);
    color: #5d4037;
}

body[dir="rtl"] .myth-buster {
    border-left: none;
    border-right: 4px solid var(--warning);
}

.myth-buster .subsection-title {
    color: #e67e22;
}

.icon-list {
    list-style-type: none;
}

body[dir="rtl"] .icon-list, body[dir="ltr"] .icon-list {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
}

.icon-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

body[dir="rtl"] .icon-list li {
    flex-direction: row-reverse;
}

.icon-list i {
    margin-right: 15px;
    margin-top: 5px;
    color: var(--primary);
    flex-shrink: 0;
}

body[dir="rtl"] .icon-list i {
    margin-right: 0;
    margin-left: 15px;
}

.warning {
    background-color: #ffebee;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid var(--danger);
    color: #b71c1c;
}

body[dir="rtl"] .warning {
    border-left: none;
    border-right: 4px solid var(--danger);
}

.warning .subsection-title {
    color: #c62828;
}

.info-box {
    background-color: #e8f5e9;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid var(--success);
    color: #1b5e20;
}

body[dir="rtl"] .info-box {
    border-left: none;
    border-right: 4px solid var(--success);
}

.info-box .subsection-title {
    color: #2e7d32;
}

/* Visual elements */
.procedure-visual {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 2rem 0;
    flex-wrap: wrap;
}

body[dir="rtl"] .procedure-visual {
    flex-direction: row-reverse;
}

.position-demo {
    flex: 1;
    min-width: 300px;
    background-color: var(--light);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1rem;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--secondary);
}

.position-demo i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.position-demo h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.position-demo p {
    color: #666;
    text-align: center;
}

/* Interactive Contraindications Cards */
.contraindications-container {
    margin: 2rem 0;
}

.contra-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 2px solid #eee;
    flex-wrap: wrap;
}

body[dir="rtl"] .contra-tabs {
    flex-direction: row-reverse;
}

.contra-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    transition: all 0.3s ease;
    position: relative;
}

.contra-tab.active {
    color: var(--primary);
}

.contra-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary);
}

body[dir="rtl"] .contra-tab.active::after {
    left: auto;
    right: 0;
}

.contra-tab:hover {
    color: var(--primary);
    background-color: rgba(74, 111, 165, 0.05);
}

.contra-cards-container {
    position: relative;
    min-height: 400px;
}

.contra-cards {
    display: none;
}

.contra-cards.active {
    display: block;
}

.contra-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 2px solid #eee;
    transition: all 0.3s ease;
}

.contra-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.contra-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

body[dir="rtl"] .contra-card-header {
    flex-direction: row-reverse;
}

.contra-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #ffebee;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: #c62828;
    font-size: 1.3rem;
}

body[dir="rtl"] .contra-card-icon {
    margin-right: 0;
    margin-left: 15px;
}

.contra-card-title {
    font-size: 1.3rem;
    color: var(--dark);
    flex-grow: 1;
}

.contra-card-body {
    margin-bottom: 1.5rem;
    color: #555;
    line-height: 1.6;
}

.check-question {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed #ddd;
}

.check-question p {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark);
    text-align: right;
}

body[dir="ltr"] .check-question p {
    text-align: left;
}

.check-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

body[dir="rtl"] .check-options {
    flex-direction: row-reverse;
}

.check-option {
    padding: 8px 20px;
    border: 2px solid #ddd;
    border-radius: 30px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #555;
}

.check-option:hover {
    background-color: #f5f5f5;
    border-color: #bbb;
}

.check-option.selected-yes {
    background-color: #e8f5e9;
    border-color: var(--success);
    color: #2e7d32;
}

.check-option.selected-no {
    background-color: #ffebee;
    border-color: var(--danger);
    color: #c62828;
}

.contra-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    align-items: center;
}

body[dir="rtl"] .contra-navigation {
    flex-direction: row-reverse;
}

.nav-btn {
    padding: 10px 24px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn:hover {
    background-color: #3a5a8c;
    transform: translateY(-2px);
}

.nav-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.contra-counter {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: var(--dark);
}

.card-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 2rem;
}

.card-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.card-dot.active {
    background-color: var(--primary);
    transform: scale(1.2);
}

/* Footer */
footer {
    background-color: var(--dark);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

footer p {
    color: white;
    text-align: center;
}

footer strong {
    color: var(--secondary);
}

.footer-note {
    font-style: italic;
    margin-top: 1.5rem;
    opacity: 0.8;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* ===== RTL SPECIFIC FIXES ===== */
body[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

body[dir="rtl"] h1,
body[dir="rtl"] h2,
body[dir="rtl"] h3,
body[dir="rtl"] h4,
body[dir="rtl"] h5,
body[dir="rtl"] h6,
body[dir="rtl"] p,
body[dir="rtl"] .section-title,
body[dir="rtl"] .subsection-title {
    text-align: right;
    direction: rtl;
}

body[dir="rtl"] .section-title {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

body[dir="rtl"] .section-title i {
    margin-right: 0;
    margin-left: 15px;
    order: 2;
}

body[dir="rtl"] .subsection-title {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

body[dir="rtl"] .subsection-title i {
    margin-right: 0;
    margin-left: 10px;
    order: 2;
}

body[dir="rtl"] .icon-list {
    padding-right: 0;
    text-align: right;
}

body[dir="rtl"] .icon-list li {
    flex-direction: row-reverse;
    justify-content: flex-start;
    text-align: right;
    padding-right: 0;
}

body[dir="rtl"] .icon-list i {
    margin-right: 0;
    margin-left: 15px;
    order: 2;
}

body[dir="rtl"] .highlight,
body[dir="rtl"] .myth-buster,
body[dir="rtl"] .warning,
body[dir="rtl"] .info-box {
    border-left: none;
    border-right-width: 4px;
}

body[dir="rtl"] .highlight {
    border-right-color: var(--primary);
}

body[dir="rtl"] .myth-buster {
    border-right-color: var(--warning);
}

body[dir="rtl"] .warning {
    border-right-color: var(--danger);
}

body[dir="rtl"] .info-box {
    border-right-color: var(--success);
}

body[dir="rtl"] .contra-card-header {
    flex-direction: row-reverse;
}

body[dir="rtl"] .contra-card-icon {
    margin-right: 0;
    margin-left: 15px;
}

body[dir="rtl"] .check-options {
    flex-direction: row-reverse;
}

body[dir="rtl"] .contra-navigation {
    flex-direction: row-reverse;
}

body[dir="rtl"] .procedure-visual {
    flex-direction: row-reverse;
}

body[dir="rtl"] ul,
body[dir="rtl"] ol {
    margin-right: 1.5rem;
    margin-left: 0;
    padding-right: 1.5rem;
    padding-left: 0;
}

body[dir="rtl"] li {
    padding-left: 0;
    padding-right: 0.5rem;
    text-align: right;
}

body[dir="rtl"] .contra-tabs {
    flex-direction: row-reverse;
}

body[dir="rtl"] .contra-tab.active::after {
    left: auto;
    right: 0;
}

body[dir="ltr"] .floating-language-toggle {
    left: 20px;
    right: auto;
}

body[dir="rtl"] footer p {
    text-align: center;
}

body[dir="rtl"] .position-demo h4,
body[dir="rtl"] .position-demo p {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2.2rem;
    }
    
    .section {
        padding: 1.8rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .procedure-visual {
        flex-direction: column;
    }
    
    body[dir="rtl"] .procedure-visual {
        flex-direction: column;
    }
    
    .position-demo {
        width: 100%;
        margin: 1rem 0;
    }
    
    .floating-language-toggle {
        bottom: 15px;
        right: 15px;
    }
    
    body[dir="ltr"] .floating-language-toggle {
        left: 15px;
    }
    
    .floating-lang-btn {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }
    
    .contra-tabs {
        flex-direction: column;
    }
    
    .contra-tab {
        text-align: center;
        border-bottom: 1px solid #eee;
        padding: 15px;
    }
    
    .contra-tab.active::after {
        display: none;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }
    
    .section {
        padding: 1.5rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .floating-lang-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .nav-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}
