:root {
    --primary: #4361ee;
    --primary-dark: #3a0ca3;
    --secondary: #f72585;
    --accent: #4cc9f0;
    --dark: #2b2d42;
    --light: #f8f9fa;
    --gray: #6c757d;
    --success: #4ade80;
    --border: #dee2e6;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
    --radius: 12px;
    --sidebar-width: 300px;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: linear-gradient(135deg, #f5f7ff 0%, #f0f4ff 100%);
    min-height: 100vh;
    font-size: 16px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(0.5rem, 2vw, 20px);
    width: 100%;
}

/* Header Styles */
.main-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow);
    color: white;
}

.header-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(0.5rem, 2vw, 2rem);
    gap: 1rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.logo {
    height: clamp(30px, 8vw, 40px);
    width: auto;
    filter: brightness(0) invert(1);
}

.header-content h1 {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: 700;
    margin: 0;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn {
    padding: clamp(0.5rem, 2vw, 0.8rem) clamp(0.8rem, 3vw, 1.5rem);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: clamp(0.8rem, 2.5vw, 0.95rem);
    white-space: nowrap;
}

.btn-primary {
    background: white;
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 255, 255, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* Content Layout */
.content-container {
    display: grid;
    grid-template-columns: minmax(0, var(--sidebar-width)) 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.sidebar {
    background: white;
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    align-self: start;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar h3 {
    color: var(--primary-dark);
    font-size: clamp(1rem, 3vw, 1.2rem);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toc-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
}

.toc-toggle:hover {
    background: rgba(67, 97, 238, 0.1);
}

.toc-list {
    list-style: none;
}

.toc-item {
    margin-bottom: 0.5rem;
    position: relative;
}

.toc-item.section-header {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    padding-left: 0;
}

.toc-item.section-header:before {
    display: none;
}

.toc-item.section-header .toc-link {
    font-weight: 700;
    color: var(--primary-dark);
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    padding: 0.5rem 0;
}

.toc-link {
    color: var(--dark);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: clamp(0.85rem, 2.5vw, 0.95rem);
}

.toc-link:hover, .toc-link.active {
    color: var(--primary);
    background: rgba(67, 97, 238, 0.08);
}

.toc-link i {
    margin-right: 0.5rem;
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
}

.main-content {
    background: white;
    padding: clamp(1rem, 3vw, 2.5rem);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.last-updated {
    text-align: right;
    margin-bottom: 1.5rem;
    color: var(--gray);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
}

/* Policy Sections */
.policy-section {
    margin-bottom: 2.5rem;
    scroll-margin-top: 2rem;
}

.policy-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary);
}

.policy-icon {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    width: clamp(40px, 10vw, 60px);
    height: clamp(40px, 10vw, 60px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1rem, 3vw, 1.5rem);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
    flex-shrink: 0;
}

.policy-section h2 {
    color: var(--primary-dark);
    margin: 0;
    font-size: clamp(1.4rem, 5vw, 2rem);
    font-weight: 700;
    word-wrap: break-word;
}

.section-content {
    padding-left: 1rem;
    border-left: 3px solid var(--primary);
    margin-left: 0.5rem;
}

.policy-section h3 {
    color: var(--primary);
    margin: 1.5rem 0 1rem;
    font-size: clamp(1.1rem, 4vw, 1.4rem);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.policy-section h3 i {
    color: var(--secondary);
    font-size: 0.9rem;
}

.policy-section p {
    margin-bottom: 1rem;
    color: var(--dark);
    font-size: clamp(0.95rem, 2.5vw, 1.05rem);
    line-height: 1.6;
    word-wrap: break-word;
}

.policy-section ul {
    margin-bottom: 1rem;
    padding-left: 1.25rem;
}

.policy-section li {
    margin-bottom: 0.5rem;
    position: relative;
    line-height: 1.6;
    font-size: clamp(0.95rem, 2.5vw, 1rem);
}

.policy-section li:before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.highlight-box {
    background: linear-gradient(to right, rgba(67, 97, 238, 0.05), rgba(58, 12, 163, 0.05));
    border-left: 4px solid var(--primary);
    padding: 1.25rem;
    border-radius: 0 8px 8px 0;
    margin: 1.25rem 0;
}

.highlight-box ul {
    margin-bottom: 0;
}

.highlight-box li {
    margin-bottom: 0.5rem;
}

.fee-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
    font-size: clamp(0.85rem, 2.5vw, 1rem);
}

.fee-table th, .fee-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.fee-table th {
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
    color: white;
    font-weight: 600;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

.fee-table tr:last-child td {
    border-bottom: none;
}

.fee-table tr:nth-child(even) {
    background-color: rgba(67, 97, 238, 0.03);
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2.5rem;
    border-top: 1px solid var(--border);
    color: var(--gray);
    background: white;
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: var(--shadow);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

.contact-link {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.contact-link:hover {
    color: var(--secondary);
    text-decoration: underline;
}

/* Scroll to top button */
.scroll-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: clamp(40px, 10vw, 50px);
    height: clamp(40px, 10vw, 50px);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1rem, 3vw, 1.2rem);
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(67, 97, 238, 0.3);
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
    z-index: 999;
    border: none;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.4);
}

/* Print styles */
@media print {
    .main-header, .sidebar, .scroll-top, .header-buttons {
        display: none !important;
    }
    
    .content-container {
        display: block;
    }
    
    body, .main-content {
        background: white;
        color: black;
    }
    
    .main-content {
        box-shadow: none;
        padding: 0;
    }
    
    .policy-section h2 {
        color: black;
    }
    
    .policy-section h3 {
        color: black;
    }
    
    .section-content {
        border-left: 1px solid #ccc;
    }
}

/* Responsive Design - Updated breakpoints */
@media (max-width: 1024px) {
    .content-container {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .sidebar {
        position: static;
        max-height: none;
        width: 100%;
    }
    
    .toc-toggle {
        display: block;
    }
    
    .toc-list {
        display: none;
    }
    
    .toc-list.active {
        display: block;
    }
    
    .header-content {
        flex-direction: row;
        gap: 0.75rem;
        text-align: left;
    }
    
    .logo-container {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .main-header {
        padding: 0.75rem 0;
        margin-bottom: 1.25rem;
    }
    
    .header-content {
        padding: 0 0.5rem;
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .logo-container {
        justify-content: center;
    }
    
    .header-content h1 {
        font-size: clamp(1.2rem, 5vw, 1.5rem);
    }
    
    .header-buttons {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .main-content {
        padding: 1.25rem;
    }
    
    .policy-header {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .policy-icon {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .policy-section h2 {
        font-size: 1.5rem;
    }
    
    .section-content {
        padding-left: 0.75rem;
        margin-left: 0.5rem;
    }
    
    .policy-section h3 {
        font-size: 1.2rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .fee-table {
        font-size: 0.85rem;
    }
    
    .fee-table th, .fee-table td {
        padding: 0.5rem;
    }
    
    .scroll-top {
        bottom: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    :root {
        --sidebar-width: 100%;
    }
    
    .container {
        padding: 0 0.5rem;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-content h1 {
        font-size: 1.2rem;
    }
    
    .header-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .policy-section h2 {
        font-size: 1.3rem;
    }
    
    .policy-section h3 {
        font-size: 1.1rem;
    }
    
    .policy-section p {
        font-size: 0.95rem;
    }
    
    .btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .section-content {
        padding-left: 0.5rem;
        margin-left: 0.5rem;
    }
    
    .fee-table {
        display: block;
        overflow-x: auto;
        font-size: 0.8rem;
    }
    
    .fee-table th, .fee-table td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
    }
    
    .policy-header {
        flex-direction: column;
        text-align: center;
    }
    
    .policy-icon {
        margin: 0 auto;
    }
    
    .sidebar {
        padding: 1rem;
    }
    
    .toc-link {
        padding: 0.4rem 0.5rem;
    }
}

@media (max-width: 300px) {
    .container {
        padding: 0 0.25rem;
    }
    
    .header-content h1 {
        font-size: 1rem;
    }
    
    .logo {
        height: 25px;
    }
    
    .btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .policy-section h2 {
        font-size: 1.1rem;
    }
    
    .policy-section h3 {
        font-size: 1rem;
    }
    
    .policy-section p, .policy-section li {
        font-size: 0.85rem;
    }
    
    .main-content {
        padding: 0.75rem;
    }
    
    .sidebar {
        padding: 0.75rem;
    }
    
    .policy-icon {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .section-content {
        padding-left: 0.25rem;
        margin-left: 0.25rem;
        border-left-width: 2px;
    }
    
    .fee-table {
        font-size: 0.7rem;
    }
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.policy-section {
    animation: fadeIn 0.5s ease forwards;
}

.policy-section:nth-child(2) {
    animation-delay: 0.1s;
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}