/* ============================================================
   CoinTrader - Main Stylesheet
   ============================================================ */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1a1d29;
    --sidebar-hover: #252836;
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --text-muted: #9ca3af;
    --border-color: #2d3748;
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: #f8fafc;
    min-height: 100vh;
    margin: 0;
}

/* ============================================================
   Login Screen
   ============================================================ */
.login-screen {
    background: linear-gradient(135deg, #1a1d29 0%, #2d3748 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color), #818cf8);
    padding: 2.5rem 2rem;
    text-align: center;
}

.login-logo {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    backdrop-filter: blur(10px);
}

.login-logo i {
    font-size: 2rem;
    color: white;
}

.login-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin: 0;
}

.login-body {
    padding: 2rem;
}

.login-body .form-floating > .form-control {
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
}

.login-body .form-floating > .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    z-index: 10;
    padding: 0.5rem;
}

.btn-login {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary-color);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.btn-login:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.login-footer {
    text-align: center;
    padding: 1.5rem 2rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.login-footer p {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    padding: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), #818cf8);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.sidebar-brand-text {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-section-title {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 1rem 1.5rem 0.5rem;
}

.sidebar-nav .nav-link {
    color: #e2e8f0;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-size: 0.9rem;
    text-decoration: none;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: white;
}

.sidebar-nav .nav-link.active {
    background: var(--sidebar-hover);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--sidebar-bg);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #10b981, #34d399);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.user-details {
    flex: 1;
}

.user-name {
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
}

.user-role {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ============================================================
   Main Content
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.top-header {
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.content-area {
    padding: 2rem;
}

/* ============================================================
   Cards
   ============================================================ */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.stat-card {
    padding: 1.5rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stat-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

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

/* ============================================================
   Tables
   ============================================================ */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e5e7eb;
}

.table td {
    vertical-align: middle;
    color: #374151;
}

/* ============================================================
   Mobile Toggle
   ============================================================ */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #1f2937;
    padding: 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-toggle {
        display: block;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .content-area {
        padding: 1rem;
    }

    .top-header {
        padding: 1rem;
    }
}

/* ============================================================
   Form Controls
   ============================================================ */
.form-control:disabled {
    background-color: #f9fafb;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ============================================================
   Alerts
   ============================================================ */
.alert {
    border-radius: 10px;
    border: none;
}

/* ============================================================
   Progress Bars
   ============================================================ */
.progress {
    border-radius: 10px;
    background-color: #e5e7eb;
}

.progress-bar {
    border-radius: 10px;
}
