/* Professional Mobile-First Theme with Subtle LCARS Elements */

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

/* Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-blue);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: var(--radius-sm);
    z-index: var(--z-tooltip);
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 6px;
}

/* Focus management */
.keyboard-navigation *:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

:root {
    /* Professional Color Palette */
    --primary-blue: #2563eb;
    --primary-dark: #1e40af;
    --accent-orange: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-section: #f1f5f9;
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    
    /* LCARS Accent Colors (subtle) */
    --lcars-orange: #ff9900;
    --lcars-blue: #5cc8ff;
    --lcars-purple: #cc99cc;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Inter', sans-serif;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    
    /* Status Colors */
    --success-color: #16a34a;
    --error-color: #dc2626;
    --warning-color: #d97706;
    --info-color: #2563eb;
    
    /* Interactive States */
    --focus-ring: 0 0 0 3px rgb(37 99 235 / 0.1);
    --transition-base: 0.2s ease;
    
    /* Z-index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal: 1040;
    --z-popover: 1050;
    --z-tooltip: 1060;
}

/* Base Typography */
body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
}

h2 {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

h4 {
    font-size: 1.125rem;
    margin-bottom: var(--space-xs);
}

/* Paragraphs and Text */
p {
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Container and Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-sm);
}

/* Header */
header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    min-height: 60px;
}

/* Logo with subtle LCARS accent */
.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    position: relative;
}

.logo::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--lcars-orange);
    border-radius: 2px;
}

/* Mobile Navigation */

.main-nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
}

.main-nav.active {
    transform: translateY(0);
}

/* Navigation toggle button styling */
.nav-toggle {
    display: flex;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
    padding: var(--space-xs);
    transition: color 0.2s ease;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    z-index: 1030;
    position: relative;
}

.nav-toggle:hover {
    color: var(--primary-blue);
}

.nav-toggle.active {
    color: var(--primary-blue);
}

.nav-toggle span {
    display: block;
    font-size: 1.5rem;
    line-height: 1;
}

.nav-list {
    list-style: none;
    padding: var(--space-sm) 0;
}

.nav-item {
    border-bottom: 1px solid var(--border-light);
}

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

.nav-link {
    display: block;
    padding: var(--space-sm) var(--space-md);
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    background: var(--bg-light);
    color: var(--primary-blue);
    text-decoration: none;
}

/* Ensure mobile menu works on all small screens */
@media (max-width: 1023px) {
    .nav-toggle {
        display: flex !important;
    }
    
    .main-nav {
        position: fixed !important;
        top: 60px;
        left: 0;
        right: 0;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
    }
    
    .main-nav.active {
        transform: translateY(0);
    }
    
    .nav-list {
        flex-direction: column !important;
        gap: 0 !important;
    }
    
    .nav-item {
        border-bottom: 1px solid var(--border-light);
    }
    
    .nav-link {
        display: block;
        padding: var(--space-sm) var(--space-md);
    }
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-section) 100%);
    padding: var(--space-2xl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23e2e8f0" stroke-width="0.5" opacity="0.3"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    pointer-events: none;
    opacity: 0.5;
}
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--lcars-orange) 0%, var(--lcars-blue) 50%, var(--lcars-purple) 100%);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.hero h2 {
    font-size: 1.125rem;
    color: var(--text-light);
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto var(--space-lg);
}

.hero-cta {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    align-items: center;
    margin-top: var(--space-lg);
}

@media (min-width: 640px) {
    .hero-cta {
        flex-direction: row;
        justify-content: center;
    }
}

/* Sections */
section {
    padding: var(--space-2xl) 0;
}

section:nth-child(even) {
    background: var(--bg-light);
}

/* Container system */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-sm);
}

/* Ensure sections have proper width constraints */
section {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-sm);
}

/* Hero sections override */
.hero {
    max-width: none;
    margin: 0;
    padding: var(--space-2xl) 0;
}

.hero .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-sm);
}

/* Legal document sections */
.legal-document {
    max-width: 800px;
}

.legal-document section {
    max-width: none;
    padding: var(--space-xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.section-title {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--lcars-orange) 0%, var(--lcars-blue) 100%);
    border-radius: 2px;
}

/* LCARS Design Elements */
.lcars-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--lcars-orange) 0%, var(--lcars-blue) 50%, var(--lcars-purple) 100%);
    margin: var(--space-md) 0;
    border-radius: 2px;
}

.lcars-header {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-md);
    gap: var(--space-sm);
}

.lcars-pill {
    width: 20px;
    height: 20px;
    background: var(--lcars-orange);
    border-radius: 10px;
    flex-shrink: 0;
}

.lcars-header h3 {
    margin: 0;
    color: var(--primary-blue);
    font-size: 1.5rem;
}

/* Cards and Content Blocks */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    margin-bottom: var(--space-md);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

.card-header::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--lcars-blue);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-secondary:hover {
    background: var(--primary-blue);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* LCARS Button Style */
.lcars-button {
    background: linear-gradient(135deg, var(--lcars-orange) 0%, var(--accent-orange) 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    min-height: 48px;
    width: 100%;
}

.lcars-button:hover {
    background: linear-gradient(135deg, var(--accent-orange) 0%, var(--lcars-orange) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.lcars-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.lcars-button:hover::before {
    left: 100%;
}
}

.btn-secondary {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-secondary:hover {
    background: var(--primary-blue);
    color: white;
    text-decoration: none;
}

.btn-accent {
    background: var(--accent-orange);
    color: white;
}

.btn-accent:hover {
    background: #d97706;
    color: white;
    text-decoration: none;
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.grid-2 {
    grid-template-columns: 1fr;
}

.grid-3 {
    grid-template-columns: 1fr;
}

/* Forms */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--space-sm);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

/* Footer */
footer {
    background: var(--text-primary);
    color: var(--bg-light);
    padding: var(--space-xl) 0 var(--space-lg);
    margin-top: var(--space-2xl);
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-sm);
}

.footer-content p {
    color: var(--bg-light);
    margin-bottom: var(--space-md);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.footer-links a {
    color: var(--bg-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--lcars-orange);
    text-decoration: underline;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.social-links a {
    color: var(--bg-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

.social-links a:hover {
    color: var(--lcars-blue);
    text-decoration: underline;
}

@media (min-width: 768px) {
    .footer-links,
    .social-links {
        flex-direction: row;
        justify-content: center;
        gap: var(--space-lg);
    }
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-sm);
    margin: var(--space-lg) 0;
}

.service-item {
    padding: var(--space-md);
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.service-item:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.service-item h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
}

@media (min-width: 640px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet Styles */
@media (min-width: 768px) {
    .hero h1 {
        font-size: 3.5rem;
    }
    
    .hero h2 {
        font-size: 1.25rem;
    }
    
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .container {
        padding: 0 var(--space-md);
    }
}

/* Desktop Styles */
@media (min-width: 1024px) {
    .nav-toggle {
        display: none;
    }
    
    .main-nav {
        position: static;
        transform: none;
        background: transparent;
        border: none;
        box-shadow: none;
        max-height: none;
        overflow: visible;
    }
    
    .nav-list {
        display: flex;
        padding: 0;
        gap: var(--space-sm);
    }
    
    .nav-item {
        border: none;
    }
    
    .nav-link {
        padding: var(--space-xs) var(--space-sm);
        border-radius: var(--radius-sm);
    }
    
    .hero h1 {
        font-size: 4rem;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .container {
        padding: 0 var(--space-lg);
    }
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }
.delay-7 { transition-delay: 0.7s; }
.delay-8 { transition-delay: 0.8s; }

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }