﻿/* Terms and Conditions Page Styles - Matching Badgs Trading Theme */

/* Import fonts to match theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Root Variables - Matching the main theme */
:root {
    --primary-color: #61197C;
    --primary-dark: #471160;
    --secondary-color: #5C5C5C;
    --warning-color: #ffc107;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    /* Gradients */
    --primary-gradient: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    --hero-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    /* Typography */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    /* Spacing */
    --section-padding: 80px 0;
    --section-margin: 4rem 0;
}

@font-face {
    font-family: 'WSans';
    src: url('../fonts/WSansNew-Bold.woff') format('woff'), url('../fonts/wsans/WSansNew-Bold.woff.ttf') format('truetype');
    font-weight: bolder;
    font-style: normal;
}


/* Arabic Primary Font - Cairo Rakkas (Elegant Arabic with distinctive character) */

@font-face {
    font-family: 'Cairo';
    src: url('https://fonts.gstatic.com/s/cairo/v28/SLXgc1nY6HkvangtZmpQdkhzfH5lkSs2SgRjCAGMQ1z0hOA-a1biLD-H.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFF;
}

/* Global Styles */
body {
   /* font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;*/
    line-height: 1.7;
    color: var(--gray-800);
    background-color: white !important;
}

/* Hero Section */
.terms-hero-section {
    background: url('../images/heropic.jpg'); /* Replace with your actual PNG path */
    padding: var(--section-padding);
    color: var(--white);
    position: relative;
    overflow: hidden;
}

    .terms-hero-section::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="terms-grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100%" height="100%" fill="url(%23terms-grain)"/></svg>');
        z-index: 0;
    }

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-family: 'WSans', sans-serif;
    font-size: var(--font-size-4xl);
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

[dir="rtl"] .hero-title {
    font-family: 'Cairo';
}

.hero-subtitle {
    font-family: sans-serif;
    font-size: var(--font-size-lg);
    margin-bottom: 2.5rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

[dir="rtl"] .hero-subtitle {
    font-family: 'Cairo';
}

.terms-meta {
    margin-top: 2rem;
}

.meta-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    font-size: var(--font-size-sm);
}

    .meta-item i {
        font-size: var(--font-size-base);
    }

/* Table of Contents */
.toc-container {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
}

.toc-title {
    color: var(--primary-color);
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.toc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.toc-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: lightgray !important;
    color: black !important;
    text-decoration: none;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all var(--transition-normal);
    font-weight: 500;
}

    .toc-item:hover {
        background: var(--primary-color);
        color: var(--white);
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(97, 25, 124, 0.3);
        text-decoration: none;
    }

    .toc-item.active {
        background: var(--primary-color);
        color: var(--white);
        border-color: var(--primary-dark);
    }

.toc-number {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-sm);
    flex-shrink: 0;
    transition: all var(--transition-normal);
}

.toc-item:hover .toc-number {
    background: var(--white);
    color: var(--primary-color);
}

.toc-item.active .toc-number {
    background: var(--white);
    color: var(--primary-color);
}

.toc-text {
    flex: 1;
    font-size: var(--font-size-sm);
}

/* Terms Sections */
.terms-section {
    background: var(--white);
    border-radius: 16px;
    margin-bottom: 3rem;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: all var(--transition-normal);
    scroll-margin-top: 100px; /* Account for fixed header */
}

    .terms-section:hover {
        box-shadow: var(--card-shadow-hover);
    }

.section-header {
    background: var(--primary-gradient);
    color: var(--white);
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.section-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-2xl);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.section-title {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    margin: 0;
    flex: 1;
    color:whitesmoke;
}

.section-content {
    padding: 2.5rem;
}

    .section-content p {
        margin-bottom: 1.5rem;
        line-height: 1.8;
        color: var(--gray-700);
    }

        .section-content p:last-child {
            margin-bottom: 0;
        }

/* Terms Lists */
.terms-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

    .terms-list li {
        position: relative;
        padding: 0.75rem 0 0.75rem 2.5rem;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid var(--gray-200);
        color: black !important
    }

        .terms-list li:last-child {
            border-bottom: none;
            margin-bottom: 0;
        }

        .terms-list li::before {
            content: '✓';
            position: absolute;
            left: 0;
            top: 0.75rem;
            width: 20px;
            height: 20px;
            background: var(--success-color);
            color: var(--white);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: var(--font-size-xs);
            font-weight: 700;
        }

    .terms-list.success li::before {
        background: var(--success-color);
        content: '✓';
    }

    .terms-list.danger li::before {
        background: var(--danger-color);
        content: '✗';
    }

    .terms-list.info li::before {
        background: var(--info-color);
        content: 'i';
    }

