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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Input Section */
.input-section {
    display: flex;
    justify-content: center;
}

.input-card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 1200px;
}

.input-card h2 {
    color: #333;
    margin-bottom: 30px;
    font-size: 1.8rem;
    text-align: center;
}

.input-card h2 i {
    color: #667eea;
    margin-right: 10px;
}

.input-group {
    margin-bottom: 30px;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #555;
}

.input-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* AI Selection Section */
.ai-selection-section {
    margin: 30px 0;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px solid #e9ecef;
}

.ai-selection-section h3 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.5rem;
    text-align: center;
}

.ai-selection-section h3 i {
    color: #667eea;
    margin-right: 10px;
}

.ai-models-grid {
    display: grid;
    gap: 30px;
}

.ai-category {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.ai-category h4 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.ai-category h4 i {
    color: #667eea;
    margin-right: 10px;
}

.ai-models {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.ai-model-card {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.ai-model-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.ai-model-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ai-model-card.selected .model-info h5,
.ai-model-card.selected .model-info p {
    color: white;
}

.model-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.ai-model-card.selected .model-icon {
    background: rgba(255,255,255,0.2);
}

.model-icon i {
    color: white;
    font-size: 1.2rem;
}

.model-info {
    flex: 1;
}

.model-info h5 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #333;
}

.model-info p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
}

.model-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.model-badge.recommended { background: #28a745; color: white; }
.model-badge.premium { background: #ffc107; color: #333; }
.model-badge.fast { background: #17a2b8; color: white; }
.model-badge.economy { background: #6c757d; color: white; }
.model-badge.chat { background: #20c997; color: white; }
.model-badge.reasoning { background: #6f42c1; color: white; }
.model-badge.pro { background: #fd7e14; color: white; }
.model-badge.mini { background: #e83e8c; color: white; }
.model-badge.balanced { background: #007bff; color: white; }
.model-badge.latest { background: #dc3545; color: white; }
.model-badge.realtime { background: #198754; color: white; }
.model-badge.efficient { background: #0dcaf0; color: #333; }

/* AI Model Selection (after data extraction) */
.ai-model-selection {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid #e9ecef;
    text-align: center;
}

.ai-model-selection h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.ai-model-selection h3 i {
    color: #667eea;
    margin-right: 10px;
}

.ai-model-selection p {
    color: #666;
    margin-bottom: 20px;
}

.ai-model-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.ai-model-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.ai-model-btn:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.ai-model-btn.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ai-model-btn i {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: #667eea;
}

.ai-model-btn.selected i {
    color: white;
}

.ai-model-btn span {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}

.ai-model-btn small {
    font-size: 0.8rem;
    opacity: 0.8;
}

.generate-analysis-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto;
}

.generate-analysis-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.generate-analysis-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Tab styles for disabled state */
.tab-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Analyze Button */
.analyze-btn {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

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

.analyze-btn i {
    margin-right: 10px;
}

/* Loading Section */
.loading-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.loading-card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 500px;
    width: 100%;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-steps {
    margin-top: 30px;
}

.step {
    display: flex;
    align-items: center;
    padding: 10px 0;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.step.active {
    opacity: 1;
    color: #667eea;
}

.step i {
    margin-right: 15px;
    width: 20px;
}

/* Results Section */
.results-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.results-header h2 {
    color: #333;
    font-size: 1.8rem;
}

.results-header h2 i {
    color: #667eea;
    margin-right: 10px;
}

.results-actions {
    display: flex;
    gap: 15px;
}

.download-btn, .new-analysis-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-btn {
    background: #28a745;
    color: white;
}

.download-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

.new-analysis-btn {
    background: #667eea;
    color: white;
}

.new-analysis-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 30px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 12px;
}

.tab-btn {
    padding: 12px 20px;
    border: 2px solid transparent;
    background: white;
    color: #495057;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
    min-width: 140px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.tab-btn:hover {
    background: #f8f9fa;
    color: #667eea;
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.15);
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.tab-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    background: #e9ecef;
    color: #6c757d;
}

/* Tab Content */
.tab-content {
    min-height: 500px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.content-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.content-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.content-card h3 {
    color: #1a202c;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-card h3 i {
    color: #667eea;
    width: 20px;
    font-size: 1.2rem;
}

.content-area {
    color: #2c3e50;
    line-height: 1.8;
    font-size: 1rem;
}

.content-area ul {
    padding-left: 20px;
    margin: 10px 0;
}

.content-area li {
    margin-bottom: 10px;
    color: #34495e;
    font-weight: 500;
}

.content-area .highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-block;
    margin: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.content-area .metric {
    display: inline-block;
    background: #ffffff;
    border: 2px solid #dee2e6;
    color: #2c3e50;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 5px 5px 5px 0;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.content-area .recommendation {
    background: #e8f4fd;
    border: 2px solid #b3d9f2;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    color: #1e3a8a;
    font-weight: 500;
}

.content-area .recommendation h4 {
    color: #1e40af;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.content-area .warning {
    background: #fef3c7;
    border: 2px solid #fbbf24;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    color: #92400e;
    font-weight: 500;
}

.content-area .warning h4 {
    color: #78350f;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.content-area p {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 500;
}

.content-area strong {
    color: #1a202c;
    font-weight: 700;
}

.content-area h4 {
    color: #1a202c;
    margin: 20px 0 10px 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.content-section {
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(255,255,255,0.8);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.budget-breakdown {
    margin-top: 15px;
}

.budget-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin: 8px 0;
    background: white;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    font-weight: 600;
    color: #2d3748;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.budget-item span:first-child {
    color: #1a202c;
    font-weight: 600;
}

.budget-item .highlight {
    margin: 0;
    padding: 4px 8px;
    font-size: 0.9rem;
    font-weight: 700;
}

/* Error Section */
.error-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.error-card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 500px;
    width: 100%;
}

.error-card i {
    font-size: 3rem;
    color: #dc3545;
    margin-bottom: 20px;
}

.error-card h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.error-card p {
    color: #666;
    margin-bottom: 25px;
}

.retry-btn {
    padding: 12px 25px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: rgba(255,255,255,0.8);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .input-card {
        padding: 25px;
    }
    
    .ai-models {
        grid-template-columns: 1fr;
    }
    
    .ai-model-card {
        flex-direction: column;
        text-align: center;
    }
    
    .model-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .tab-navigation {
        flex-direction: column;
    }
    
    .tab-btn {
        min-width: auto;
        justify-content: flex-start;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .results-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .input-card {
        padding: 20px;
    }
    
    .ai-selection-section {
        padding: 20px;
    }
    
    .ai-category {
        padding: 15px;
    }
    
    .results-section {
        padding: 20px;
    }
    
    .content-card {
        padding: 20px;
    }
    
    .analyze-btn {
        padding: 15px 20px;
        font-size: 1.1rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .input-card,
    .results-section,
    .loading-card,
    .error-card {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .content-card {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .ai-selection-section {
        background: #4a5568;
        border-color: #718096;
    }
    
    .ai-category {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .ai-model-card {
        background: #2d3748;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .tab-navigation {
        background: #4a5568;
    }
    
    .input-group input {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .input-group input:focus {
        border-color: #667eea;
    }
}

/* Print styles */
@media print {
    .header,
    .input-section,
    .loading-section,
    .error-section,
    .footer,
    .results-actions,
    .tab-navigation {
        display: none !important;
    }
    
    .results-section {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .tab-pane {
        display: block !important;
        page-break-before: always;
    }
    
    .tab-pane:first-child {
        page-break-before: avoid;
    }
    
    .content-card {
        break-inside: avoid;
        margin-bottom: 20px;
    }
}