/* Custom CSS for VulnBridge */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Naskh+Arabic:wght@400;700&display=swap');

:root {
    --gold: #E0B84E;
    --gold-rgb: 224, 184, 78;

    /* Dark Theme Defaults */
    --bg: #1a1a1a;
    --bg-elev: #2a2a2a;
    --text: #f8f9fa;
    --muted: #adb5bd;
    --card-bg: #212121;
    --card-border: #333;
    --heading-color: #f8f9fa;
    --link-color: var(--gold);
    --link-hover-color: #f0c26b;
    --navbar-bg: rgba(26, 26, 26, 0.9);
    --footer-bg: #111;
    --input-bg: #333;
    --input-border: #444;
    --input-placeholder: #888;
    --progress-bg: #444;
}

html.theme-light {
    --bg: #f8f9fa;
    --bg-elev: #e9ecef;
    --text: #212529;
    --muted: #6c757d;
    --card-bg: #ffffff;
    --card-border: #dee2e6;
    --heading-color: #212529;
    --link-color: #007bff;
    --link-hover-color: #0056b3;
    --navbar-bg: rgba(248, 249, 250, 0.9);
    --footer-bg: #e9ecef;
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --input-placeholder: #6c757d;
    --progress-bg: #e0e0e0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* RTL Support */
html[dir="rtl"] body {
    font-family: 'Noto Naskh Arabic', 'Inter', sans-serif;
}

/* Global Styles */
h1, h2, h3, h4, h5, h6 {
    color: var(--heading-color);
}

a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

.text-gold {
    color: var(--gold) !important;
}

.bg-dark-alt {
    background-color: var(--bg-elev) !important;
}

.btn-primary {
    background-color: var(--gold);
    border-color: var(--gold);
    color: #1a1a1a;
}

.btn-primary:hover {
    background-color: #f0c26b;
    border-color: #f0c26b;
}

.btn-outline-light {
    color: var(--text);
    border-color: var(--text);
}

.btn-outline-light:hover {
    background-color: var(--text);
    color: var(--bg);
}

.form-control,
.form-select {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text);
}

.form-control::placeholder {
    color: var(--input-placeholder);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--input-bg);
    border-color: var(--gold);
    box-shadow: 0 0 0 0.25rem rgba(var(--gold-rgb), 0.25);
    color: var(--text);
}

/* Navbar */
.navbar {
    background-color: var(--navbar-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
}

.navbar-brand {
    color: var(--text);
    font-weight: bold;
}

.navbar-brand:hover {
    color: var(--text);
}

.navbar-nav .nav-link {
    color: var(--text);
}

.navbar-nav .nav-link:hover {
    color: var(--gold);
}

.dropdown-menu {
    background-color: var(--card-bg);
    border-color: var(--card-border);
}

.dropdown-item {
    color: var(--text);
}

.dropdown-item:hover {
    background-color: var(--bg-elev);
    color: var(--gold);
}

#theme-toggle {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
}

#theme-toggle:hover {
    color: var(--gold);
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: var(--muted);
    border-top: 1px solid var(--card-border);
}

footer a {
    color: var(--muted);
}

footer a:hover {
    color: var(--gold);
}

.social-icons a {
    font-size: 1.5rem;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../img/hero-bg.jpg') no-repeat center center/cover;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    padding-top: 80px; /* Adjust for fixed navbar */
}

.hero-section h1 {
    font-size: 3.5rem;
    line-height: 1.2;
}

.hero-section .btn {
    font-size: 1.1rem;
    padding: 0.8rem 2rem;
}

/* Security Dashboard Card */
.security-dashboard-card {
    max-width: 700px;
    margin-top: -100px; /* Overlap with hero */
    position: relative;
    z-index: 1;
    box-shadow: 0 0 30px rgba(var(--gold-rgb), 0.3);
}

.security-dashboard-card .progress {
    height: 25px;
    background-color: var(--progress-bg);
}

.security-dashboard-card .progress-bar {
    color: var(--bg);
    font-weight: bold;
}

/* Back to Top Button */
#back-to-top {
    display: none; /* Hidden by default */
    position: fixed; /* Fixed/sticky position */
    bottom: 20px; /* Place the button at the bottom of the page */
    right: 30px; /* Place the button 30px from the right */
    z-index: 99; /* Make sure it does not overlap */
    border: none; /* Remove borders */
    outline: none; /* Remove outline */
    background-color: var(--gold); /* Set a background color */
    color: white; /* Text color */
    cursor: pointer; /* Add a mouse pointer on hover */
    padding: 15px; /* Some padding */
    border-radius: 10px; /* Rounded corners */
    font-size: 18px; /* Increase font size */
}

#back-to-top:hover {
    background-color: #f0c26b; /* Add a darker background on hover */
}

/* Toast Notifications */
.toast-container {
    z-index: 1050;
}

.toast {
    background-color: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--card-border);
}

.toast-header {
    background-color: var(--bg-elev);
    color: var(--text);
    border-bottom: 1px solid var(--card-border);
}

.toast-body {
    background-color: var(--card-bg);
}

/* Course Card Grid */
.course-card .card-img-top {
    height: 180px;
    object-fit: cover;
}

.course-card .badge {
    font-size: 0.8em;
}

/* Course Detail Page */
.sticky-enroll-card {
    position: sticky;
    top: 80px; /* Adjust based on navbar height */
    z-index: 100;
}

.course-tabs .nav-link {
    color: var(--text);
    background-color: var(--bg-elev);
    border-color: var(--card-border) var(--card-border) var(--card-border);
}

.course-tabs .nav-link.active {
    color: var(--gold);
    background-color: var(--card-bg);
    border-color: var(--card-border) var(--card-border) var(--card-bg);
}

