/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #2d3748;
    line-height: 1.6;
}

a {
    color: #3b82f6;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #1a202c;
    font-size: 28px;
}

.login-box .subtitle {
    text-align: center;
    color: #718096;
    margin-bottom: 30px;
    font-size: 14px;
}

.login-note {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: #718096;
}

/* Navigation */
.navbar {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-brand a {
    font-size: 20px;
    font-weight: bold;
    color: #1a202c;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    color: #4a5568;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-menu a:hover {
    color: #3b82f6;
    text-decoration: none;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-user span {
    color: #4a5568;
    font-size: 14px;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    min-height: calc(100vh - 120px);
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 32px;
    color: #1a202c;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    text-decoration: none;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-large {
    padding: 12px 24px;
    font-size: 16px;
}

.btn-copy {
    background: #10b981;
    color: white;
    margin-left: 10px;
}

.btn-copy:hover {
    background: #059669;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #1a202c;
}

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chart-container h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #1a202c;
}

.chart-container canvas {
    height: 300px !important;
}

/* Filters */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filters select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f9fafb;
}

th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    font-size: 14px;
}

tr:hover {
    background: #f9fafb;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-secondary {
    background: #e5e7eb;
    color: #374151;
}

.badge.positive {
    background: #d1fae5;
    color: #065f46;
}

.badge.negative {
    background: #fee2e2;
    color: #991b1b;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #1a202c;
}

.close {
    color: #9ca3af;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover {
    color: #4b5563;
}

/* Anomalies */
.anomalies-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-top: 30px;
}

.anomalies-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #1a202c;
}

.anomalies-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.anomaly-item {
    padding: 15px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 4px solid #3b82f6;
}

.anomaly-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.anomaly-date {
    font-weight: 600;
    color: #1a202c;
}

.anomaly-metric {
    text-transform: uppercase;
    font-size: 12px;
    color: #6b7280;
}

.anomaly-website {
    font-size: 13px;
    color: #3b82f6;
}

.anomaly-note {
    color: #4b5563;
    font-size: 14px;
    margin-top: 8px;
}

.anomaly-alert {
    background: #fef3c7;
    border: 2px solid #fbbf24;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.anomaly-alert h3 {
    color: #92400e;
    margin-bottom: 10px;
}

.anomaly-alert p {
    color: #78350f;
    margin-bottom: 15px;
}

/* Images Grid */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.image-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.image-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-info {
    padding: 15px;
}

.image-info h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #1a202c;
    word-break: break-word;
}

.article-link {
    margin: 10px 0;
    padding: 10px;
    background: #f0fdf4;
    border-radius: 4px;
}

.article-link strong {
    display: block;
    margin-bottom: 5px;
    color: #065f46;
    font-size: 12px;
}

.article-link a {
    display: inline-block;
    word-break: break-all;
    font-size: 13px;
    margin-bottom: 5px;
}

.image-note {
    margin: 10px 0;
    padding: 10px;
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
    font-size: 13px;
    color: #78350f;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

/* Text Utilities */
.text-muted {
    color: #6b7280;
}

/* Reports Tabs */
.reports-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    color: #4b5563;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #f9fafb;
}

.tab-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #1a202c;
}

/* History */
.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.history-item:last-child {
    border-bottom: none;
}

.history-date {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 5px;
}

.history-action {
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 5px;
}

.history-note {
    color: #4b5563;
    font-size: 14px;
}

/* Stats Form */
.stats-form-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.stats-form-container h2 {
    font-size: 22px;
    margin-bottom: 20px;
    color: #1a202c;
}

.recent-stats {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.recent-stats h2 {
    font-size: 22px;
    margin-bottom: 20px;
    color: #1a202c;
}

/* Currency Conversion Displays */
.conversion-display {
    margin-top: 5px;
    font-weight: 600;
}

.total-usd-display {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
    font-size: 18px;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
}

.total-usd-display strong {
    font-size: 16px;
}

#totalUsdAmount {
    font-size: 24px;
    font-weight: bold;
    margin-left: 10px;
}

/* Footer */
.footer {
    background: white;
    padding: 20px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    border-top: 1px solid #e5e7eb;
}

/* Responsive */
@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .nav-menu {
        gap: 15px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}
