/* Modern CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================================================
   PATH - CSS STYLING SYSTEM
   ============================================================================

   "come home before it's too late"

   A comprehensive CSS system for path's media exploration interface.
   Built with CSS custom properties for dynamic theming and clean,
   human-centered design principles.

   Design Philosophy:
   - Minimalist aesthetics that put content first
   - Responsive design for all devices
   - Accessibility-focused interactions
   - Theme system for personal expression
   - Keyboard-first navigation support

   Author: Niladri Das (@bniladridas)
   Repository: https://github.com/bniladridas/path
   ============================================================================ */

/* ============================================================================
   GLOBAL RESET AND BASE STYLES
   ============================================================================ */

/* Modern CSS Reset - Normalize browser differences */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Remove all default focus outlines globally */
/* Custom focus styles are implemented per component for better UX */
*:focus,
*:focus-visible,
*:active {
    outline: none !important;
    box-shadow: none !important;
}

/* ============================================================================
   CSS CUSTOM PROPERTIES - THEME SYSTEM
   ============================================================================ */

:root {
    /* Default Theme - Clean and minimal white theme */
    /* These variables can be overridden by JavaScript for dynamic theming */

    /* Background Colors - Layered depth system */
    --bg-primary: #fafafa;      /* Main background */
    --bg-secondary: #ffffff;    /* Cards and elevated surfaces */
    --bg-tertiary: #f5f5f5;     /* Subtle backgrounds and borders */

    /* Text Colors - Hierarchical contrast system */
    --text-primary: #1a1a1a;    /* Main content, headings */
    --text-secondary: #666666;  /* Body text, descriptions */
    --text-tertiary: #999999;   /* Placeholders, subtle text */

    /* Accent Color - Primary interaction color */
    --accent-color: #000000;    /* Focus states, highlights, themes */
    --border-color: #e5e5e5;
    --border-light: #f0f0f0;

    /* Typography System */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;

    /* Scale System */
    --text-xs: 0.75rem;     /* 12px */
    --text-sm: 0.875rem;    /* 14px */
    --text-base: 1rem;      /* 16px */
    --text-lg: 1.125rem;    /* 18px */
    --text-xl: 1.25rem;     /* 20px */
    --text-2xl: 1.5rem;     /* 24px */
    --text-3xl: 1.875rem;   /* 30px */
    --text-4xl: 2.25rem;    /* 36px */

    /* Spacing System */
    --space-1: 0.25rem;     /* 4px */
    --space-2: 0.5rem;      /* 8px */
    --space-3: 0.75rem;     /* 12px */
    --space-4: 1rem;        /* 16px */
    --space-6: 1.5rem;      /* 24px */
    --space-8: 2rem;        /* 32px */
    --space-12: 3rem;       /* 48px */
    --space-16: 4rem;       /* 64px */
    --space-24: 6rem;       /* 96px */

    /* Interaction */
    --border-radius: 0.375rem;
    --transition: all 0.15s ease;
    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   BODY AND ACCESSIBILITY STYLES
   ============================================================================ */

body {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-normal);
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Screen Reader Only - Accessible content hidden visually but available to screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Subtle Background */


/* Main Container */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Three Dot Menu */
.menu-container {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    z-index: 1000;
}

.menu-button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--border-radius);
    transition: var(--transition);
    color: var(--text-secondary);
}

.menu-button:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.menu-dots {
    font-size: var(--text-xl);
    font-weight: bold;
    line-height: 1;
    display: block;
}

.menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 120px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1001;
}

.menu-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-item {
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    font-size: var(--text-sm);
    border-bottom: 1px solid var(--border-light);
    outline: none;
    border: none;
    background: none;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.shortcut {
    float: right;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.3);
    padding: 1px 4px;
    border-radius: 2px;
    font-weight: var(--font-weight-medium);
    margin-left: var(--space-2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    line-height: 1;
}

.menu-item:hover .shortcut {
    color: rgba(255, 255, 255, 1);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.menu-item:focus,
.menu-item:active,
.menu-item:focus-visible {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    outline: 2px solid var(--accent-color) !important;
    outline-offset: -2px !important;
    border: none !important;
    box-shadow: none !important;
}

.menu-item:focus .shortcut,
.menu-item:active .shortcut {
    color: var(--text-secondary);
    background: var(--bg-primary);
}

/* Hero Section */
.hero-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--space-8);
    text-align: center;
    min-height: 100vh;
    max-width: 42rem;
    margin: 0 auto;
    transition: var(--transition);
}

