/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1DB954;
    --primary-dark: #1ed760;
    --secondary: #191414;
    --background: #121212;
    --surface: #181818;
    --surface-light: #282828;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --success: #1DB954;
    --error: #e91429;
    --warning: #ffa500;
    --border: #333333;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Container & Layout */
.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--secondary);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    padding: 2rem 0;
    box-shadow: 2px 0 10px var(--shadow);
}

.logo {
    padding: 0 2rem 3rem;
    border-bottom: 1px solid var(--border);
}

.logo i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-right: 1rem;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.nav-menu {
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item i {
    font-size: 1.25rem;
    margin-right: 1rem;
    width: 24px;
}

.nav-item span {
    font-size: 1rem;
}

.nav-item:hover {
    background: var(--surface);
    color: var(--text-primary);
    border-left-color: var(--primary);
}

.nav-item.active {
    background: var(--surface);
    color: var(--primary);
    border-left-color: var(--primary);
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 3rem;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-header h2 i {
    color: var(--primary);
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px var(--shadow);
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card h3 i {
    color: var(--primary);
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group label i {
    color: var(--primary);
}

.input-field {
    width: 100%;
    padding: 1rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.1);
}

.help-text {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.4);
}

.btn-secondary {
    background: var(--surface-light);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--surface-light);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.info-item i {
    font-size: 2rem;
    color: var(--primary);
}

.info-item strong {
    display: block;
    margin-bottom: 0.25rem;
}

.info-item p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Result Box */
.result-box {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--surface-light);
    border-radius: 8px;
    border: 1px solid var(--border);
    display: none;
}

.result-box.show {
    display: block;
}

.result-box.success {
    background: rgba(29, 185, 84, 0.1);
    border-color: var(--success);
}

.result-box.error {
    background: rgba(233, 20, 41, 0.1);
    border-color: var(--error);
}

/* Table */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.search-box {
    position: relative;
    flex: 1;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--surface-light);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

tbody tr:hover {
    background: var(--surface-light);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem !important;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(29, 185, 84, 0.2);
    color: var(--success);
}

.badge-warning {
    background: rgba(255, 165, 0, 0.2);
    color: var(--warning);
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--surface-light);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px var(--shadow);
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.stat-icon.green {
    background: rgba(29, 185, 84, 0.2);
    color: var(--success);
}

.stat-icon.orange {
    background: rgba(255, 165, 0, 0.2);
    color: var(--warning);
}

.stat-icon.purple {
    background: rgba(147, 51, 234, 0.2);
    color: #9333ea;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Results Grid */
.results-grid {
    display: grid;
    gap: 1rem;
}

.result-item {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(29, 185, 84, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 1rem;
    color: var(--text-primary);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1001;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    min-width: 300px;
    box-shadow: 0 4px 12px var(--shadow);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--error);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 80px;
    }

    .sidebar .logo h1,
    .sidebar .nav-item span {
        display: none;
    }

    .main-content {
        margin-left: 80px;
        padding: 1.5rem;
    }

    .action-buttons {
        flex-direction: column;
    }
}
