/* public/css/policy.css */

/* Policy Page Specific Styles */
.policy-main {
    padding-top: 80px;
    min-height: 100vh;
    background: var(--bg-primary);
}

/* Hero Section */
.policy-hero {
    padding: 4rem 0 3rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(236, 72, 153, 0.05));
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.policy-hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.policy-hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    margin-bottom: 1rem;
    background: var(--primary-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease infinite;
}

.policy-subtitle {
    font-size: 1.2rem;
    color: #CBD5E1;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.policy-meta {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.policy-date,
.policy-version {
    font-size: 0.9rem;
    color: #94A3B8;
    padding: 0.5rem 1rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

/* Content Section */
.policy-content {
    padding: 3rem 0 5rem;
}

.policy-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    align-items: start;
}

/* Sidebar */
.policy-sidebar {
    position: sticky;
    top: 100px;
    padding: 2rem;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.policy-sidebar h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1.5rem;
}

.policy-toc {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.policy-toc a {
    color: #CBD5E1;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.policy-toc a:hover {
    background: rgba(102, 126, 234, 0.1);
    border-left-color: var(--primary-blue);
    color: #fff;
    transform: translateX(5px);
}

/* Article */
.policy-article {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ============================================
   CRITICAL FIX: Policy Section Card
   ============================================ */
.policy-section {
    padding: 2.5rem;
    position: relative;
    scroll-margin-top: 100px;
    overflow: visible !important;
    /* CRITICAL: Allow badge to overflow */
    margin-top: 30px;
    /* CRITICAL: Space for the badge */
}

/* ============================================
   FIXED: Section Number Positioning
   ============================================ */
.section-number {
    position: absolute;
    top: -30px;
    /* CHANGED: More negative to pull it up */
    left: 30px;
    background: var(--primary-gradient);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.4rem;
    box-shadow:
        0 8px 24px rgba(102, 126, 234, 0.5),
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    z-index: 10;
    transition: all 0.3s ease;
}

.policy-section:hover .section-number {
    transform: scale(1.1) rotate(-5deg);
    box-shadow:
        0 12px 32px rgba(102, 126, 234, 0.6),
        0 6px 16px rgba(0, 0, 0, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

.policy-section h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
    /* REDUCED: Less space since badge is outside */
    padding-top: 0;
}

.policy-section h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #E2E8F0;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.policy-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #CBD5E1;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.policy-section p {
    font-size: 1rem;
    color: #94A3B8;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.policy-section ul {
    list-style: none;
    padding-left: 0;
    margin: 1rem 0;
}

.policy-section li {
    color: #94A3B8;
    padding: 0.75rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.policy-section li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary-blue);
    font-weight: bold;
}

.policy-section strong {
    color: #E2E8F0;
    font-weight: 600;
}

.policy-section a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: all 0.3s ease;
}

.policy-section a:hover {
    color: var(--primary-pink);
    text-decoration: underline;
}

/* Info Boxes */
.info-box,
.warning-box {
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.info-box {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: var(--primary-blue);
    color: #CBD5E1;
}

.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: var(--primary-orange);
    color: #CBD5E1;
}

/* Use Case Grid */
.use-case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.use-case-item {
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

.use-case-item:hover {
    transform: translateY(-5px);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.use-case-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.use-case-item h4 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.use-case-item p {
    color: #94A3B8;
    font-size: 0.95rem;
    margin: 0;
}

/* Security Grid */
.security-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.security-item {
    text-align: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

.security-item:hover {
    transform: translateY(-5px);
    border-color: rgba(102, 126, 234, 0.5);
}

.security-badge {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
}

.security-item h4 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.security-item p {
    color: #94A3B8;
    font-size: 0.9rem;
    margin: 0;
}

/* Rights Grid */
.rights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.right-item {
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

.right-item:hover {
    transform: translateY(-5px);
    border-color: rgba(102, 126, 234, 0.5);
}

.right-item h4 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.right-item p {
    color: #94A3B8;
    font-size: 0.95rem;
    margin: 0;
}

/* Contact Grid */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.contact-method {
    text-align: center;
    padding: 2rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

.contact-method:hover {
    transform: translateY(-5px);
    border-color: rgba(102, 126, 234, 0.5);
}

.contact-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.contact-method h4 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.contact-method p {
    color: #94A3B8;
    margin: 0;
}

.contact-method a {
    color: var(--primary-blue);
}

.response-time {
    text-align: center;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    margin-top: 2rem;
    color: #CBD5E1;
}

/* Resources Grid */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.resource-link {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.resource-link span {
    font-size: 2.5rem;
}

.resource-link h4 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.resource-link p {
    color: #94A3B8;
    font-size: 0.9rem;
    margin: 0;
}

.resource-link:hover {
    transform: translateY(-5px);
}

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

    .policy-sidebar {
        position: relative;
        top: 0;
        max-height: none;
    }

    .policy-toc {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .policy-hero {
        padding: 3rem 0 2rem;
    }

    .policy-hero h1 {
        font-size: 2rem;
    }

    .policy-subtitle {
        font-size: 1rem;
    }

    .policy-section {
        padding: 2rem 1.5rem;
        margin-top: 25px;
    }

    .section-number {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        top: -25px;
        left: 20px;
    }

    .policy-section h2 {
        font-size: 1.5rem;
    }

    .policy-section h3 {
        font-size: 1.2rem;
    }

    .use-case-grid,
    .security-grid,
    .rights-grid,
    .contact-grid,
    .resources-grid {
        grid-template-columns: 1fr;
    }

    .policy-toc {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .policy-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .policy-section {
        padding: 1.5rem 1rem;
        margin-top: 20px;
    }

    .section-number {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
        top: -22px;
        left: 15px;
        border-radius: 12px;
    }

    .policy-section h2 {
        font-size: 1.3rem;
    }
}

/* ============================================
   Smooth Animations
   ============================================ */
@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

html {
    scroll-behavior: smooth;
}

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

.policy-sidebar::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 3px;
}

.policy-sidebar::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 3px;
}

.policy-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}