/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Arial", sans-serif;
}

body {
    background-color: #0a0a0a;
    color: #ffffff;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    /* Add padding bottom for mobile to account for sticky footer */
    padding-bottom: env(safe-area-inset-bottom, 70px);
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #ffd700;
    color: #000;
    padding: 8px;
    z-index: 100;
    transition: top 0.3s;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.skip-link:focus {
    top: 0;
    width: auto;
    height: auto;
    clip: auto;
    overflow: visible;
}

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

/* Header styles - Sticky navbar */
header {
    background-color: #121212;
    padding: 15px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #222;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s, box-shadow 0.3s;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: #ffd700;
    text-decoration: none;
}

/* Navigation styles */
nav {
    display: flex;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin: 0 15px;
    position: relative;
}

nav ul li a {
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
    padding: 10px;
    display: inline-block;
}

nav ul li a:hover {
    color: #ffd700;
}

nav ul li a[aria-current="page"] {
    color: #ffd700;
    font-weight: bold;
}

.dropdown-icon::after {
    content: "▼";
    font-size: 10px;
    margin-left: 5px;
}

/* Auth buttons */
.auth-buttons {
    display: flex;
    gap: 15px; /* Increased from 10px for better spacing */
}

.auth-button-link {
    display: inline-block;
    text-decoration: none;
    min-width: 100px; /* Ensure minimum width for touch target */
}

.auth-button {
    padding: 12px 20px; /* Increased from 8px to 12px for better touch target */
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    min-height: 44px; /* Minimum height for touch targets */
}

.login-btn {
    background-color: transparent;
    color: #ffd700;
    border: 1px solid #ffd700;
}

.signup-btn {
    background-color: #ffd700;
    color: #000000;
}

.auth-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.auth-button:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Mobile menu styles */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #ffd700;
    font-size: 24px;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
}

/* Mobile auth buttons */
.mobile-auth-buttons {
    display: none;
    padding: 15px;
    background-color: #1a1a1a;
    border-top: 1px solid #333;
    margin-top: auto; /* Push to the bottom */
}

.mobile-auth-buttons .auth-buttons {
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.mobile-auth-buttons .auth-button-link {
    width: 100%;
}

/* Mobile Sticky Footer */
.mobile-sticky-footer {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #121212;
    border-top: 1px solid #333;
    padding: 10px 0;
    z-index: 999;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    justify-content: space-around;
    align-items: center;
}

.mobile-footer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #ffffff;
    text-decoration: none;
    padding: 8px 0;
    min-width: 70px;
    transition: color 0.3s;
}

.mobile-footer-item i {
    font-size: 20px;
    margin-bottom: 5px;
    color: #ffd700;
}

.mobile-footer-item:hover {
    color: #ffd700;
}

/* Banner Slider */
.banner-slider {
    position: relative;
    overflow: hidden;
    width: 100%;
    /* Desktop ratio: 16:6 */
    aspect-ratio: 16 / 6;
    margin: 0 auto;
}

.slides {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
    width: 100%;
}

.slide {
    min-width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevent slides from shrinking */
}

/* Slide background images */
.slide[data-slide="1"] {
    background-image: url("../images/tk999-banner001.webp");
    background-size: cover;
    background-position: center;
}

.slide[data-slide="2"] {
    background-image: url("../images/tk999-banner002.webp");
    background-size: cover;
    background-position: center;
}

.slide[data-slide="3"] {
    background-image: url("../images/tk999-banner003.webp");
    background-size: cover;
    background-position: center;
}

/* Update the slider-nav to be hidden on all devices */
.slider-nav {
    display: none; /* Hide the slider dots completely */
}

.slider-dot {
    width: 44px; /* Maintaining the larger size for accessibility */
    height: 44px; /* Maintaining the larger size for accessibility */
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-dot.active {
    background-color: #ffd700; /* Gold color for active dot */
}

.slider-dot:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px; /* Increased from 40px */
    height: 48px; /* Increased from 40px */
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    z-index: 10;
    transition: background-color 0.3s;
    border: none;
}

.slider-arrow:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.slider-arrow:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.slider-prev {
    left: 20px;
}

.slider-next {
    right: 20px;
}

