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

:root {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #242b3d;
    --bg-hover: #2d3548;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --accent-primary: #667eea;
    --accent-secondary: #764ba2;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --border: #2d3548;
    --shadow: rgba(0, 0, 0, 0.5);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--accent-gradient);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    z-index: 1;
}

.login-box {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 48px;
    box-shadow: 0 20px 60px var(--shadow);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
}

.login-header small {
    color: var(--text-secondary);
    font-size: 13px;
    opacity: 0.7;
}

/* Admin Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    box-shadow: 4px 0 24px var(--shadow);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

.sidebar-header {
    padding: 32px 24px;
    background: var(--accent-gradient);
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.sidebar-header p {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    font-weight: 500;
    position: relative;
}

.sidebar-nav a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: var(--accent-gradient);
    transition: width 0.3s;
    opacity: 0.1;
}

.sidebar-nav a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-left-color: var(--accent-primary);
}

.sidebar-nav a:hover::before {
    width: 100%;
}

.sidebar-nav a.active {
    background: var(--bg-hover);
    border-left-color: var(--accent-primary);
    color: var(--text-primary);
    font-weight: 600;
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-tertiary);
}

.user-info {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-hover);
    border-radius: 8px;
}

.user-info strong {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.user-info small {
    color: var(--text-secondary);
    font-size: 12px;
}

.btn-logout {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--danger);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-logout:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 32px;
    background: var(--bg-primary);
}

.content-wrapper {
    max-width: 1400px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border);
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    color: var(--text-secondary);
    margin-top: 8px;
    font-size: 15px;
}

/* Forms */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.form-control, select.form-control, textarea.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.form-control:focus, select.form-control:focus, textarea.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.image-input-group {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.image-input-group .form-control {
    flex: 1;
}

.image-toggle-btn {
    padding: 12px 16px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
}

.image-toggle-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.hidden {
    display: none !important;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

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

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

.btn-success:hover {
    background: #059669;
}

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

.btn-warning:hover {
    background: #d97706;
}

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

.btn-danger:hover {
    background: #dc2626;
}

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

.btn-info:hover {
    background: #2563eb;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 4px 24px var(--shadow);
    border: 1px solid var(--border);
}

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

.table thead {
    background: var(--bg-tertiary);
}

.table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.table tbody tr {
    transition: background 0.2s;
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

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

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    border-left: 4px solid;
    animation: slideInDown 0.3s ease-out;
}

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

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-left-color: var(--success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-left-color: var(--danger);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
    border-left-color: var(--info);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    overflow-y: auto;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

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

.modal-content {
    background: var(--bg-secondary);
    margin: 50px auto;
    padding: 32px;
    border-radius: 16px;
    max-width: 600px;
    position: relative;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px var(--shadow);
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h2 {
    color: var(--text-primary);
    margin-bottom: 24px;
    font-size: 24px;
    font-weight: 700;
}

.close {
    position: absolute;
    right: 24px;
    top: 24px;
    font-size: 32px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.close:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 24px var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px var(--shadow);
    border-color: var(--accent-primary);
}

.stat-icon {
    font-size: 48px;
    filter: drop-shadow(0 4px 8px rgba(102, 126, 234, 0.3));
}

.stat-info h3 {
    font-size: 36px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
    font-weight: 700;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

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

.dashboard-card {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 24px var(--shadow);
    border: 1px solid var(--border);
}

.dashboard-card h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    font-weight: 700;
}

.list-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-item {
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.list-item:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s;
    position: relative;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.3s;
}

.tab-btn.active {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.tab-btn.active::after {
    width: 100%;
}

.tab-content {
    display: none;
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 24px var(--shadow);
    border: 1px solid var(--border);
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.sources-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.source-item {
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 3px solid var(--accent-primary);
    border: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    .main-content {
        margin-left: 240px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }

    .main-content {
        margin-left: 200px;
        padding: 20px;
    }

    .stats-grid, .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* Selection */
::selection {
    background: var(--accent-primary);
    color: white;
}
