/* Base Styles & Theme Variables */
:root {
    /* Light Theme Variables */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-tertiary: #6b7280;
    --border-color: #e5e7eb;
    --accent-color: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #dbeafe;
    --accent-lighter: #ebf5ff;
    --green-text: #10b981;
    --red-text: #ef4444;
    --yellow-text: #f59e0b;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --sidebar-shadow: 1px 0 5px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    /* Dark Theme Variables */
    --bg-primary: #1a1a1a;
    --bg-secondary: #242424;
    --bg-tertiary: #2d2d2d;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-tertiary: #6b7280;
    --border-color: #383838;
    --accent-color: #ff7700;
    --accent-hover: #ff8800;
    --accent-light: #4c2b00;
    --accent-lighter: #3a2100;
    --green-text: #34d399;
    --red-text: #f87171;
    --yellow-text: #fbbf24;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    --sidebar-shadow: 1px 0 5px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background-color: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    height: 100vh;
    position: fixed;
    z-index: 999;
    transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
    box-shadow: var(--sidebar-shadow);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    background-color: var(--accent-color);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.logo-text {
    font-weight: bold;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.close-sidebar {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-tertiary);
}

.nav-section {
    padding: 1rem;
}

.nav-title {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    padding: 0 0.5rem;
}

.nav-menu {
    list-style: none;
    margin-bottom: 1.5rem;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-menu li a:hover {
    background-color: var(--bg-tertiary);
}

.nav-menu li a.active {
    background-color: var(--accent-lighter);
    color: var(--accent-color);
}

.help-card {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background-color: var(--accent-lighter);
    padding: 1rem;
    border-radius: 8px;
}

.help-card h3 {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.help-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.help-card button {
    width: 100%;
    background-color: var(--accent-light);
    color: var(--accent-color);
    border: none;
    padding: 0.4rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.help-card button:hover {
    filter: brightness(1.1);
}

/* Main Content Styles */
.main-content {
    flex: 1;
    margin-left: 250px;
    transition: margin-left 0.3s ease;
}

.top-bar {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.top-bar-left {
    display: flex;
    align-items: center;
}

.menu-toggle {
    font-size: 1.25rem;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    margin-right: 1rem;
    display: none;
}

.page-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-toggle {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background-color: var(--bg-tertiary);
}

.notification-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.notification-btn:hover {
    background-color: var(--bg-tertiary);
}

.notification-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background-color: var(--red-text);
    border-radius: 50%;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.avatar {
    width: 32px;
    height: 32px;
    background-color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Dashboard Content Styles */
.dashboard {
    padding: 1rem 1.5rem;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn-primary {
    background-color: var(--accent-color);
    color: white;
    border: none;
}

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

.action-btn-secondary {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.action-btn-secondary:hover {
    background-color: var(--bg-tertiary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background-color: var(--bg-primary);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.stat-card:hover {
    box-shadow: var(--card-shadow);
}

.stat-card-blue {
    background-color: var(--accent-lighter);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stat-details h3 {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.stat-trend {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
}

.trend-up {
    color: var(--green-text);
}

.trend-down {
    color: var(--red-text);
}

.trend-text {
    color: var(--text-tertiary);
    margin-left: 0.25rem;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-blue {
    background-color: var(--accent-light);
    color: var(--accent-color);
}

.card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

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

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-buttons {
    display: flex;
    gap: 0.5rem;
}

.tab-btn {
    background-color: var(--bg-tertiary);
    color: var(--text-tertiary);
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    filter: brightness(1.1);
}

.tab-btn.active {
    background-color: var(--accent-light);
    color: var(--accent-color);
}

.view-all {
    color: var(--accent-color);
    font-size: 0.875rem;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.view-all:hover {
    text-decoration: underline;
}

.card-body {
    padding: 1rem;
}

.chart-container {
    width: 100%;
    height: 300px;
    position: relative;
}

.grid-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

/* Balance info & deposit section */
.balance-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.balance-card {
    background-color: var(--bg-primary);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

.balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.balance-header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
}

.balance-amount {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-primary);
}

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

.deposit-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-btn {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Campaign table */
.campaign-table {
    width: 100%;
    border-collapse: collapse;
}

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

.campaign-table th {
    background-color: var(--bg-secondary);
    color: var(--text-tertiary);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.campaign-table tr:hover td {
    background-color: var(--bg-secondary);
}

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

.campaign-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.campaign-logo {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
    background-color: var(--bg-tertiary);
}

.campaign-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-active {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--green-text);
}

.status-pending {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--yellow-text);
}

.status-paused {
    background-color: rgba(107, 114, 128, 0.1);
    color: var(--text-tertiary);
}

.status-completed {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--accent-color);
}

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

.action-icon {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    background-color: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-icon:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Influencer performance section */
.influencer-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.influencer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 0.75rem;
    background-color: var(--bg-tertiary);
    object-fit: cover;
}

.influencer-info {
    flex: 1;
}

.influencer-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.influencer-metrics {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-primary);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--card-shadow);
}

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

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-tertiary);
    cursor: pointer;
}

.modal-body {
    padding: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-light);
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.btn-cancel {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}

.btn-submit {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}

.payment-info {
    background-color: var(--bg-secondary);
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.payment-info h4 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.crypto-address {
    font-family: monospace;
    background-color: var(--bg-tertiary);
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    word-break: break-all;
}

.note {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.5rem;
}

/* Campaign Form Styles */
.campaign-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group-full {
    grid-column: 1 / 3;
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

.file-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border-color);
    border-radius: 6px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-upload:hover {
    border-color: var(--accent-color);
    background-color: var(--accent-lighter);
}

.file-upload i {
    font-size: 1.5rem;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.file-upload span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.file-upload input {
    display: none;
}

.preview-container {
    display: none;
    margin-top: 1rem;
}

.preview-container.active {
    display: block;
}

.file-preview {
    width: 100%;
    height: 150px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .close-sidebar {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .user-name {
        display: none;
    }
    
    .grid-container {
        grid-template-columns: 1fr;
    }
    
    .campaign-form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group-full {
        grid-column: 1;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .card-buttons {
        display: none;
    }
    
    .campaign-table th:nth-child(3),
    .campaign-table td:nth-child(3) {
        display: none;
    }
}

/* Animation Classes */
.slide-in {
    animation: slideIn 0.3s forwards;
}

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

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.scale-in {
    animation: scaleIn 0.3s forwards;
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}