/* Table of Contents */
.table-of-contents {
    background-color: #121212;
    border-radius: 8px;
    padding: 20px;
    margin: 30px auto;
    max-width: 800px;
    border: 1px solid #333;
}

.table-of-contents h2 {
    color: #ffd700;
    margin-bottom: 15px;
    font-size: 24px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.table-of-contents h2 i {
    transition: transform 0.3s;
}

.table-of-contents.collapsed h2 i {
    transform: rotate(180deg);
}

.toc-content {
    transition: max-height 0.3s ease;
    max-height: 500px;
    overflow: hidden;
}

.table-of-contents.collapsed .toc-content {
    max-height: 0;
}

/* Numbered TOC list */
.toc-list {
    list-style: none;
    counter-reset: toc-counter;
}

.toc-list li {
    margin-bottom: 10px;
    position: relative;
}

.toc-list > li {
    counter-increment: toc-counter;
}

.toc-list > li > a::before {
    content: counter(toc-counter) ". ";
    color: #ffd700;
    font-weight: bold;
}

.toc-list a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
    display: block;
    padding: 8px 0;
    font-size: 16px;
}

.toc-list .toc-sub {
    margin-left: 20px;
    font-size: 0.95em;
    counter-reset: toc-sub-counter;
    list-style: none; /* Remove bullets from sub-list */
}

.toc-list .toc-sub li {
    counter-increment: toc-sub-counter;
}

.toc-list .toc-sub li a::before {
    content: counter(toc-counter) "." counter(toc-sub-counter) " ";
    color: #ffd700;
    font-weight: bold;
}

/* Main content area */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Content sections */
.content-section {
    margin-bottom: 50px;
    background-color: #121212;
    border-radius: 8px;
    padding: 30px;
    border: 1px solid #333;
}

.content-section h1 {
    font-size: 36px;
    color: #ffd700;
    margin-bottom: 20px;
    text-align: center;
}

.content-section h2 {
    font-size: 28px;
    color: #ffd700;
    margin: 30px 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
    text-align: left; /* Ensure left alignment */
}

.content-section h3 {
    font-size: 22px;
    color: #ffd700;
    margin: 25px 0 15px;
    text-align: left; /* Ensure left alignment */
}

/* Add h4 style with same margin as h3 but keeping its font size */
.content-section h4 {
    font-size: 18px; /* Keep existing font size */
    color: #ffd700;
    margin: 25px 0 15px; /* Same margin as h3 */
    text-align: left; /* Ensure left alignment */
}

.content-section p {
    margin-bottom: 15px;
    color: #cccccc;
    text-align: left; /* Ensure left alignment */
}

/* Welcome section text alignment */
.welcome-text {
    text-align: center;
}

/* Content links */
.content-link {
    color: #ffd700;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.content-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Lists */
.content-section ul,
.content-section ol {
    margin: 15px 0 15px 20px;
    color: #cccccc;
    text-align: left; /* Ensure left alignment */
}

.content-section ul li,
.content-section ol li {
    margin-bottom: 10px;
    text-align: left; /* Ensure left alignment */
}

.content-section ul {
    list-style-type: disc;
}

.content-section ol {
    list-style-type: decimal;
}

/* FAQ Section */
.faq-section {
    margin-bottom: 50px;
    width: 100%; /* Ensure full width */
    text-align: left; /* Ensure left alignment */
}

#faq h2,
#faq p {
    text-align: left; /* Ensure left alignment for FAQ section headings */
}

.faq-item {
    background-color: #121212;
    border: 1px solid #333;
    border-radius: 8px;
    margin-bottom: 15px; /* Increased from 10px */
    overflow: visible; /* Changed from hidden to ensure content is fully visible */
    width: 100%;
    text-align: left; /* Ensure left alignment */
}

.faq-question {
    padding: 20px 25px; /* Increased padding */
    background-color: #1a1a1a;
    color: #ffd700;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s;
    min-height: 60px; /* Increased from 50px */
    font-size: 18px; /* Increased font size */
    width: 100%;
    text-align: left; /* Ensure left alignment */
}

.faq-question span {
    text-align: left; /* Ensure left alignment */
}

.faq-question:hover {
    background-color: #222;
}

.faq-question:focus {
    outline: 2px solid #ffd700;
    outline-offset: -2px;
}

