/* ============================================
   Tax Advisor - Shared Styles
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ============================================
   Header
   ============================================ */

.header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo-icon {
    font-size: 3rem;
}

.logo h1 {
    font-size: 2.5rem;
    color: #1a1a2e;
    font-weight: 700;
}

.tagline {
    color: #666;
    font-size: 1.1rem;
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.hero {
    text-align: center;
    margin-bottom: 40px;
}

.hero h2 {
    font-size: 2rem;
    color: #1a1a2e;
    margin-bottom: 15px;
}

.hero p {
    color: #666;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   Feature Cards
   ============================================ */

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.feature-card {
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: #4facfe;
    box-shadow: 0 15px 30px rgba(79, 172, 254, 0.2);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.4rem;
    color: #1a1a2e;
    margin-bottom: 15px;
}

.feature-card p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(79, 172, 254, 0.4);
}

.btn-secondary {
    background: #1a1a2e;
    color: white;
}

.btn-secondary:hover {
    background: #16213e;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* ============================================
   How It Works
   ============================================ */

.how-it-works {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 2px solid #e9ecef;
}

.how-it-works h3 {
    text-align: center;
    font-size: 1.8rem;
    color: #1a1a2e;
    margin-bottom: 40px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.step {
    text-align: center;
    padding: 20px;
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 20px;
}

.step h4 {
    color: #1a1a2e;
    margin-bottom: 10px;
}

.step p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ============================================
   Recent Analyses
   ============================================ */

.recent-analyses {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.recent-analyses h3 {
    font-size: 1.5rem;
    color: #1a1a2e;
    margin-bottom: 20px;
}

.clients-list {
    display: grid;
    gap: 15px;
}

.client-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.client-card:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.client-info h4 {
    color: #1a1a2e;
    margin-bottom: 5px;
}

.client-info p {
    color: #666;
    font-size: 0.9rem;
}

.client-info small {
    color: #999;
}

.empty-state {
    text-align: center;
    color: #666;
    padding: 30px;
}

.empty-state a {
    color: #4facfe;
}

/* ============================================
   Footer
   ============================================ */

.footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   Upload Page Styles
   ============================================ */

.upload-section {
    max-width: 800px;
    margin: 0 auto;
}

.upload-instructions {
    background: linear-gradient(135deg, #e8f4f8 0%, #d4edda 100%);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.upload-instructions h3 {
    color: #1a1a2e;
    margin-bottom: 10px;
}

.upload-instructions ul {
    margin-left: 20px;
    color: #555;
}

.upload-instructions li {
    margin: 8px 0;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #4facfe;
}

.drop-zone {
    border: 3px dashed #ccc;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: #4facfe;
    background: rgba(79, 172, 254, 0.05);
}

.drop-zone-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.drop-zone p {
    color: #666;
    margin-bottom: 10px;
}

.drop-zone small {
    color: #999;
}

.drop-zone input[type="file"] {
    display: none;
}

.selected-files {
    margin-top: 20px;
}

.selected-files h4 {
    color: #1a1a2e;
    margin-bottom: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #e9ecef;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.file-item .file-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-item .remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.submit-section {
    margin-top: 30px;
    text-align: center;
}

.submit-btn {
    padding: 15px 50px;
    font-size: 1.1rem;
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   Loading & Progress
   ============================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 46, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    color: white;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #4facfe;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.loading-content p {
    color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   Dashboard Styles
   ============================================ */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.client-title h2 {
    color: #1a1a2e;
    font-size: 2rem;
}

.client-title p {
    color: #666;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.metric-card {
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 25px;
}

.metric-card h4 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.metric-values {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric-year {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-year .year {
    color: #999;
    font-size: 0.9rem;
}

.metric-year .value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a1a2e;
}

.change {
    font-size: 0.85rem;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 10px;
}

.change.positive {
    background: #d4edda;
    color: #155724;
}

.change.negative {
    background: #f8d7da;
    color: #721c24;
}

.change.neutral {
    background: #e9ecef;
    color: #666;
}

/* ============================================
   AI Analysis Section
   ============================================ */

.ai-analysis-section {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    color: white;
}

.ai-analysis-section h3 {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.5rem;
    margin-bottom: 25px;
}

.ai-content {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 25px;
    line-height: 1.8;
}

.ai-content h1, .ai-content h2, .ai-content h3, .ai-content h4 {
    color: #4facfe;
    margin: 20px 0 15px;
}

.ai-content h1:first-child, .ai-content h2:first-child, .ai-content h3:first-child {
    margin-top: 0;
}

.ai-content ul, .ai-content ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.ai-content li {
    margin: 8px 0;
}

.ai-content strong {
    color: #00f2fe;
}

.ai-content p {
    margin-bottom: 15px;
}

/* ============================================
   Flags Section
   ============================================ */

.flags-section {
    margin-bottom: 30px;
}

.flags-section h3 {
    color: #1a1a2e;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.flag-card {
    background: #fff;
    border-left: 4px solid #ffc107;
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.flag-card.high {
    border-left-color: #dc3545;
}

.flag-card .flag-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.flag-card .field-name {
    font-weight: 600;
    color: #1a1a2e;
}

.flag-card .severity {
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
}

.flag-card .severity.high {
    background: #f8d7da;
    color: #721c24;
}

.flag-card .severity.medium {
    background: #fff3cd;
    color: #856404;
}

.flag-card .message {
    color: #666;
    font-size: 0.95rem;
}

/* ============================================
   Back Link
   ============================================ */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #4facfe;
    text-decoration: none;
    margin-bottom: 20px;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

/* ============================================
   Error & Status Messages
   ============================================ */

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header {
        padding: 20px;
    }

    .logo h1 {
        font-size: 1.8rem;
    }

    .main-content {
        padding: 25px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .steps {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}
