/* Admin Dashboard Styles */

/* ===== GLOBAL VARIABLES ===== */
:root {
    /* Color Palette */
    --primary-color: #4361ee;
    --primary-hover: #3a56d4;
    --success-color: #2ecc71;
    --success-hover: #27ae60;
    --danger-color: #e74c3c;
    --danger-hover: #c0392b;
    --warning-color: #f39c12;
    --warning-hover: #e67e22;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    
    /* Gray Scale */
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    /* UI Elements */
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --card-border-radius: 10px;
    --input-border-radius: 6px;
    --transition-speed: 0.3s;
}

/* Dark mode colors */
body.dark-mode {
    --primary-color: #4d79ff;
    --primary-hover: #3a6cf4;
    --light-color: #2d2d2d;
    --dark-color: #f8f9fa;
    --gray-100: #333333;
    --gray-200: #444444;
    --gray-300: #555555;
    --gray-700: #cccccc;
    --gray-800: #dddddd;
    --gray-900: #eeeeee;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
}

/* ===== RESET & BASE STYLES ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--gray-100);
    color: var(--dark-color);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

a:hover {
    text-decoration: underline;
}

/* ===== LOGIN SCREEN ===== */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--gray-100);
}

.login-container {
    background-color: white;
    padding: 2.5rem;
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-container h1 {
    margin-bottom: 1.5rem;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-container .form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.login-container label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-align: left;
}

.login-container input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--input-border-radius);
    font-size: 1rem;
    transition: border-color var(--transition-speed);
}

.login-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.login-container .submit-btn {
    width: 100%;
    padding: 0.75rem 1.25rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--input-border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.login-container .submit-btn:hover {
    background-color: var(--primary-hover);
}

.login-container a {
    display: inline-block;
    margin-top: 1rem;
    color: var(--primary-color);
}

.error-text {
    color: var(--danger-color);
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

/* ===== ADMIN PANEL ===== */
.admin-panel {
    background-color: var(--gray-100);
    min-height: 100vh;
}

/* Top Navigation */
.admin-nav {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-logo {
    font-size: 1.2rem;
    font-weight: 600;
}

.admin-nav-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color var(--transition-speed);
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.nav-link.danger {
    background-color: rgba(231, 76, 60, 0.2);
}

.nav-link.danger:hover {
    background-color: rgba(231, 76, 60, 0.3);
}

/* Dashboard Summary */
.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
    max-width: 1400px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

.summary-card {
    background-color: white;
    border-radius: var(--card-border-radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.summary-icon {
    font-size: 1.8rem;
    color: var(--primary-color);
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(67, 97, 238, 0.1);
    border-radius: 50%;
}

.summary-details h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.summary-details p {
    margin: 0.25rem 0 0;
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* Admin Tabs */
.admin-tabs {
    max-width: 1400px;
    margin: 0 auto 2rem;
    padding: 0 1rem;
}

.tab-links {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-300);
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.tab-link {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    color: var(--gray-700);
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-speed);
    white-space: nowrap;
}

.tab-link:hover {
    color: var(--primary-color);
    background-color: rgba(67, 97, 238, 0.05);
}

.tab-link.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    position: relative;
    top: 1px;
    background-color: rgba(67, 97, 238, 0.1);
}

.tab-content {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.tab-content.active {
    display: block;
    opacity: 1;
    pointer-events: all;
}

/* Form Cards */
.form-card {
    background-color: white;
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.form-card-header {
    background-color: var(--gray-100);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.form-card-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-card-body {
    padding: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group.full-width {
    flex-basis: 100%;
    min-width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--input-border-radius);
    background-color: var(--light-color);
    transition: border-color var(--transition-speed);
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.profit-preview {
    padding: 0.75rem;
    background-color: var(--gray-100);
    border-radius: var(--input-border-radius);
    border: 1px dashed var(--gray-400);
    text-align: center;
    font-weight: 600;
    color: var(--success-color);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

/* Recent Activity */
.recent-activity {
    background-color: white;
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
}

.recent-activity h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 0.5rem;
}

.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.activity-details {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.activity-meta {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.activity-price {
    font-weight: 600;
}

.activity-price.purchase {
    color: var(--warning-color);
}

.activity-price.sale {
    color: var(--success-color);
}

/* TikTok Videos Grid */
.tiktok-list-container {
    background-color: white;
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
}

.tiktok-list-container h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 0.5rem;
}

.tiktok-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.tiktok-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--card-border-radius);
    overflow: hidden;
}

.tiktok-preview {
    position: relative;
    background-color: var(--gray-100);
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tiktok-preview .tiktok-logo {
    font-size: 3rem;
    color: #ee1d52;
}

.tiktok-preview .play-overlay {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.5);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.tiktok-preview:hover .play-overlay {
    opacity: 1;
}

.tiktok-preview .play-btn {
    color: white;
    font-size: 3rem;
}

.tiktok-content {
    padding: 1rem;
}

.tiktok-id {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
    font-family: monospace;
}

.tiktok-desc {
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tiktok-date {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.tiktok-actions {
    padding: 0.75rem 1rem;
    background-color: var(--gray-100);
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
}

/* Inventory Table */
.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.inventory-header h2 {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inventory-actions {
    display: flex;
    gap: 0.5rem;
}

.inventory-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    background-color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.filter-btn:hover {
    border-color: var(--primary-color);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.inventory-table-container {
    overflow-x: auto;
    background-color: white;
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 1rem;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.inventory-table th,
.inventory-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.inventory-table th {
    background-color: var(--gray-100);
    font-weight: bold;
}

.inventory-table tr:last-child td {
    border-bottom: none;
}

.inventory-table tr:hover {
    background-color: var(--gray-100);
}

.inventory-table .status-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.inventory-table .status-unsold {
    background-color: var(--warning-color);
    color: white;
}

.inventory-table .status-sold {
    background-color: var(--success-color);
    color: white;
}

.inventory-table .table-actions {
    display: flex;
    gap: 0.5rem;
}

.table-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-speed);
}

.table-action-btn:hover {
    background-color: var(--gray-200);
}

.table-action-btn.edit {
    color: var(--primary-color);
}

.table-action-btn.sell {
    color: var(--success-color);
}

.table-action-btn.delete {
    color: var(--danger-color);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.pagination button {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    background-color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.pagination button:hover {
    border-color: var(--primary-color);
}

.pagination button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

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

.modal.show {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    width: 90%;
    max-width: 500px;
    animation: fadeIn 0.3s ease-out;
}

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

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.close-modal, .close-delete-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 1.5rem;
}

.delete-details {
    padding: 1rem;
    background-color: var(--gray-100);
    border-radius: var(--input-border-radius);
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.25rem;
    border-radius: var(--input-border-radius);
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color var(--transition-speed), transform 0.1s;
}

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

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
}

.secondary-btn {
    background-color: var(--gray-200);
    color: var(--gray-800);
}

.secondary-btn:hover {
    background-color: var(--gray-300);
}

.danger-btn {
    background-color: var(--danger-color);
    color: white;
}

.danger-btn:hover {
    background-color: var(--danger-hover);
}

/* Notification Toast */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--card-border-radius);
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transition: transform 0.3s, opacity 0.3s;
    transform: translateY(100px);
    opacity: 0;
    max-width: 300px;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.error {
    background-color: var(--danger-color);
}

.notification.success {
    background-color: var(--success-color);
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        min-width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .tab-links {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-link {
        flex-shrink: 0;
    }
    
    .inventory-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .inventory-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* Visitor Analytics Tab - Extra Styles */
.visitors-analytics {
    background-color: white;
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.visitors-analytics h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 0.5rem;
}

.analytics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.analytics-card {
    background-color: var(--gray-100);
    border-radius: var(--card-border-radius);
    padding: 1rem;
    text-align: center;
}

.analytics-number {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.analytics-title {
    font-size: 0.9rem;
    color: var(--gray-600);
}

.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 1.5rem;
}

.chart-options {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.chart-filter {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    background-color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.chart-filter.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Referrers table */
.referrers-table {
    width: 100%;
    border-collapse: collapse;
}

.referrers-table th, .referrers-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.referrers-table th {
    font-weight: 600;
    color: var(--gray-700);
}

.referrers-count {
    color: var(--primary-color);
    font-weight: 600;
}

/* User Engagement Section */
.engagement-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.engagement-metric {
    background-color: var(--gray-100);
    border-radius: var(--card-border-radius);
    padding: 1rem;
    text-align: center;
}

.engagement-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.engagement-label {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

/* Dark Mode Overrides */
body.dark-mode .login-container,
body.dark-mode .summary-card,
body.dark-mode .form-card,
body.dark-mode .recent-activity,
body.dark-mode .tiktok-list-container,
body.dark-mode .inventory-table-container,
body.dark-mode .modal-content,
body.dark-mode .visitors-analytics {
    background-color: var(--gray-800);
    color: var(--light-color);
}

body.dark-mode .form-card-header,
body.dark-mode .inventory-table th {
    background-color: var(--gray-900);
    border-color: var(--gray-700);
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea,
body.dark-mode .filter-btn,
body.dark-mode .chart-filter {
    background-color: var(--gray-900);
    border-color: var(--gray-700);
    color: var(--light-color);
}

body.dark-mode .profit-preview,
body.dark-mode .delete-details,
body.dark-mode .tiktok-preview,
body.dark-mode .analytics-card,
body.dark-mode .engagement-metric {
    background-color: var(--gray-900);
    border-color: var(--gray-700);
}

body.dark-mode .activity-meta,
body.dark-mode .activity-price,
body.dark-mode .tiktok-id,
body.dark-mode .tiktok-date,
body.dark-mode .summary-details p,
body.dark-mode .analytics-title,
body.dark-mode .engagement-label {
    color: var(--gray-400);
}

body.dark-mode .pagination button {
    background-color: var(--gray-800);
    border-color: var(--gray-700);
    color: var(--gray-300);
}

body.dark-mode .secondary-btn {
    background-color: var(--gray-700);
    color: var(--gray-300);
}

body.dark-mode .secondary-btn:hover {
    background-color: var(--gray-600);
}

/* File Upload Styling */
.file-upload {
    display: block;
    width: 100%;
    padding: 1rem;
    margin: 1rem 0;
    border: 2px dashed var(--gray-300);
    border-radius: var(--input-border-radius);
    background-color: var(--gray-100);
}

body.dark-mode .file-upload {
    border-color: var(--gray-700);
    background-color: var(--gray-900);
    color: var(--light-color);
}

/* Image Upload Styles */
.image-input-container {
    border: 1px solid var(--gray-300);
    border-radius: var(--input-border-radius);
    overflow: hidden;
}

.image-input-tabs {
    display: flex;
    border-bottom: 1px solid var(--gray-300);
}

.image-tab {
    flex: 1;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.image-tab.active {
    background-color: var(--primary-color);
    color: white;
}

.image-input-content {
    position: relative;
}

.image-input-panel {
    display: none;
    padding: 0.5rem;
}

.image-input-panel.active {
    display: block;
}

.upload-preview {
    margin-top: 0.5rem;
    max-width: 100%;
    height: 150px;
    background-color: var(--gray-100);
    border-radius: var(--input-border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.upload-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

body.dark-mode .image-input-container {
    border-color: var(--gray-700);
}

body.dark-mode .image-input-tabs {
    border-color: var(--gray-700);
}

body.dark-mode .upload-preview {
    background-color: var(--gray-700);
}

/* Chart Container Fixes */
.chart-container {
    position: relative;
    height: 300px;
    max-height: 500px;
    width: 100%;
    margin-bottom: 1.5rem;
    overflow: hidden; /* Prevent overflow */
}

.trend-chart-container, 
.time-chart-container {
    height: 300px;
    max-height: 400px;
    width: 100%;
}

/* Time Period Visitors Chart */
.time-chart-container {
    position: relative;
    height: 300px;
    max-height: 400px;
    overflow: hidden;
}

/* Visitors by State Chart */
.visitors-by-state-chart {
    width: 100%;
    height: 300px;
    max-height: 400px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

/* Analytics Charts */
.analytics-card canvas {
    max-height: 300px;
    width: 100% !important;
}

/* State map visualization container */
.state-map-container {
    position: relative;
    width: 100%;
    height: 400px;
    max-height: 500px;
    margin-bottom: 2rem;
    background-color: var(--gray-100);
    border-radius: 12px;
    overflow: hidden; /* Prevent overflow */
}

body.dark-mode .state-map-container {
    background-color: var(--gray-700);
}item,
body.dark-mode .inventory-table th,
body.dark-mode .inventory-table td,
body.dark-mode .modal-header,
body.dark-mode .tiktok-actions,
body.dark-mode .recent-activity h3,
body.dark-mode .tiktok-list-container h3,
body.dark-mode .visitors-analytics h3,
body.dark-mode .referrers-table th,
body.dark-mode .referrers-table td {
    border-color: var(--gray-700);
}

body.dark-mode .activity-