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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #ffffff;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

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

h1 {
    color: #008B8B;
    font-size: 2.5em;
    font-weight: 600;
}

h2 {
    color: #008B8B;
    font-size: 1.8em;
    margin-bottom: 20px;
    margin-top: 30px;
}

/* Modal Styles */
.modal {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.file-label {
    display: block;
    padding: 15px;
    border: 2px dashed #008B8B;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.file-label:hover {
    background-color: #f0f8f8;
}

.file-label input[type="file"] {
    display: none;
}

.file-info {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

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

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

.btn-primary {
    background-color: #008B8B;
    color: white;
}

.btn-primary:hover {
    background-color: #006666;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Error Message */
.error-message {
    color: #dc3545;
    margin-top: 10px;
    padding: 10px;
    background-color: #f8d7da;
    border-radius: 4px;
    display: none;
}

.error-message.show {
    display: block;
}

/* Upload Section */
.upload-section {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
}

/* Upload Progress Indicator */
.upload-progress {
    margin-top: 20px;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    border: 1px solid #008B8B;
}

.progress-bar-container {
    width: 100%;
    height: 25px;
    background-color: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #008B8B 0%, #00b3b3 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 12px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 14px;
    color: #333;
}

.progress-info span:first-child {
    font-weight: 500;
}

.progress-info span:last-child {
    font-weight: 600;
    color: #008B8B;
}

.progress-details {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.progress-actions {
    margin-top: 15px;
    text-align: center;
}

.btn-cancel {
    background-color: #dc3545;
    color: white;
    padding: 8px 20px;
    font-size: 14px;
}

.btn-cancel:hover {
    background-color: #c82333;
}

.btn-cancel:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Data Table */
.data-section {
    margin-bottom: 30px;
}

.table-container {
    overflow-x: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background-color: #008B8B;
    color: white;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

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

.data-table tbody tr:hover {
    background-color: #e9ecef;
}

/* Visualization Section */
.visualization-section {
    margin-top: 40px;
    margin-bottom: 30px;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
}

.chart-wrapper {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.chart-wrapper h3 {
    color: #008B8B;
    margin-bottom: 15px;
    text-align: center;
}

.chart-container {
    position: relative;
    height: 400px;
}

/* AI Section */
.ai-section {
    margin-bottom: 30px;
}

/* AI Provider Selector */
.ai-provider-selector {
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.ai-provider-selector label {
    font-weight: 600;
    color: #333;
}

.provider-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 200px;
    background-color: white;
}

.provider-select:disabled {
    background-color: #f0f0f0;
    cursor: not-allowed;
}

.ai-content {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    border: 2px solid #008B8B;
}

.ai-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.ai-loading p {
    margin: 0;
}

.ai-result {
    color: #333;
}

.ai-analysis-text {
    line-height: 1.8;
}

.ai-analysis-text h3 {
    color: #008B8B;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.ai-analysis-text p {
    margin-bottom: 10px;
}

.ai-analysis-text li {
    margin-bottom: 5px;
    margin-left: 20px;
}

.ai-meta-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    color: #666;
}

.ai-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    text-align: center;
}

.ai-actions .btn:disabled {
    background-color: #ccc;
    color: #666;
    cursor: not-allowed;
    opacity: 0.6;
}

.ai-actions .btn:disabled:hover {
    background-color: #ccc;
    transform: none;
}

.ai-analysis-text pre {
    background-color: #fff;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    border: 1px solid #ddd;
}

.ai-placeholder-content {
    color: #666;
}

.ai-placeholder-content p {
    margin-bottom: 15px;
}

.ai-placeholder-content code {
    background-color: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.ai-note {
    margin-top: 20px;
    padding: 15px;
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    font-size: 0.9em;
}

.ai-error {
    padding: 20px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.5em;
    }

    .charts-container {
        grid-template-columns: 1fr;
    }

    .analytics-cards {
        grid-template-columns: 1fr;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
    }

    #logoutBtn {
        margin-top: 10px;
    }
}

