/**
 * Grammar Guru - Legal Pages CSS
 * Styling for privacy policy, terms of service, and other legal documents
 */

/* Legal Page Layout */
.legal-page {
    min-height: 100vh;
    background: #f8fafc;
    padding: 6rem 0 4rem;
}

.legal-page .container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 3rem;
    align-items: start;
}

/* Legal Header */
.legal-header {
    text-align: center;
    margin-bottom: 3rem;
    grid-column: 1 / -1;
}

.legal-header h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.legal-updated {
    color: #718096;
    font-size: 1rem;
    font-style: italic;
    padding: 0.75rem 1.5rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 25px;
    display: inline-block;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

/* Legal Content */
.legal-content {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.legal-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.legal-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.legal-section h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #667eea;
    display: inline-block;
}

.legal-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #4a5568;
    margin: 2rem 0 1rem 0;
}

.legal-section p {
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.legal-section ul {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.legal-section li {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    position: relative;
}

.legal-section li::marker {
    color: #667eea;
    font-weight: 600;
}

/* Contact Info Styling */
.contact-info {
    background: #f8fafc;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    margin: 1.5rem 0;
}

.contact-info p {
    margin-bottom: 0.75rem;
    color: #2d3748;
    font-weight: 500;
}

.contact-info p:last-child {
    margin-bottom: 0;
}

.contact-info strong {
    color: #667eea;
    font-weight: 600;
}

/* Legal Navigation */
.legal-nav {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.legal-nav h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.legal-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.legal-nav li {
    margin-bottom: 0.5rem;
}

.legal-nav a {
    display: block;
    color: #718096;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    line-height: 1.4;
}

.legal-nav a:hover {
    background: #f8fafc;
    color: #667eea;
    transform: translateX(3px);
}

.legal-nav a.active {
    background: #667eea;
    color: white;
}

/* Special Text Styling */
.legal-section strong {
    color: #2d3748;
    font-weight: 600;
}

.legal-section em {
    color: #667eea;
    font-style: normal;
    font-weight: 500;
}

/* Important Notices */
.legal-notice {
    background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 10%, #fef3c7 100%);
    border: 1px solid #f59e0b;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    position: relative;
}

.legal-notice::before {
    content: '⚠️';
    font-size: 1.5rem;
    position: absolute;
    top: 1rem;
    left: 1rem;
}

.legal-notice p {
    margin-left: 2.5rem;
    color: #92400e;
    font-weight: 500;
    margin-bottom: 0;
}

/* Definitions */
.definition {
    background: #edf2f7;
    border-left: 4px solid #4299e1;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

.definition p {
    color: #2d3748;
    font-style: italic;
    margin-bottom: 0;
}

/* Code and Technical Terms */
.legal-section code {
    background: #f7fafc;
    color: #e53e3e;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    border: 1px solid #e2e8f0;
}

/* Tables for Legal Content */
.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.legal-table th,
.legal-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.legal-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #2d3748;
}

.legal-table td {
    color: #4a5568;
}

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

/* Print Styles */
@media print {
    .legal-page {
        background: white;
        padding: 0;
    }
    
    .legal-page .container {
        grid-template-columns: 1fr;
        max-width: none;
        padding: 0;
    }
    
    .legal-nav {
        display: none;
    }
    
    .legal-header h1 {
        color: #2d3748 !important;
        -webkit-text-fill-color: #2d3748 !important;
    }
    
    .legal-content {
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }
    
    .legal-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .legal-section h2 {
        page-break-after: avoid;
    }
    
    .contact-info {
        background: #f8fafc !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .legal-page .container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .legal-nav {
        position: static;
        max-height: none;
        order: -1;
    }
    
    .legal-nav ul {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .legal-page {
        padding: 4rem 0 2rem;
    }
    
    .legal-page .container {
        padding: 0 1rem;
    }
    
    .legal-header h1 {
        font-size: 2.2rem;
    }
    
    .legal-content {
        padding: 2rem 1.5rem;
    }
    
    .legal-section {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }
    
    .legal-section h2 {
        font-size: 1.5rem;
    }
    
    .legal-section h3 {
        font-size: 1.2rem;
    }
    
    .legal-section ul {
        padding-left: 1.5rem;
    }
    
    .legal-nav {
        padding: 1.5rem;
    }
    
    .legal-nav ul {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .legal-header h1 {
        font-size: 1.8rem;
    }
    
    .legal-content {
        padding: 1.5rem 1rem;
    }
    
    .legal-section h2 {
        font-size: 1.3rem;
    }
    
    .legal-section h3 {
        font-size: 1.1rem;
    }
    
    .legal-section ul {
        padding-left: 1rem;
    }
    
    .contact-info {
        padding: 1rem 1.5rem;
    }
    
    .legal-nav ul {
        grid-template-columns: 1fr;
    }
    
    .legal-notice {
        padding: 1rem;
    }
    
    .legal-notice p {
        margin-left: 2rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .legal-nav a {
        transition: none;
    }
    
    .legal-nav a:hover {
        transform: none;
    }
}

/* Dark Mode Support (if implemented) */
@media (prefers-color-scheme: dark) {
    .legal-page {
        background: #1a202c;
    }
    
    .legal-content,
    .legal-nav {
        background: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }
    
    .legal-section h2,
    .legal-section h3 {
        color: #e2e8f0;
    }
    
    .legal-section p,
    .legal-section li {
        color: #cbd5e0;
    }
    
    .legal-nav a {
        color: #a0aec0;
    }
    
    .legal-nav a:hover {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .contact-info {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .legal-updated {
        background: rgba(102, 126, 234, 0.2);
        color: #e2e8f0;
    }
}

/* Focus Styles for Accessibility */
.legal-nav a:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Smooth Scrolling for Navigation */
html {
    scroll-behavior: smooth;
}

/* Text Selection */
::selection {
    background: rgba(102, 126, 234, 0.2);
    color: #2d3748;
}

/* Loading Animation */
.legal-content.loading {
    position: relative;
    overflow: hidden;
}

.legal-content.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    animation: loading 2s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}
