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

body {
    font-family: 'Cairo', Arial, sans-serif;
    background-color: #F8F9FA;
    color: #495057;
    line-height: 1.6;
    direction: rtl;
}

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

/* Ad above header - desktop only */
.ad-above-header {
    background: #f8f9fa;
    padding: 16px 0;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

/* Hide above header ad on mobile */
@media (max-width: 768px) {
    .ad-above-header {
        display: none;
    }
}

/* Header */
.header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
    padding: 32px 0;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-bottom: 3px solid #df2829;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.header-logo {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #df2829 0%, #c21e20 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(223, 40, 41, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.header-center {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    justify-content: flex-start;
}

.header-icon {
    font-size: 36px;
    color: #df2829;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
    color: #495057;
}

.header .subtitle {
    font-size: 18px;
    font-weight: 400;
    color: #6c757d;
}

/* Enhanced Ad Placements */
.ad-container {
    background: white;
    border: 1px solid #E9ECEF;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin: 24px 0;
    position: relative;
    overflow: hidden;
}

.ad-container::before {
    content: '';
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 10px;
    color: #ADB5BD;
    background: #F8F9FA;
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 1;
}

.ad-160x600 {
    width: 160px;
    height: 600px;
    margin: 0;
}

.ad-250x250 {
    width: 250px;
    height: 250px;
    margin: 24px auto;
}

.ad-300x250 {
    width: 300px;
    height: 250px;
    margin: 24px auto;
}

.ad-728x90 {
    width: 728px;
    height: 90px;
    margin: 24px auto;
}

.ad-336x280 {
    width: 336px;
    height: 280px;
    margin: 24px auto;
}

.ad-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
}

/* Enhanced Sidebar Ad Positioning */
.ad-sidebar {
    position: absolute;
    z-index: 100;
    transition: all 0.3s ease;
    top: 0;
    height: 100vh;
    pointer-events: none;
}

.ad-sidebar.left {
    left: 20px;
}

.ad-sidebar.right {
    right: 20px;
}

.ad-sidebar .ad-container {
    position: sticky;
    top: 20px;
    pointer-events: auto;
    margin: 0;
    margin-top: 220px; /* Start after header - header is ~180px + margin */
}

/* Adjust sidebar positioning when above-header ad is present */
body:has(.ad-above-header) .ad-sidebar .ad-container,
body.has-above-header .ad-sidebar .ad-container {
    margin-top: 320px; /* Additional space when above-header ad exists (220px + 100px) */
}

/* Alternative approach for better browser support */
.ad-sidebar.with-above-header .ad-container {
    margin-top: 320px;
}

/* Hide sidebar ads on smaller screens */
@media (max-width: 1200px) {
    .ad-sidebar {
        display: none;
    }
}

/* Hide side ads on smaller screens */
@media (max-width: 1024px) {
    .ad-336x280.ad-side {
        display: none;
    }
}