.hero-section.search-mode {
    justify-content: center;
    padding-top: var(--space-8);
    min-height: auto;
}

.hero-content {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.hero-title {
    font-size: var(--text-4xl);
    font-weight: var(--font-weight-normal);
    color: var(--text-primary);
    margin-bottom: var(--space-12);
    letter-spacing: -0.025em;
    line-height: 1.2;
    transition: var(--transition);
}



/* Search Section */
.search-section {
    width: 100%;
    transition: var(--transition);
}

.search-section.search-mode {
    margin-top: var(--space-8);
    transform: translateY(100px);
}

.search-container {
    margin-bottom: var(--space-6);
}

.search-wrapper {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: var(--space-4) var(--space-6);
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.search-wrapper.focused {
    border-color: var(--accent-color);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Restore focus styling for search input specifically */
#search-input:focus {
    outline: none !important;
}

.search-wrapper:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

#search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: var(--text-base);
    color: var(--text-primary);
    font-family: var(--font-primary);
}

#search-input::placeholder,
#verify-input::placeholder {
    color: var(--text-tertiary);
}

#verify-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: var(--text-base);
    color: var(--text-primary);
    font-family: var(--font-primary);
}

.search-submit {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-submit:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Suggestions Section */
.suggestions-section {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-6);
    justify-content: center;
}

.suggestion-pill {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    font-family: var(--font-primary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.suggestion-pill:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-color);
    color: var(--text-primary);
}

/* Verification Image */
.verification-image-container {
    text-align: center;
    margin-bottom: var(--space-6);
}

.verification-image {
    max-width: 20rem;
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}





/* Response Section */
.response-section {
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    margin-bottom: var(--space-6);
}

.response-section[style*="block"] {
    opacity: 1;
    transform: translateY(0);
}

/* Hero Title Style for responses and about */
.hero-title-style {
    font-size: var(--text-4xl);
    font-weight: var(--font-weight-normal);
    color: var(--text-primary);
    letter-spacing: -0.025em;
    line-height: 1.2;
    text-align: center;
    font-family: var(--font-primary);
}

#response-container {
    background: transparent;
    border: none;
    padding: 0;
    transition: var(--transition);
}

.initial-text {
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    text-align: center;
}

.highlighted-text {
    color: var(--text-primary);
    font-size: var(--text-base);
    line-height: 1.6;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: var(--space-4);
    border-radius: var(--border-radius);
    margin-bottom: var(--space-4);
}

/* Content Text Styling */
.content-text {
    color: var(--text-secondary);
    font-size: var(--text-base);
    line-height: 1.6;
}

.content-text h3 {
    color: var(--text-primary);
    font-size: var(--text-lg);
    font-weight: var(--font-weight-semibold);
    margin: var(--space-6) 0 var(--space-3) 0;
}

.content-text p {
    margin-bottom: var(--space-4);
}

.content-text ul {
    margin: var(--space-3) 0;
    padding-left: var(--space-6);
}

.content-text li {
    margin-bottom: var(--space-2);
}

.content-text strong {
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
}

/* Error Message - Unified styling for all error messages */
.error-message {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    text-align: center;
    padding: var(--space-4);
    line-height: 1.5;
}

/* Loading States */
.loading-container {
    text-align: center;
    padding: var(--space-8);
}

.loading-text {
    color: var(--text-tertiary);
    font-size: var(--text-sm);
}

/* Error States */
.error-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: var(--space-6);
    border-radius: var(--border-radius);
    text-align: center;
}

.error-icon {
    font-size: var(--text-xl);
    margin-bottom: var(--space-3);
    color: var(--text-secondary);
}

.error-title {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--space-2);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(250, 250, 250, 0.95);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--space-8);
    max-width: 28rem;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-subtle);
}

.modal-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: var(--text-lg);
    cursor: pointer;
    transition: var(--transition);
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.modal-title {
    font-size: var(--text-xl);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-4);
    color: var(--text-primary);
}