.course-tabs .tab-content {
    background-color: var(--card-bg);
    border-color: var(--card-border) !important;
}

.accordion-button {
    background-color: var(--bg-elev);
    color: var(--text);
}

.accordion-button:not(.collapsed) {
    color: var(--gold);
    background-color: var(--bg-elev);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .125);
}

.accordion-button::after {
    filter: invert(1) grayscale(100%) brightness(200%); /* Adjust arrow color for dark theme */
}

html.theme-light .accordion-button::after {
    filter: none;
}

.accordion-body {
    background-color: var(--card-bg);
    color: var(--text);
}

.accordion-item {
    border: 1px solid var(--card-border);
}

/* Blog Post */
.blog-post-card img {
    max-height: 200px;
    width: 100%;
    object-fit: cover;
}

.author-box {
    background-color: var(--bg-elev);
    border-color: var(--card-border);
}

/* Pricing Cards */
.pricing-card .card-header {
    background-color: var(--bg-elev);
    border-bottom: 1px solid var(--card-border);
    color: var(--heading-color);
}

.pricing-card ul {
    list-style: none;
    padding: 0;
}

.pricing-card ul li::before {
    content: "\2713"; /* Checkmark */
    color: var(--gold);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em; /* Adjust for RTL */
    margin-right: 0.5em;
}

html[dir="rtl"] .pricing-card ul li::before {
    margin-right: -1em;
    margin-left: 0.5em;
}

/* Timeline for About Page */
.timeline {
    list-style: none;
    padding: 20px 0 20px;
    position: relative;
}

.timeline:before {
    top: 0;
    bottom: 0;
    position: absolute;
    content: " ";
    width: 3px;
    background-color: var(--card-border);
    left: 50%;
    margin-left: -1.5px;
}

.timeline > li {
    margin-bottom: 20px;
    position: relative;
}

.timeline > li:before,
.timeline > li:after {
    content: " ";
    display: table;
}

.timeline > li:after {
    clear: both;
}

.timeline > li .timeline-panel {
    width: 46%;
    float: left;
    border: 1px solid var(--card-border);
    border-radius: 2px;
    padding: 20px;
    position: relative;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175);
    background-color: var(--card-bg);
}

.timeline > li .timeline-panel:before {
    position: absolute;
    top: 26px;
    right: -15px;
    display: inline-block;
    border-top: 15px solid transparent;
    border-left: 15px solid var(--card-border);
    border-right: 0 solid var(--card-border);
    border-bottom: 15px solid transparent;
    content: " ";
}

.timeline > li .timeline-panel:after {
    position: absolute;
    top: 27px;
    right: -14px;
    display: inline-block;
    border-top: 14px solid transparent;
    border-left: 14px solid var(--card-bg);
    border-right: 0 solid var(--card-bg);
    border-bottom: 14px solid transparent;
    content: " ";
}

.timeline > li:nth-child(even) .timeline-panel {
    float: right;
}

.timeline > li:nth-child(even) .timeline-panel:before {
    border-left-width: 0;
    border-right-width: 15px;
    left: -15px;
    right: auto;
}

.timeline > li:nth-child(even) .timeline-panel:after {
    border-left-width: 0;
    border-right-width: 14px;
    left: -14px;
    right: auto;
}

.timeline > li .timeline-badge {
    color: #fff;
    width: 50px;
    height: 50px;
    line-height: 50px;
    font-size: 1.4em;
    text-align: center;
    position: absolute;
    top: 16px;
    left: 50%;
    margin-left: -25px;
    background-color: var(--gold);
    z-index: 100;
    border-radius: 50%;
}

.timeline-title {
    margin-top: 0;
    color: inherit;
}

.timeline-body > p,
.timeline-body > ul {
    margin-bottom: 0;
}

/* Responsive adjustments for timeline */
@media (max-width: 767px) {
    .timeline {
        &:before {
            left: 18px;
        }

        & > li {
            margin-bottom: 20px;
            position: relative;
            padding-left: 50px;

            .timeline-panel {
                width: 100%;
                float: none;

                &:before,
                &:after {
                    left: -15px !important;
                    border-left-width: 15px !important;
                    border-right-width: 0 !important;
                }
                &:after {
                    left: -14px !important;
                    border-left-width: 14px !important;
                    border-right-width: 0 !important;
                }
            }

            .timeline-badge {
                left: 0;
                margin-left: 0;
            }
        }
    }
}

/* Quilted Background */
body {
    background-color: var(--bg);
    background-image: 
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 30px 30px;
}

html.theme-light body {
    background-image: 
        linear-gradient(rgba(0, 0, 0, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, .05) 1px, transparent 1px);
}

/* Accessibility (Focus Styles) */
*:focus {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* RTL Specific Overrides */
html[dir="rtl"] {
    .ms-auto {
        margin-right: auto !important;
        margin-left: 0 !important;
    }
    .me-2 {
        margin-left: 0.5rem !important;
        margin-right: 0 !important;
    }
    .ms-lg-3 {
        margin-right: 1rem !important;
        margin-left: 0 !important;
    }
    .dropdown-menu-end {
        --bs-position: start;
    }
    .form-check-input {
        margin-left: 0.5em;
        margin-right: 0;
    }
    .input-group > :not(:first-child):not(.dropdown-menu):not(.dropdown-toggle) {
        border-top-left-radius: var(--bs-border-radius);
        border-bottom-left-radius: var(--bs-border-radius);
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }
    .input-group > :not(.form-control):not(.form-select):not(.input-group-text) {
        border-top-right-radius: var(--bs-border-radius);
        border-bottom-right-radius: var(--bs-border-radius);
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
    }
}


