/* ==========================================================================
   Pelagic Capital Tokocrypto Dashboard Styles
   Modern Dark Mode, Glassmorphism, and Premium Neon Accents
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-base: #060713;
    --bg-surface: rgba(15, 17, 39, 0.7);
    --bg-surface-solid: #0d0f28;
    --bg-card: rgba(22, 25, 54, 0.45);
    --bg-input: rgba(10, 11, 28, 0.8);
    
    --border-light: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(147, 51, 234, 0.3);
    
    --color-primary: #9d4edd;
    --color-primary-glow: rgba(157, 78, 221, 0.4);
    --color-secondary: #00f2fe;
    
    --color-success: #00e676;
    --color-success-bg: rgba(0, 230, 118, 0.1);
    --color-danger: #ff1744;
    --color-danger-bg: rgba(255, 23, 68, 0.1);
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-inverse: #060713;
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-neon: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-glow: 0 0 15px var(--color-primary-glow);
}

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

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(30, 20, 70, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(10, 40, 70, 0.25) 0%, transparent 45%);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* ==========================================================================
   Layout & Grid
   ========================================================================== */

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

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(10, 12, 33, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition-smooth);
}

.sidebar-header {
    padding: 2.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-logo {
    font-weight: 800;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

.sidebar-logo span {
    font-weight: 400;
    color: var(--text-muted);
}

.sidebar-menu {
    list-style: none;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.menu-item a:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.menu-item.active a {
    color: var(--text-main);
    background: linear-gradient(90deg, rgba(157, 78, 221, 0.25) 0%, rgba(157, 78, 221, 0.05) 100%);
    border-left: 3px solid var(--color-primary);
    box-shadow: var(--shadow-glow);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

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

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7b2cbf, #3c096c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-main);
    border: 1px solid var(--border-light);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

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

.logout-btn {
    width: 100%;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 0.6rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    margin-left: 280px;
    padding: 2.5rem 3rem;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* ==========================================================================
   Dashboard Components & UI Cards
   ========================================================================== */

/* Glass Cards */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: var(--shadow-neon);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: rgba(157, 78, 221, 0.25);
    box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.45);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Stats Dashboard Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

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

.stat-desc span {
    font-weight: 600;
}

.text-success { color: var(--color-success) !important; }
.text-danger { color: var(--color-danger) !important; }

/* Large Chart Layout */
.dashboard-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .dashboard-row {
        grid-template-columns: 1fr;
    }
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }
    .sidebar {
        transform: translateX(-100%);
    }
}

/* ==========================================================================
   Buttons and Forms
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), #7b2cbf);
    color: var(--text-main);
    box-shadow: 0 4px 15px rgba(157, 78, 221, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(157, 78, 221, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

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

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

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    border-radius: 10px;
    transition: var(--transition-smooth);
    font-family: var(--font-sans);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(157, 78, 221, 0.25);
}

/* ==========================================================================
   Data Tables
   ========================================================================== */

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    padding: 1rem 1.25rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
    letter-spacing: 0.5px;
}

.custom-table td {
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.95rem;
    vertical-align: middle;
}

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

.custom-table tr {
    transition: var(--transition-smooth);
}

.custom-table tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}

/* Indicators and Statuses */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    text-transform: uppercase;
}

.badge-success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid rgba(0, 230, 118, 0.2);
}

.badge-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border: 1px solid rgba(255, 23, 68, 0.2);
}

.badge-neutral {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-light);
}

/* Technical Indicator Badges */
.badge-bullish {
    background: rgba(0, 230, 118, 0.15);
    color: var(--color-success);
    border: 1px solid var(--color-success);
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.2);
    font-weight: 700;
}

.badge-bearish {
    background: rgba(255, 23, 68, 0.15);
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
    box-shadow: 0 0 10px rgba(255, 23, 68, 0.2);
    font-weight: 700;
}

/* ==========================================================================
   Watchlist & AJAX Loaders
   ========================================================================== */

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

.watchlist-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.wl-symbol {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.wl-price-container {
    display: flex;
    flex-direction: column;
}

.wl-price {
    font-size: 1.65rem;
    font-weight: 700;
    font-family: monospace;
}

.wl-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-light);
    padding-top: 0.75rem;
    font-size: 0.85rem;
}

/* Skeleton Loading Animation */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 25%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.03) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 0.5rem;
}

.skeleton-price {
    height: 2.2rem;
    width: 80%;
    margin-bottom: 0.5rem;
}

.skeleton-badge {
    height: 1.2rem;
    width: 40%;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ==========================================================================
   Login Glassmorphism Screen
   ========================================================================== */

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
    background-image: 
        radial-gradient(circle at 30% 30%, rgba(157, 78, 221, 0.25) 0%, transparent 40%),
        radial-gradient(circle at 70% 70%, rgba(0, 242, 254, 0.15) 0%, transparent 45%);
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 3rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-muted);
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.alert-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border: 1px solid rgba(255, 23, 68, 0.2);
}

.alert-success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid rgba(0, 230, 118, 0.2);
}

/* Pagination custom style */
.pagination-container {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Form Grid Custom */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

/* Modal Custom styling or toggle details */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.text-right {
    text-align: right;
}

.mb-4 { margin-bottom: 1rem !important; }
.mb-6 { margin-bottom: 1.5rem !important; }
.mt-4 { margin-top: 1rem !important; }
.mt-6 { margin-top: 1.5rem !important; }
.mr-2 { margin-right: 0.5rem !important; }

/* Tooltips & Helpers */
.tooltip-trigger {
    cursor: help;
    border-bottom: 1px dashed var(--text-muted);
}