.modal-body {
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-body p {
    margin-bottom: var(--space-4);
}

.modal-body ul {
    margin: var(--space-4) 0;
    padding-left: var(--space-6);
}

.modal-body li {
    margin-bottom: var(--space-2);
}

/* Button Styles */
.btn {
    background: var(--accent-color);
    border: none;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--border-radius);
    color: var(--bg-primary);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: var(--transition);
    font-size: var(--text-sm);
    font-family: var(--font-primary);
}

.btn:hover {
    background: var(--text-primary);
}

/* Footer */
footer {
    padding: var(--space-8);
    text-align: center;
    color: var(--text-tertiary);
    font-size: var(--text-xs);
    border-top: 1px solid var(--border-light);
    margin-top: auto;
}

.footer-text {
    line-height: 1.6;
}

.footer-text p {
    margin-bottom: var(--space-2);
}

.footer-text a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-text a:hover {
    color: var(--text-primary);
}

/* Animations */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: var(--space-6);
        max-width: 100%;
    }

    .hero-title {
        font-size: var(--text-3xl);
    }

    .hero-subtitle {
        font-size: var(--text-base);
        margin-bottom: var(--space-12);
    }

    .modal-content {
        padding: var(--space-6);
        margin: var(--space-4);
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: var(--space-4);
    }

    .hero-title {
        font-size: var(--text-2xl);
    }

    .hero-subtitle {
        margin-bottom: var(--space-8);
    }

    .search-wrapper,
    #response-container {
        padding: var(--space-4);
    }

    .modal-content {
        padding: var(--space-4);
        margin: var(--space-2);
    }

    footer {
        padding: var(--space-6);
    }
}

/* Terms and Privacy Page Styles */
.content-section {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-6);
}

.last-updated {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
    text-align: center;
}

.terms-content {
    line-height: 1.6;
    color: var(--text-primary);
}

.terms-content h2 {
    font-size: var(--text-xl);
    font-weight: var(--font-weight-semibold);
    margin: var(--space-8) 0 var(--space-4) 0;
    color: var(--text-primary);
}

.terms-content h3 {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-medium);
    margin: var(--space-6) 0 var(--space-3) 0;
    color: var(--text-primary);
}

.terms-content p {
    margin-bottom: var(--space-4);
    color: var(--text-primary);
}

.terms-content ul {
    margin: var(--space-4) 0;
    padding-left: var(--space-6);
}

.terms-content li {
    margin-bottom: var(--space-2);
    color: var(--text-primary);
}

.terms-content a {
    color: var(--text-primary);
    text-decoration: underline;
    transition: var(--transition);
}

.terms-content a:hover {
    color: var(--accent-color);
    opacity: 0.8;
}

.back-link {
    margin-top: var(--space-10);
    text-align: center;
}

.back-link a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    transition: var(--transition);
}

.back-link a:hover {
    opacity: 0.8;
}

/* Legal Footer Styles */
.legal-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(var(--bg-primary-rgb, 250, 250, 250), 0.95);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border-light);
    padding: var(--space-3) var(--space-4);
    z-index: 100;
    transform: translateY(0);
    transition: transform 0.3s ease-in-out;
}

.legal-footer.hidden {
    transform: translateY(100%);
}

.legal-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    line-height: 1.3;
}

.copyright {
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
}

.legal-separator {
    color: var(--text-tertiary);
    font-size: var(--text-xs);
}

.legal-text {
    color: var(--text-secondary);
    text-align: center;
}

.legal-text a {
    color: var(--text-secondary);
    text-decoration: underline;
    transition: var(--transition);
}

.legal-text a:hover {
    color: var(--text-primary);
}

/* Responsive footer */
@media (max-width: 768px) {
    .legal-content {
        flex-direction: column;
        gap: var(--space-1);
    }

    .legal-separator {
        display: none;
    }

    .legal-text {
        font-size: 11px;
    }
}

/* Info Table Styles */
.info-table {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
    font-size: 14px;
}

.info-table th, .info-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid rgba(255,255,255,0.2);
}

.info-table tr:first-child th {
    background: rgba(255,255,255,0.1);
}