.faq-question i {
    transition: transform 0.3s;
    font-size: 20px; /* Increased from 18px */
    padding: 10px;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

/* Update the FAQ answer section to be larger and fully visible */
.faq-answer {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s ease, padding 0.6s ease;
    width: 100%;
    text-align: left; /* Ensure left alignment */
}

.faq-item.active .faq-answer {
    max-height: 2000px; /* Significantly increased from 1000px */
    padding: 25px 30px; /* Increased padding */
}

.faq-answer p,
.faq-answer ul,
.faq-answer ol,
.faq-answer li {
    font-size: 16px;
    line-height: 1.8; /* Increased line height for better readability */
    text-align: left; /* Ensure left alignment */
}

.faq-answer ul,
.faq-answer ol {
    margin-left: 25px; /* Increased margin */
    text-align: left; /* Ensure left alignment */
}

.faq-answer li {
    margin-bottom: 12px; /* Increased spacing between list items */
    text-align: left; /* Ensure left alignment */
}

/* Footer */
footer {
    background-color: #0a0a0a;
    padding: 20px 0;
    text-align: center;
    color: #aaaaaa;
    font-size: 14px;
}

/* Responsive styles */
@media (max-width: 768px) {
    header {
        padding: 15px 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .logo {
        order: 1;
    }

    .menu-toggle {
        display: block;
        order: 3;
    }

    /* Hide desktop auth buttons on mobile */
    .auth-buttons:not(.mobile-auth-buttons .auth-buttons) {
        display: none;
    }

    /* Show mobile auth buttons */
    .mobile-auth-buttons {
        display: block;
    }

    /* Show mobile sticky footer */
    .mobile-sticky-footer {
        display: flex;
    }

    /* Add padding to bottom of body to account for sticky footer */
    body {
        padding-bottom: 70px;
    }

    nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #121212;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        z-index: 100;
        border-bottom: 1px solid #222;
    }

    nav.active {
        max-height: 500px; /* Increased to accommodate auth buttons */
        display: flex;
        flex-direction: column;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
        padding: 0;
        flex: 1; /* Take up available space */
    }

    nav ul li {
        margin: 0;
        width: 100%;
        text-align: center;
    }

    nav ul li a {
        display: block;
        padding: 15px;
        border-bottom: 1px solid #222;
    }

    /* Mobile banner slider - same aspect ratio for consistency */
    .banner-slider {
        aspect-ratio: 16 / 6;
    }

    .content-section h1 {
        font-size: 28px;
    }

    .content-section h2 {
        font-size: 24px;
        text-align: left; /* Ensure left alignment on mobile */
    }

    .content-section h3 {
        font-size: 20px;
        text-align: left; /* Ensure left alignment on mobile */
    }

    .content-section h4 {
        font-size: 18px;
        text-align: left; /* Ensure left alignment on mobile */
    }

    /* Ensure touch targets are large enough on mobile */
    .slider-dot {
        width: 32px;
        height: 32px;
    }

    /* Adjust the spacing between dots for mobile */
    .slider-nav {
        gap: 12px;
    }

    .slider-arrow {
        width: 48px;
        height: 48px;
    }

    /* Ensure FAQ section is left-aligned on mobile */
    #faq h2,
    #faq p,
    .faq-section,
    .faq-item,
    .faq-question,
    .faq-question span,
    .faq-answer,
    .faq-answer p,
    .faq-answer ul,
    .faq-answer ol,
    .faq-answer li {
        text-align: left !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    body {
        background-color: #000;
        color: #fff;
    }

    .logo,
    .content-section h1,
    .content-section h2,
    .content-section h3,
    .content-section h4,
    .faq-question {
        color: #fff;
    }

    .auth-button,
    .slider-dot.active {
        background-color: #fff;
        color: #000;
    }
}

/* Print styles */
@media print {
    body {
        background-color: #fff;
        color: #000;
    }

    .banner-slider,
    .auth-buttons,
    .menu-toggle,
    .slider-nav,
    .slider-arrow,
    .mobile-sticky-footer {
        display: none;
    }

    .content-section {
        border: 1px solid #ccc;
        margin-bottom: 20px;
        page-break-inside: avoid;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}
