/* Regression Tool Specific Styles */

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 40px;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.95;
}

/* Tool Sections */
.tool-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* File Upload Area */
.upload-area {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.upload-area:hover {
    border-color: #1976d2;
    background: #f0f7ff;
}

.upload-area.dragover {
    border-color: #1976d2;
    background: #e3f2fd;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
}

.upload-hint {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

.file-input {
    display: none;
}

/* Data Preview */
#previewTable {
    border-collapse: collapse;
    width: 100%;
    font-size: 14px;
    background: white;
}

#previewTable th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}

#previewTable td {
    padding: 10px 12px;
    border-bottom: 1px solid #dee2e6;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#previewTable tr:nth-child(even) {
    background: #f8f9fa;
}

#previewTable tr:hover {
    background: #e9ecef;
}

/* Pagination */
#pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

#pagination button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

#pagination button:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #1976d2;
    color: #1976d2;
}

#pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#pageInfo {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* Variable Selection */
.variable-selection {
    display: none;
}

.variable-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.variable-list {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    background: #fafafa;
    min-height: 200px;
}

.variable-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

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

.variable-item input[type="radio"],
.variable-item input[type="checkbox"] {
    margin: 0;
}

.variable-item label {
    cursor: pointer;
    font-weight: 500;
    color: #333;
    flex: 1;
}

.variable-item input:checked + label {
    color: #1976d2;
    font-weight: 600;
}

/* Analyze Button */
.analyze-btn {
    width: 100%;
    background: #1976d2;
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analyze-btn:hover:not(:disabled) {
    background: #1565c0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.analyze-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Results Section */
.results-section {
    display: none;
}

.loading {
    text-align: center;
    padding: 40px;
}

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

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

.results-content {
    display: none;
}

/* Results Display */
.results-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    border-left: 4px solid #1976d2;
}

.results-summary h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.model-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.model-info p {
    margin: 5px 0;
    color: #555;
}

.results-table {
    margin-bottom: 25px;
}

.results-table h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.coefficient-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.coefficient-table th {
    background: #1976d2;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.coefficient-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.coefficient-table tr:nth-child(even) {
    background: #f8f9fa;
}

.coefficient-table tr:hover {
    background: #e3f2fd;
}

/* Model Statistics */
.model-statistics {
    margin-bottom: 25px;
}

.model-statistics h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

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

.stat-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-weight: 600;
    color: #555;
}

.stat-value {
    font-weight: 700;
    color: #1976d2;
    font-size: 1.1rem;
}

/* Interpretation */
.interpretation {
    background: #e8f5e8;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    border-left: 4px solid #4caf50;
}

.interpretation h4 {
    color: #2e7d32;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.interpretation-content p {
    margin: 8px 0;
    color: #2e7d32;
    line-height: 1.6;
}

/* Upgrade Notice */
.upgrade-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    color: #856404;
}

/* AI Analysis Button */
.ai-analysis-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .tool-section {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .variable-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-icon {
        font-size: 2.5rem;
    }
    
    .upload-text {
        font-size: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .model-info {
        grid-template-columns: 1fr;
    }
    
    .coefficient-table {
        font-size: 12px;
    }
    
    .coefficient-table th,
    .coefficient-table td {
        padding: 8px;
    }
    
    #pagination {
        flex-direction: column;
        gap: 10px;
    }
    
    #pagination button {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 40px 15px;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .container {
        padding: 10px;
    }
    
    .tool-section {
        padding: 15px;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .upload-area {
        padding: 20px 10px;
    }
    
    .analyze-btn {
        padding: 14px 20px;
        font-size: 1rem;
    }
    
    .ai-analysis-btn {
        padding: 14px 24px;
        font-size: 1rem;
        width: 100%;
        text-align: center;
    }
    
    .coefficient-table {
        font-size: 11px;
    }
    
    .coefficient-table th,
    .coefficient-table td {
        padding: 6px;
    }
}