/* Kay Griffin PLLC - Professional Document Generator */
:root {
    /* Professional Color Palette */
    --kg-navy: #1a2332;
    --kg-blue: #2563eb;
    --kg-light-blue: #dbeafe;
    --kg-gray: #64748b;
    --kg-light-gray: #f8fafc;
    --kg-success: #059669;
    --kg-warning: #d97706;
    --kg-danger: #dc2626;
    
    /* Semantic Colors */
    --primary: var(--kg-navy);
    --secondary: var(--kg-blue);
    --accent: var(--kg-light-blue);
    --text-primary: var(--kg-navy);
    --text-secondary: var(--kg-gray);
    --border: #e2e8f0;
    --surface: #ffffff;
    --background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    
    /* Shadows & Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

.page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Professional Header */
.professional-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg) var(--space-xl);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--space);
}

.firm-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.firm-info h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-xs);
}

.firm-tagline {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: var(--space);
}

.nav-link {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
    padding: var(--space-sm) var(--space);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.nav-link:hover {
    background: var(--accent);
    color: var(--kg-blue);
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: var(--space-2xl) var(--space-xl);
}

.content-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.page-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: var(--space);
    line-height: 1.2;
}

.page-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

/* Card Components */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.card-header {
    background: linear-gradient(135deg, var(--kg-light-gray) 0%, #f1f5f9 100%);
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: var(--space-xl);
}

/* Generator Grid */
.generators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-xl);
}

.generator-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.generator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary), var(--kg-blue));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.generator-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--secondary);
}

.generator-card:hover::before {
    opacity: 1;
}

.generator-card.featured {
    border: 2px solid var(--secondary);
    background: linear-gradient(135deg, var(--surface) 0%, var(--accent) 100%);
}

.generator-card.featured::before {
    opacity: 1;
}

.card-icon {
    font-size: 3rem;
    margin-bottom: var(--space);
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.generator-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--space-sm);
}

.generator-card p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    font-size: 0.95rem;
    line-height: 1.6;
    flex-grow: 1;
}

.card-features {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    justify-content: center;
}

.feature-tag {
    background: var(--kg-light-gray);
    color: var(--text-secondary);
    padding: var(--space-xs) var(--space-sm);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border);
}

.featured .feature-tag {
    background: var(--accent);
    color: var(--kg-blue);
    border-color: var(--kg-blue);
}

/* Button Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.75rem var(--space-lg);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1;
    min-height: 44px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--kg-blue) 100%);
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--kg-light-gray);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: var(--secondary);
}

.btn-success {
    background: var(--kg-success);
    color: white;
    box-shadow: var(--shadow);
}

.btn-success:hover {
    background: #047857;
    box-shadow: var(--shadow-lg);
}

.card-button {
    width: 100%;
    background: var(--kg-gray);
    color: white;
    text-align: center;
}

.card-button:hover {
    background: #475569;
}

.card-button.primary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--kg-blue) 100%);
}

.card-button.primary:hover {
    transform: translateY(-2px);
}

/* Form Components */
.form-section {
    margin-bottom: var(--space-xl);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--border);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--secondary);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    color: var(--primary);
    font-size: 0.95rem;
}

.form-input,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.75rem var(--space);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--surface);
}

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

textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space);
}

.form-help {
    display: block;
    margin-top: var(--space-xs);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.form-actions {
    display: flex;
    gap: var(--space);
    justify-content: center;
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border);
}

/* CSV Upload Section */
.csv-upload-section {
    background: linear-gradient(135deg, var(--accent) 0%, #f0f9ff 100%);
    border: 2px dashed var(--secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    margin-bottom: var(--space-xl);
    transition: all 0.3s ease;
}

.csv-upload-section:hover {
    border-color: var(--kg-blue);
    background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%);
}

.csv-upload-icon {
    font-size: 3rem;
    margin-bottom: var(--space);
    color: var(--secondary);
}

.csv-upload-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--space-sm);
}

.csv-upload-description {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.loading-content {
    background: var(--surface);
    padding: var(--space-2xl);
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--kg-light-gray);
    border-top: 4px solid var(--secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-lg);
}

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

.loading-content h3 {
    color: var(--primary);
    margin-bottom: var(--space-sm);
    font-size: 1.25rem;
}

.loading-content p {
    color: var(--text-secondary);
}

/* Results Display */
.result-section {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-top: var(--space-xl);
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.result-header h3 {
    color: var(--kg-success);
    font-size: 1.25rem;
    font-weight: 600;
}

.success-icon {
    font-size: 1.5rem;
}

/* Professional Footer */
.professional-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: var(--space-lg) var(--space-xl);
    margin-top: auto;
}

.footer-content {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Matter Selection */
.matter-selector {
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
    border: 1px solid #fde047;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.matter-selector h3 {
    color: var(--kg-warning);
    margin-bottom: var(--space);
}

.matter-search {
    position: relative;
}

.matter-search input {
    padding-left: 2.5rem;
}

.search-icon {
    position: absolute;
    left: var(--space);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--space);
    }
    
    .header-content {
        flex-direction: column;
        gap: var(--space);
        text-align: center;
        padding: var(--space) var(--space);
    }

    .main-content {
        padding: var(--space-xl) var(--space);
    }

    .page-title {
        font-size: 2rem;
    }

    .generators-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .card-body {
        padding: var(--space-lg);
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.hidden { display: none !important; }
.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;
}