/* Highlight Boxes */
.highlight-box {
    padding: 1.5rem;
    border-radius: 12px;
    margin: 2rem 0;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    border-left: 4px solid;
}

    .highlight-box i {
        font-size: var(--font-size-lg);
        margin-top: 0.125rem;
        flex-shrink: 0;
    }

    .highlight-box p {
        margin: 0;
        flex: 1;
    }

    .highlight-box.info {
        background: rgba(23, 162, 184, 0.1);
        border-left-color: var(--info-color);
        color: var(--info-color);
    }

    .highlight-box.warning {
        background: rgba(255, 193, 7, 0.1);
        border-left-color: var(--warning-color);
        color: #856404;
    }

    .highlight-box.success {
        background: rgba(40, 167, 69, 0.1);
        border-left-color: var(--success-color);
        color: var(--success-color);
    }

    .highlight-box.danger {
        background: rgba(220, 53, 69, 0.1);
        border-left-color: var(--danger-color);
        color: var(--danger-color);
    }

/* Process Steps */
.process-steps {
    background: lightgray !important;
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

    .process-steps h4 {
        color: var(--primary-color);
        margin-bottom: 1.5rem;
        font-weight: 600;
    }

.step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-200);
}

    .step:last-child {
        border-bottom: none;
    }

.step-number {
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-sm);
    flex-shrink: 0;
}

.step-text {
    flex: 1;
    color: var(--gray-700);
    font-weight: 500;
}

/* Refund Conditions */
.refund-conditions {
    background: lightgray !important;
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

    .refund-conditions h4 {
        margin-bottom: 1rem;
        font-weight: 600;
    }

        .refund-conditions h4:first-child {
            color: var(--success-color);
        }

        .refund-conditions h4:last-of-type {
            color: var(--danger-color);
            margin-top: 2rem;
        }

/* Contact Support Section */
.contact-support {
    background: var(--gray-50);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
    text-align: center;
}

    .contact-support h4 {
        color: var(--primary-color);
        margin-bottom: 1rem;
        font-weight: 600;
    }

    .contact-support p {
        margin-bottom: 1.5rem;
        color: var(--gray-600);
    }

    .contact-support .btn {
        padding: 0.75rem 2rem;
        font-weight: 500;
        border-radius: 8px;
        transition: all var(--transition-normal);
    }

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-gradient);
    color: var(--white);
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-lg);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(97, 25, 124, 0.3);
    transition: all var(--transition-normal);
    z-index: 1000;
}

    .back-to-top:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(97, 25, 124, 0.4);
    }

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 1000;
    background: rgba(97, 25, 124, 0.2);
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    width: 0%;
    transition: width 0.3s ease;
}

/* Print Button */
.print-btn {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    margin-top: 1rem;
    backdrop-filter: blur(10px);
}

    .print-btn:hover {
        background: rgba(255, 255, 255, 0.3);
        border-color: rgba(255, 255, 255, 0.5);
        transform: translateY(-2px);
    }

    .print-btn i {
        margin-right: 0.5rem;
    }

/* Animations */
.animated {
    animation-duration: 1s;
    animation-fill-mode: both;
}

.fadeInDown {
    animation-name: fadeInDown;
}

.fadeInUp {
    animation-name: fadeInUp;
}

.delay-1 {
    animation-delay: 0.3s;
}

.delay-2 {
    animation-delay: 0.6s;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -50px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 50px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero-title {
        font-size: var(--font-size-3xl);
    }

    .section-header {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .section-icon {
        width: 50px;
        height: 50px;
        font-size: var(--font-size-xl);
    }

    .section-title {
        font-size: var(--font-size-xl);
    }

    .section-content {
        padding: 2rem;
    }

    .toc-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: var(--font-size-2xl);
    }

    .hero-subtitle {
        font-size: var(--font-size-base);
        margin-bottom: 2rem;
    }

    .terms-meta .row {
        flex-direction: column;
        gap: 1rem;
    }

    .meta-item {
        flex-direction: column;
        text-align: center;
        gap: 0.25rem;
    }

    .toc-container {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .toc-title {
        font-size: var(--font-size-lg);
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .toc-item {
        padding: 1rem;
        gap: 0.75rem;
    }

    .toc-number {
        width: 28px;
        height: 28px;
    }

    .section-header {
        padding: 1.5rem 1rem;
    }

    .section-content {
        padding: 1.5rem 1rem;
    }

    .highlight-box {
        padding: 1rem;
        flex-direction: column;
        gap: 0.75rem;
        text-align: left;
    }

    .process-steps,
    .refund-conditions,
    .contact-support {
        padding: 1.5rem;
    }

    .step {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        text-align: left;
    }

    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 1.5rem;
        right: 1.5rem;
        font-size: var(--font-size-base);
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: var(--font-size-xl);
    }

    .terms-hero-section {
        padding: 60px 0;
    }

    .toc-container,
    .terms-section {
        margin-left: -15px;
        margin-right: -15px;
        border-radius: 0;
    }

    .section-content {
        padding: 1rem;
    }

    .terms-list li {
        padding-left: 2rem;
        font-size: var(--font-size-sm);
    }

        .terms-list li::before {
            width: 18px;
            height: 18px;
            font-size: 10px;
        }

    .highlight-box {
        margin-left: -15px;
        margin-right: -15px;
        border-radius: 0;
    }

    .step-number {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .step-text {
        font-size: var(--font-size-sm);
    }
}

/* Print Styles */
@media print {
    .terms-hero-section {
        background: none !important;
        color: var(--dark-color) !important;
        padding: 2rem 0 !important;
    }

    .hero-title {
        color: var(--dark-color) !important;
        text-shadow: none !important;
    }

    .hero-subtitle {
        color: var(--gray-700) !important;
    }

    .toc-container {
        page-break-after: always;
        box-shadow: none !important;
        border: 1px solid var(--gray-300);
    }

    .terms-section {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid var(--gray-300);
        margin-bottom: 2rem;
    }

    .section-header {
        background: var(--gray-100) !important;
        color: var(--dark-color) !important;
        border-bottom: 2px solid var(--primary-color);
    }

    .section-icon {
        background: var(--primary-color) !important;
        color: var(--white) !important;
    }

    .highlight-box {
        border: 1px solid currentColor;
        background: none !important;
    }

    .back-to-top,
    .reading-progress,
    .print-btn {
        display: none !important;
    }

    .toc-item {
        background: none !important;
        color: var(--dark-color) !important;
        border: 1px solid var(--gray-300);
    }

    .toc-number {
        background: var(--primary-color) !important;
        color: var(--white) !important;
    }

    /* Ensure good page breaks */
    .terms-section {
        page-break-inside: avoid;
    }

    .section-header {
        page-break-after: avoid;
    }

    .section-content {
        page-break-before: avoid;
    }

    /* Adjust font sizes for print */
    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    .hero-title {
        font-size: 24pt;
    }

    .section-title {
        font-size: 18pt;
    }

    .toc-title {
        font-size: 16pt;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .highlight-box {
        border-width: 2px;
        border-style: solid;
    }

    .toc-item {
        border: 2px solid var(--gray-400);
    }

        .toc-item:hover,
        .toc-item.active {
            border-color: var(--primary-color);
        }

    .terms-section {
        border: 1px solid var(--gray-300);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .animated {
        animation: none;
    }

    .back-to-top:hover,
    .toc-item:hover,
    .terms-section:hover {
        transform: none;
    }
}

/* Focus styles for accessibility */
.toc-item:focus,
.back-to-top:focus,
.print-btn:focus,
.contact-support .btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Dark mode support (if implemented) */
@media (prefers-color-scheme: dark) {
    :root {
        --white: #1a1a1a;
        --gray-50: #2a2a2a;
        --gray-100: #333333;
        --gray-200: #404040;
        --gray-300: #4d4d4d;
        --gray-700: #cccccc;
        --gray-800: #e0e0e0;
        --dark-color: #ffffff;
    }

    body {
        background-color: var(--gray-900);
        color: var(--gray-100);
    }
}
