/* Policies Page Styles */


.policies-header {
    position: relative;
    width: min(1200px, 92%);
    margin: 20px auto 20px auto;
    padding: 0px 10px 0px 10px;
    background: var(--card);
    border-radius: 10px;
    box-shadow: 0px 0px 10px 5px rgb(0, 0, 0, 0.2);
}

.header-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: right;
    width: 100%;
    min-height: 60px;
}

.header-brand {
    cursor: default;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-strong);
}

.policies-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 10px;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
    background: var(--glass);
    color: var(--text-strong);
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card);
    cursor: pointer;
    gap: 4px;
    padding: 8px;
    transition: background 0.2s ease, border-color 0.2s ease;
    z-index: 2;
}

.menu-toggle:hover {
    background: var(--glass);
    border-color: var(--accent);
}

.menu-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-strong);
    border-radius: 999px;
}

.nav-button {
    position: relative;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 700;
    min-height: 36px;
    max-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.policies-main {
    width: min(1200px, 92%);
    margin: 0 auto;
    padding-bottom: 80px;
    flex: 1;
}

.policies-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    min-height: 600px;
}

/* Sidebar */
.policies-sidebar {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: 20px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

.sidebar-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-strong);
    margin: 0 0 8px 0;
}

.sidebar-description {
    font-size: 14px;
    color: var(--text);
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.policy-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.policy-item {
    background: var(--card-dark);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.policy-item:hover {
    background: var(--glass);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.policy-item.active {
    background: var(--accent);
    border-color: var(--accent);
}

.policy-item.active .policy-item-title,
.policy-item.active .policy-item-meta {
    color: #ffffff;
}

.policy-item-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.policy-item-info {
    flex: 1;
    min-width: 0;
}

.policy-item-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-strong);
    margin: 0 0 4px 0;
}

.policy-item-meta {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.policy-item-date,
.policy-item-version {
    display: inline-block;
}

/* Content Area */
.policies-content {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 40px;
    min-height: 600px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.policy-viewer {
    max-width: 900px;
    width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Placeholder */
.policy-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    text-align: center;
}

.placeholder-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.placeholder-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-strong);
    margin: 0 0 12px 0;
}

.placeholder-text {
    font-size: 16px;
    color: var(--text);
    margin: 0;
}

/* Policy Document Styles */
.policy-document {
    animation: fadeIn 0.3s ease;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.policy-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border);
}

.policy-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-strong);
    margin: 0 0 12px 0;
}

.policy-meta-info {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--muted);
}

.policy-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.policy-meta-icon {
    font-size: 16px;
}

/* Policy Content Styling */
.policy-content h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-strong);
    margin: 32px 0 16px 0;
}

.policy-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-strong);
    margin: 28px 0 14px 0;
}

.policy-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-strong);
    margin: 24px 0 12px 0;
}

.policy-content h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-strong);
    margin: 20px 0 10px 0;
}

.policy-content p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    margin: 0 0 16px 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.policy-content ul,
.policy-content ol {
    margin: 0 0 16px 0;
    padding-left: 24px;
    color: var(--text);
}

.policy-content li {
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 8px;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.policy-content a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.policy-content a:hover {
    text-decoration: underline;
}

.policy-content strong {
    color: var(--text-strong);
    font-weight: 600;
}

.policy-content em {
    font-style: italic;
}

.policy-content blockquote {
    margin: 20px 0;
    padding: 16px 20px;
    background: var(--card-dark);
    border-left: 4px solid var(--accent);
    border-radius: 0 8px 8px 0;
}

.policy-content blockquote p {
    margin: 0;
}

.policy-content code {
    background: var(--card-dark);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--accent);
}

.policy-content pre {
    background: var(--card-dark);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
}

.policy-content pre code {
    background: transparent;
    padding: 0;
}

.policy-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.policy-content th,
.policy-content td {
    padding: 12px;
    text-align: left;
    border: 1px solid var(--border);
}

.policy-content th {
    background: var(--card-dark);
    font-weight: 600;
    color: var(--text-strong);
}

.policy-content td {
    color: var(--text);
}

/* Loading State */
.policy-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin-top: 16px;
    font-size: 16px;
    color: var(--text);
}

/* Error State */
.policy-error {
    text-align: center;
    padding: 40px;
}

.error-icon {
    font-size: 60px;
    margin-bottom: 16px;
}

.error-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-strong);
    margin: 0 0 8px 0;
}

.error-message {
    font-size: 16px;
    color: var(--text);
}

/* Responsive */
@media (max-width: 1024px) {
    .policies-container {
        grid-template-columns: 1fr;
    }

    .policies-sidebar {
        position: relative;
        top: 0;
    }

    .policies-content {
        padding: 28px;
    }
}

@media (max-width: 720px) {
    .policies-header {
        padding: 8px 10px;
    }

    .header-inner {
        align-content: center;
        min-height: unset;
        gap: 8px;
    }

    .policies-nav {
        position: absolute;
        width: min-content;
        justify-content: center;
        white-space: nowrap;
        margin-left: 0;
        flex-direction: column;
        align-items: stretch;
        flex-wrap: nowrap;
        gap: 10px;
        row-gap: 10px;
        display: none;
        right: 0;
        z-index: 11;
        background-color: var(--card);
        padding: 8px 12px;
        top: 65px;
        border-radius: 8px;
        border: 1px solid var(--border);
    }

    .policies-nav.is-open {
        display: flex;
    }

    .nav-link,
    .nav-button {
        width: 100%;
        min-width: 0;
        min-height: 42px;
        max-height: none;
        margin-bottom: 0;
        text-align: center;
    }

    .menu-toggle {
        display: flex;
    }

    .policies-header.menu-open .policies-nav {
        display: flex;
    }

    .policies-content {
        padding: 20px;
    }

    .policy-title {
        font-size: 24px;
    }

    .policy-content h1 {
        font-size: 22px;
    }

    .policy-content h2 {
        font-size: 20px;
    }

    .policy-content h3 {
        font-size: 18px;
    }

    .policy-content h4 {
        font-size: 16px;
    }

    .policy-content p,
    .policy-content li {
        font-size: 15px;
    }

    .policy-meta-info {
        font-size: 13px;
    }
}

/* Footer positioning */
.footer {
    position: relative;
    top: auto;
    margin-top: 40px;
}