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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #ff9500 0%, #ff6b00 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

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

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff9500 0%, #ff6b00 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Error Message */
.error-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff9500 0%, #ff6b00 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.error-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 400px;
}

.error-content i {
    width: 48px;
    height: 48px;
    color: #e74c3c;
    margin-bottom: 20px;
}

.error-content h3 {
    margin-bottom: 10px;
    color: #333;
}

.retry-btn {
    margin-top: 20px;
    padding: 12px 24px;
    background: #ff9500;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.retry-btn:hover {
    background: #ff6b00;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.logo p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.header-stats {
    display: flex;
    gap: 30px;
}

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

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Main Content */
.main-content {
    padding: 40px 0;
}

/* Summary Section */
.summary-section {
    margin-bottom: 40px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.summary-card {
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ff9500 0%, #ff6b00 100%);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
}

.card-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.card-content p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Charts Section */
.charts-section {
    margin-bottom: 40px;
}

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

.chart-container.full-width {
    grid-column: 1 / -1;
}

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

.chart-container h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-weight: 600;
}

.chart-container canvas {
    max-height: 300px;
}

/* Timeline Section */
.timeline-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 40px;
}

.timeline-header {
    padding: 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.timeline-header h3 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 5px;
}

.timeline-header p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.timeline-wrapper {
    overflow-x: auto;
}

.timeline-table {
    width: 100%;
    border-collapse: collapse;
}

.timeline-table th,
.timeline-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.timeline-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    position: sticky;
    top: 0;
}

.timeline-table tbody tr {
    transition: background-color 0.3s ease;
}

.timeline-table tbody tr:hover {
    background: #f8f9fa;
}

/* Table Section */
.table-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.table-header {
    padding: 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.table-header h3 {
    color: #2c3e50;
    font-weight: 600;
}

.table-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-container i {
    position: absolute;
    left: 12px;
    color: #7f8c8d;
    width: 16px;
    height: 16px;
}

#search-input {
    padding: 10px 15px 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    width: 250px;
    outline: none;
    transition: border-color 0.3s ease;
}

#search-input:focus {
    border-color: #ff9500;
}

#region-filter {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
}

.table-wrapper {
    overflow-x: auto;
}

.holdings-table {
    width: 100%;
    border-collapse: collapse;
}

.holdings-table th,
.holdings-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.holdings-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    position: sticky;
    top: 0;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease;
}

.holdings-table th:hover {
    background: #e9ecef;
}

.holdings-table th.sortable {
    position: relative;
}

.holdings-table th i {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    opacity: 0.5;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.holdings-table th.sort-asc i {
    opacity: 1;
    transform: translateY(-50%) rotate(0deg);
}

.holdings-table th.sort-desc i {
    opacity: 1;
    transform: translateY(-50%) rotate(180deg);
}

.holdings-table tbody tr {
    transition: background-color 0.3s ease;
}

.holdings-table tbody tr:hover {
    background: #f8f9fa;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-reported, .status-partially-sold {
    background: #fff3cd;
    color: #856404;
}

.status-unconfirmed, .status-sold {
    background: #f8d7da;
    color: #721c24;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .header-stats {
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }

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

    .chart-container canvas {
        max-height: 250px;
    }

    .table-header {
        flex-direction: column;
        align-items: stretch;
    }

    .table-controls {
        flex-direction: column;
        gap: 10px;
    }

    #search-input {
        width: 100%;
    }

    .holdings-table {
        font-size: 0.9rem;
    }

    .holdings-table th,
    .holdings-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

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

    .logo h1 {
        font-size: 1.5rem;
    }

    .chart-container {
        padding: 20px 15px;
    }

    .table-header {
        padding: 20px 15px;
    }
}

/* Animation for data loading */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}