/* Search section with side ads layout */
.search-section {
    background: white;
    padding: 48px 0;
    margin-bottom: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.search-section-content {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.search-section-content .search-card {
    margin: 0; /* Remove auto margin since we're using flexbox */
}

/* Side ad positioning within search section */
.ad-side {
    flex-shrink: 0;
}

/* Search Section */
.search-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #E9ECEF;
}

.search-card h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* System Selection */
.system-selection {
    margin-bottom: 32px;
    text-align: center;
}

.system-selection h3 {
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.radio-group {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 12px 20px;
    border: 2px solid #E9ECEF;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    min-width: 140px;
    justify-content: center;
}

/* Default hover state for unselected radio options */
.radio-option:hover {
    border-color: #df2829;
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(223, 40, 41, 0.1);
    color: #495057; /* Ensure text color is dark on white background */
}

.radio-option.selected {
    border-color: #df2829;
    background: #df2829;
    color: white;
    box-shadow: 0 4px 12px rgba(223, 40, 41, 0.3);
}

/* Selected radio option - maintain selected appearance on hover */
.radio-option.selected:hover {
    border-color: #df2829;
    background: #df2829; /* Keep the primary background */
    color: white; /* Keep white text */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(223, 40, 41, 0.3);
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #df2829;
}

/* Ensure input accent color is correct on hover */
.radio-option:hover input[type="radio"] {
    accent-color: #df2829;
}

.radio-option.selected input[type="radio"] {
    accent-color: white;
}

.radio-option.selected:hover input[type="radio"] {
    accent-color: white;
}

.radio-label {
    font-size: 16px;
    font-weight: 500;
    user-select: none;
}

.system-icon {
    font-size: 18px;
    color: #df2829;
}

.search-icon {
    font-size: 24px;
    color: #df2829;
}

.search-input {
    width: 100%;
    height: 56px;
    border: 2px solid #E9ECEF;
    border-radius: 8px;
    padding: 0 18px 0 50px;
    font-size: 18px;
    font-family: 'Cairo', Arial, sans-serif;
    text-align: center;
    margin-bottom: 24px;
    transition: border-color 0.25s ease;
    position: relative;
}

.search-input-container {
    position: relative;
}

.search-input-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #ADB5BD;
    font-size: 20px;
    z-index: 1;
}

.search-input:focus {
    outline: none;
    border-color: #df2829;
}

.search-input::placeholder {
    color: #ADB5BD;
}

.search-btn {
    background: #df2829;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-width: 120px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.search-btn:hover {
    background: #C21E20;
}

.search-btn i {
    font-size: 16px;
}

/* Results Section */
.results-section {
    display: none;
    margin-bottom: 32px;
}

.results-section.show {
    display: block;
}

.results-header {
    background: white;
    padding: 32px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.student-name {
    font-size: 28px;
    font-weight: 700;
    color: #495057;
    margin-bottom: 8px;
}

.student-info {
    color: #6C757D;
    font-size: 16px;
    margin-bottom: 24px;
}

.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.summary-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.summary-card.gpa-card {
    background: #df2829;
    color: white;
    border-color: #df2829;
}

.summary-label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.summary-value {
    font-size: 20px;
    font-weight: 700;
    color: #495057;
}

.summary-card.gpa-card .summary-value {
    color: white;
    font-size: 24px;
}

/* Course Grid */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.course-grid-continued {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.course-grid-final {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* Ensure consistent 2 cards per row on larger screens */
@media (min-width: 768px) {
    .course-grid,
    .course-grid-continued,
    .course-grid-final {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
    }
}

/* Single column on mobile */
@media (max-width: 767px) {
    .course-grid,
    .course-grid-continued,
    .course-grid-final {
        grid-template-columns: 1fr;
    }
}

.course-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #E9ECEF;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.course-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.course-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    text-align: center;
}

.course-name {
    font-size: 20px;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.course-grade-center {
    text-align: center;
    margin: 20px 0;
}

.course-grade-large {
    font-size: 36px;
    font-weight: 700;
    color: #df2829;
    text-align: center;
    line-height: 1.2;
}

.course-icon {
    font-size: 20px;
    color: #df2829;
}

.course-grade {
    font-size: 24px;
    font-weight: 700;
    color: #df2829;
    display: flex;
    align-items: center;
    gap: 6px;
}

.course-details {
    margin-bottom: 16px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    align-items: center;
}

.detail-label {
    color: #6C757D;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-icon {
    font-size: 12px;
    color: #ADB5BD;
}

.detail-value {
    font-weight: 500;
    color: #495057;
}

/* Status Badge */
.status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.status-pass {
    background: #28A745;
    color: white;
}

.status-fail {
    background: #DC3545;
    color: white;
}

.status-warning {
    background: #FFC107;
    color: #495057;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #E9ECEF;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: #df2829;
    transition: width 0.3s ease;
}

/* Statistics Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    border: 1px solid #E9ECEF;
}

.stat-card::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 16px;
    color: #df2829;
    opacity: 0.7;
}

.stat-card:nth-child(1)::before {
    content: '\f19c';
}

.stat-card:nth-child(2)::before {
    content: '\f02d';
}

.stat-card:nth-child(3)::before {
    content: '\f00c';
}

.stat-card:nth-child(4)::before {
    content: '\f00d';
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #495057;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: #6C757D;
}

/* Overall Status Card */
.overall-status-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    border: 2px solid;
    transition: all 0.3s ease;
}

.overall-status-card.pass {
    border-color: #28A745;
    background: linear-gradient(135deg, #28A745 0%, #20C997 100%);
    color: white;
}

.overall-status-card.fail {
    border-color: #DC3545;
    background: linear-gradient(135deg, #DC3545 0%, #E74C3C 100%);
    color: white;
}

.overall-status-card.second-round {
    border-color: #F97316;
    background: linear-gradient(135deg, #F97316 0%, #FB923C 100%);
    color: white;
}

.overall-status-card::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 20px;
    opacity: 0.8;
}

.overall-status-card.pass::before {
    content: '\f058';
}

.overall-status-card.fail::before {
    content: '\f057';
}

.overall-status-card.second-round::before {
    content: '\f017';
}

.overall-status-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.overall-status-label {
    font-size: 16px;
    font-weight: 500;
    opacity: 0.9;
}

/* Loading Animation */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.show {
    display: block;
}

.spinner {
    border: 3px solid #E9ECEF;
    border-top: 3px solid #df2829;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #df2829 0%, #c21e20 100%);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.footer-logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #df2829 0%, #c21e20 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(223, 40, 41, 0.3);
}

.footer-logo-text {
    font-size: 28px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.footer-disclaimer {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    font-size: 14px;
    color: #e9ecef;
    position: relative;
}

.footer-disclaimer::before {
    content: '\f06a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 16px;
    color: #df2829;
}

.footer-disclaimer strong {
    color: #df2829;
    font-weight: 600;
}

.footer-copyright {
    font-size: 12px;
    color: #adb5bd;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
    margin-top: 24px;
    width: 100%;
    text-align: center;
}

.footer-year {
    color: #df2829;
    font-weight: 600;
}

/* JavaScript-Enhanced Sidebar Positioning */
.sidebar-positioning-js {
    position: fixed;
    transition: top 0.3s ease-in-out;
    z-index: 100;
}

/* Smooth scroll behavior for sidebar ads */
.ad-sidebar.smooth-scroll {
    transition: top 0.2s ease-out;
}

/* Enhanced positioning for different screen scenarios */
@media (min-height: 800px) {
    .ad-container {
        /* Keep existing ad container styles */
    }
}

@media (max-height: 600px) {
    .ad-container {
        /* Keep existing ad container styles */
    }
}

/* Ensure ads don't interfere with main content on smaller screens */
@media (max-width: 1400px) {
    .container {
        margin: 0 auto;
        /* Ensure content doesn't go under ads */
    }
}

/* Additional spacing for main content when ads are present */
@media (min-width: 1200px) {
    .container {
        /* Add some breathing room from sidebar ads */
        max-width: 1000px;
    }
}

/* Responsive Header */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .header-left {
        justify-content: center;
        width: 100%;
    }

    .header-center {
        justify-content: center;
        margin-top: 8px;
    }

    .header-logo {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .header h1 {
        font-size: 24px;
    }

    /* Responsive behavior for the new ad size */
    .ad-728x90 {
        width: 320px;
        height: 50px;
    }
}

/* Alternative mobile size */
@media (max-width: 480px) {
    .ad-728x90 {
        width: 300px;
        height: 50px;
    }
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer {
        padding: 32px 0 16px;
    }

    .footer-logo-text {
        font-size: 24px;
    }

    .footer-logo-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .footer-disclaimer {
        padding: 20px;
        font-size: 13px;
        margin: 0 16px;
    }
}

/* Error Message */
.error-message {
    background: #dc3545;
    color: white;
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
    display: none;
    animation: slideIn 0.3s ease;
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.error-message.show {
    display: block;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    padding: 12px 20px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #df2829;
    border-color: #df2829;
    transform: translateY(-2px);
}

.print-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.print-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.separator {
    margin: 0 8px;
    color: #adb5bd;
}

/* Course Sections */
.courses-section {
    margin-bottom: 40px;
}

.section-header {
    text-align: center;
    margin-bottom: 32px;
    padding: 24px 0;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #495057;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.section-title i {
    color: #df2829;
    font-size: 22px;
}

.section-subtitle {
    font-size: 14px;
    color: #6c757d;
    font-weight: 400;
}

/* Main Courses Section Styling */
.courses-section:first-of-type .section-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border-left: 4px solid #df2829;
    margin-bottom: 32px;
}

.courses-section:first-of-type .section-title {
    color: #df2829;
}

/* Secondary Courses Section Styling */
.courses-section:last-of-type .section-header {
    background: linear-gradient(135deg, #f1f8ff 0%, #e3f2fd 100%);
    border-radius: 12px;
    border-left: 4px solid #007bff;
    margin-bottom: 32px;
}

.courses-section:last-of-type .section-title {
    color: #007bff;
}

.courses-section:last-of-type .section-title i {
    color: #007bff;
}

/* Different styling for secondary course cards */
.course-card.secondary {
    border-left: 3px solid #007bff;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
}

.course-card.secondary .course-icon {
    color: #007bff;
}

.course-card.secondary .course-grade {
    color: #007bff;
}

.course-card.secondary .progress-fill {
    background: linear-gradient(90deg, #007bff 0%, #0056b3 100%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .search-card {
        padding: 24px;
    }

    .results-header {
        padding: 24px;
    }

    .student-name {
        font-size: 24px;
    }

    .gpa-display {
        min-width: 160px;
        padding: 16px;
    }

    .gpa-value {
        font-size: 28px;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
.search-input:focus,
.search-btn:focus {
    outline: 2px solid #df2829;
    outline-offset: 2px;
}

/* JavaScript Sidebar Positioning Script */
.js-sidebar-positioning {
    /* This class will be added by JavaScript for enhanced positioning */
}

/* Enhanced sidebar positioning using CSS with Tailwind */
.sidebar-container {
    position: absolute;
    top: 0;
    height: 100vh;
    z-index: 50;
    pointer-events: none;
}

.sidebar-ad-sticky {
    position: sticky;
    top: 1.25rem; /* 20px */
    margin-top: 18rem; /* 288px - start well after header */
    pointer-events: auto;
    transition: all 0.3s ease;
}

/* When above-header ad is present */
.has-above-header .sidebar-ad-sticky {
    margin-top: 24rem; /* 384px - extra space for above-header */
}

/* Responsive behavior */
@media (max-width: 1279px) {
    .sidebar-container {
        display: none;
    }
}

/* Mobile Sticky Ad */
.mobile-sticky-ad {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    height: 100px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
}

@media (max-width: 768px) {
    .mobile-sticky-ad {
        display: block;
    }
}

/* Fallback for browsers without sticky support */
@supports not (position: sticky) {
    .sidebar-container {
        position: fixed;
        top: 18rem; /* 288px */
        height: auto;
    }
    
    .sidebar-ad-sticky {
        position: static;
        margin-top: 0;
    }
    
    .has-above-header .sidebar-container {
        top: 24rem; /* 384px */
    }
}