/* assets/css/style.css */
:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #818CF8;
    --secondary: #10B981;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --bg-primary: #F8FAFC;
    --bg-secondary: #FFFFFF;
    --bg-sidebar: #FFFFFF;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-light: #94A3B8;
    --border-color: #E2E8F0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
    --sidebar-width: 280px;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* APP LAYOUT */
#app {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 0;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    font-size: 28px;
}

.sidebar-close {
    display: block;
    cursor: pointer;
    font-size: 24px;
    color: var(--text-secondary);
    padding: 4px;
}

.sidebar-close:hover {
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav ul li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    border-left: 3px solid transparent;
}

.sidebar-nav ul li a:hover {
    background: var(--bg-primary);
    color: var(--primary);
}

.sidebar-nav ul li a.active {
    background: var(--bg-primary);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-nav ul li a i {
    width: 20px;
    text-align: center;
    font-size: 18px;
}

.sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 24px;
}

.sidebar-user {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-primary);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.username {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-balance {
    display: flex;
    gap: 8px;
    font-size: 12px;
    flex-wrap: wrap;
}

.balance-usd {
    color: var(--success);
    font-weight: 600;
}

.balance-coins {
    color: var(--warning);
    font-weight: 600;
}

.logout-btn {
    color: var(--danger);
    text-decoration: none;
    font-size: 18px;
    padding: 8px;
    transition: var(--transition);
    flex-shrink: 0;
}

.logout-btn:hover {
    transform: scale(1.1);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    margin-left: 0;
    transition: margin-left 0.3s ease;
}

/* ==================== HEADER ==================== */
.header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-btn {
    display: block;
    cursor: pointer;
    font-size: 24px;
    color: var(--text-secondary);
    padding: 4px 8px;
    background: none;
    border: none;
}

.menu-btn:hover {
    color: var(--primary);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.header-logo i {
    font-size: 24px;
}

.header-logo span {
    display: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.header-balance {
    display: flex;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
}

.deposit-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.deposit-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.deposit-btn span {
    display: none;
}

.login-btn, .register-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    white-space: nowrap;
}

.login-btn {
    color: var(--primary);
    background: transparent;
}

.login-btn:hover {
    background: var(--bg-primary);
}

.register-btn {
    background: var(--primary);
    color: white;
}

.register-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ==================== PAGE CONTENT ==================== */
.page-content {
    flex: 1;
    padding: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ==================== FLASH MESSAGES ==================== */
.flash-message {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    animation: slideDown 0.4s ease;
    width: 100%;
}

.flash-success {
    background: #D1FAE5;
    color: #065F46;
    border-left: 4px solid var(--success);
}

.flash-error {
    background: #FEE2E2;
    color: #991B1B;
    border-left: 4px solid var(--danger);
}

.flash-warning {
    background: #FEF3C7;
    color: #92400E;
    border-left: 4px solid var(--warning);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== AUTH PAGES ==================== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - var(--header-height) - 80px);
    padding: 20px;
    width: 100%;
}

.auth-card {
    background: var(--bg-secondary);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 440px;
    width: 100%;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.auth-card:hover {
    box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 12px;
    background: rgba(79, 70, 229, 0.1);
    padding: 16px;
    border-radius: 50%;
}

.auth-header h2 {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 700;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

.auth-form .form-group {
    position: relative;
    margin-bottom: 22px;
}

.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.auth-form input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    background: white;
}

.auth-form .form-icon {
    position: absolute;
    left: 16px;
    top: 42px;
    color: var(--text-light);
    font-size: 18px;
    transition: var(--transition);
}

.auth-form input:focus + .form-icon,
.auth-form input:focus ~ .form-icon {
    color: var(--primary);
}

.form-help {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 6px;
    padding-left: 4px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0;
    padding: 0 4px;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.checkbox-label a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border-radius: var(--radius-sm);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.auth-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.auth-footer a:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 16px 20px;
    margin-top: auto;
    flex-shrink: 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-content p {
    font-size: 14px;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.footer-links a:hover {
    color: var(--primary);
}

/* ==================== MODAL ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    margin: 0;
}

.modal-close {
    cursor: pointer;
    font-size: 28px;
    color: var(--text-light);
    transition: var(--transition);
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
}

.contact-options {
    display: flex;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.contact-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 140px;
}

.telegram-btn {
    background: #0088CC;
    color: white;
}

.telegram-btn:hover {
    background: #006699;
    transform: translateY(-2px);
}

.whatsapp-btn {
    background: #25D366;
    color: white;
}

.whatsapp-btn:hover {
    background: #1DA851;
    transform: translateY(-2px);
}

.contact-note {
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
}

.contact-note i {
    color: var(--primary);
}

/* ==================== SIDEBAR TOGGLE ==================== */
.sidebar-toggle {
    display: none;
}

/* ==================== DESKTOP (768px and up) ==================== */
@media (min-width: 768px) {
    .sidebar {
        position: sticky;
        top: 0;
        left: 0;
        height: 100vh;
        box-shadow: none;
        width: var(--sidebar-width);
        flex-shrink: 0;
    }
    
    .sidebar-close {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        width: calc(100% - var(--sidebar-width));
    }
    
    .menu-btn {
        display: none !important;
    }
    
    .header-logo span {
        display: inline;
    }
    
    .deposit-btn span {
        display: inline;
    }
    
    .header-balance {
        font-size: 14px;
    }
    
    .page-content {
        padding: 24px 32px;
    }
}

/* ==================== TABLET (768px to 1024px) ==================== */
@media (min-width: 768px) and (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        width: calc(100% - 240px);
    }
}

/* ==================== MOBILE (up to 767px) ==================== */
@media (max-width: 767px) {
    .sidebar {
        width: 85%;
        max-width: 320px;
    }
    
    .header {
        padding: 0 16px;
    }
    
    .header-balance {
        font-size: 12px;
        padding: 4px 10px;
        flex-direction: column;
        gap: 2px;
        align-items: flex-end;
    }
    
    .deposit-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .deposit-btn span {
        display: none;
    }
    
    .page-content {
        padding: 16px;
    }
    
    .auth-card {
        padding: 24px 20px;
        margin: 10px;
    }
    
    .auth-header h2 {
        font-size: 24px;
    }
    
    .auth-header i {
        font-size: 36px;
        padding: 12px;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .auth-form input {
        font-size: 15px;
        padding: 11px 14px 11px 40px;
    }
    
    .auth-form .form-icon {
        left: 14px;
        top: 39px;
        font-size: 16px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .contact-options {
        flex-direction: column;
    }
    
    .contact-btn {
        min-width: auto;
    }
}

/* ==================== DESKTOP LARGE (1200px and up) ==================== */
@media (min-width: 1200px) {
    .page-content {
        padding: 32px 40px;
    }
    
    .auth-card {
        padding: 48px;
        max-width: 480px;
    }
}

/* ==================== UTILITY CLASSES ==================== */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.mt-10 { margin-top: 10px; }
.mb-10 { margin-bottom: 10px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-12 { gap: 12px; }
.gap-8 { gap: 8px; }
.w-100 { width: 100%; }

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}