/* Legal Page Styles */
.page-banner {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../images/still-life-paper-chains-decoration.jpg');
    background-size: cover;
    background-position: center;
    height: 300px;
    display: flex;
    align-items: center;
    position: relative;
    color: #fff;
    text-align: center;
}

.page-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 0;
}

.page-banner .container {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.page-banner h1 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.page-banner p {
    font-size: 1.2rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.legal-section {
    padding: 90px 0;
    background-color: #f9fafb;
    position: relative;
    direction: rtl;
    text-align: right;
}

/* Improved RTL support */
.legal-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 50px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 15px;
    position: relative;
    flex-wrap: wrap;
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 30px;
    font-size: 1.15rem;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    margin: 0 10px;
    text-align: center;
}

.tab-btn:after {
    content: '';
    position: absolute;
    bottom: -16px;
    right: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.legal-text {
    background-color: white;
    padding: 50px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    line-height: 1.8;
    text-align: right;
}

.legal-text h3::before {
    content: '';
    position: absolute;
    bottom: -1px;
    right: 0;
    width: 40px;
    height: 3px;
    background-color: var(--primary-color);
}

/* Enhanced responsive design */
@media (max-width: 992px) {
    .page-banner h1 {
        font-size: 2.4rem;
    }
    
    .tab-content h2 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .legal-tabs {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding-bottom: 5px;
    }
    
    .tab-btn {
        margin: 0 0 15px 0;
        width: 80%;
        max-width: 300px;
    }
    
    .tab-btn:after {
        bottom: -6px;
    }
    
    .legal-text {
        padding: 30px 25px;
    }
    
    .legal-text h3 {
        font-size: 1.3rem;
    }
    
    .legal-text p, 
    .legal-text ul li {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .page-banner {
        height: 250px;
    }
    
    .page-banner h1 {
        font-size: 2rem;
    }
    
    .page-banner p {
        font-size: 1rem;
    }
    
    .legal-section {
        padding: 60px 0;
    }
    
    .tab-content h2 {
        font-size: 1.8rem;
    }
    
    .legal-text {
        padding: 25px 20px;
    }
}

/* Print styles for legal documents */
@media print {
    .page-banner, 
    .legal-tabs,
    footer,
    header {
        display: none;
    }
    
    .legal-section {
        padding: 0;
        background: none;
    }
    
    .legal-text {
        box-shadow: none;
        padding: 0;
        max-width: 100%;
    }
    
    .tab-content {
        display: block !important;
    }
}

.tab-btn:first-child {
    margin-left: 0;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn:after {
    content: '';
    position: absolute;
    bottom: -16px;
    right: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active:after {
    transform: scaleX(1);
}

.legal-content {
    direction: rtl;
}

.tab-content {
    display: none;
    animation: fadeIn 0.6s ease forwards;
    text-align: right;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    font-size: 2.4rem;
    color: #333;
    margin-bottom: 15px;
    text-align: right;
    position: relative;
    padding-bottom: 15px;
}

.tab-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

.last-updated {
    text-align: center;
    color: #666;
    font-style: italic;
    margin-bottom: 50px;
    font-size: 0.95rem;
}

.legal-text {
    background-color: white;
    padding: 50px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    line-height: 1.8;
}

.legal-text h3 {
    color: #222;
    font-size: 1.5rem;
    margin: 35px 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
    position: relative;
}

.legal-text h3::before {
    content: '';
    position: absolute;
    bottom: -1px;
    right: 0;
    width: 40px;
    height: 3px;
    background-color: var(--primary-color);
}

.legal-text h3:first-child {
    margin-top: 0;
}

.legal-text p {
    color: #555;
    line-height: 1.9;
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.legal-text ul {
    margin-bottom: 25px;
    padding-right: 20px;
    padding-left: 0;
    list-style-position: inside;
}

.legal-text ul li {
    color: #555;
    margin-bottom: 12px;
    line-height: 1.7;
    position: relative;
    padding-right: 20px;
}

.legal-text ul li:before {
    content: '•';
    position: absolute;
    right: 0;
    top: 0;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .legal-tabs {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .tab-btn {
        margin-bottom: 10px;
    }
    
    .legal-text {
        padding: 25px;
    }
    
    .last-updated {
        text-align: center;
        margin-bottom: 30px;
    }
}