/**
 * DiraCoin - Design Fintech/Crypto Moderne
 * Dashboard & Pages Principales - Mobile First
 */

/* ============================================
   VARIABLES & RESET
   ============================================ */
:root {
    --primary: #00d4aa;
    --primary-dark: #00b894;
    --primary-glow: rgba(0, 212, 170, 0.3);
    --secondary: #6c5ce7;
    --accent: #fd79a8;
    --bg-dark: #0a0e17;
    --bg-card: #131a2b;
    --bg-card-hover: #1a2235;
    --bg-input: #1a2332;
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #8b95a5;
    --text-muted: #5a6270;
    --success: #00d4aa;
    --error: #ff6b6b;
    --warning: #ffc107;
    --info: #74b9ff;
    --gradient-primary: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
    --gradient-card: linear-gradient(145deg, #131a2b 0%, #0d1320 100%);
    --shadow-glow: 0 0 30px rgba(0, 212, 170, 0.15);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50px;
}

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

html {
    font-size: clamp(14px, 3.5vw, 16px);
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 80px; /* Space for bottom nav */
}

/* ============================================
   LAYOUT
   ============================================ */
.app-container {
    max-width: 100%;
    min-height: 100vh;
}

.main-content {
    padding: clamp(12px, 4vw, 24px);
    padding-top: calc(60px + clamp(12px, 3vw, 20px));
    padding-bottom: calc(70px + clamp(12px, 3vw, 20px));
}

@media (min-width: 768px) {
    .main-content {
        padding: 90px 24px 24px;
        max-width: 1200px;
        margin: 0 auto;
    }
    
    body {
        padding-bottom: 0;
    }
}

/* ============================================
   HEADER
   ============================================ */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo img {
    height: 32px;
}

.header-logo span {
    font-weight: 700;
    font-size: 1.1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
}

.header-btn:hover {
    background: var(--bg-card-hover);
    color: var(--primary);
}

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

/* ============================================
   BOTTOM NAVIGATION (Mobile)
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(10, 14, 23, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: all 0.3s;
}

.nav-item svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active svg {
    stroke: var(--primary);
}

.nav-item-center {
    position: relative;
    top: -15px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #00d25b, #00b84d) !important;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 210, 91, 0.4) !important;
    color: #fff !important;
    border: 3px solid var(--bg-primary) !important;
}

.nav-item-center svg {
    width: 28px;
    height: 28px;
    stroke: #fff !important;
}

.nav-item-center span {
    color: #00d25b !important;
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: clamp(12px, 4vw, 24px);
    margin-bottom: clamp(10px, 3vw, 16px);
}

.card-glass {
    background: rgba(19, 26, 43, 0.7);
    backdrop-filter: blur(10px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Balance Card */
.balance-card {
    background: var(--gradient-primary);
    border: none;
    color: #000;
    position: relative;
    overflow: hidden;
}

.balance-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    pointer-events: none;
}

.balance-label {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 8px;
}

.balance-amount {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 4px;
}

.balance-change {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
}

.stat-icon.green { background: rgba(0, 212, 170, 0.15); color: var(--success); }
.stat-icon.blue { background: rgba(116, 185, 255, 0.15); color: var(--info); }
.stat-icon.purple { background: rgba(108, 92, 231, 0.15); color: var(--secondary); }
.stat-icon.orange { background: rgba(255, 193, 7, 0.15); color: var(--warning); }

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}

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

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   QUICK ACTIONS
   ============================================ */
.quick-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.quick-action {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
}

.quick-action:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.quick-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-action-icon.deposit { background: rgba(0, 212, 170, 0.15); color: var(--success); }
.quick-action-icon.withdraw { background: rgba(255, 107, 107, 0.15); color: var(--error); }
.quick-action-icon.trade { background: rgba(108, 92, 231, 0.15); color: var(--secondary); }
.quick-action-icon.team { background: rgba(116, 185, 255, 0.15); color: var(--info); }

.quick-action span {
    font-size: 0.8rem;
    font-weight: 500;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input, .form-select {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238b95a5' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 44px;
}

.form-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    width: 100%;
    background: var(--gradient-primary);
    color: #000;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(0, 212, 170, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

.btn-sm {
    padding: 10px 16px;
    font-size: 0.875rem;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.3);
    color: var(--success);
}

.alert-error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: var(--error);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: var(--warning);
}

.alert-info {
    background: rgba(116, 185, 255, 0.1);
    border: 1px solid rgba(116, 185, 255, 0.3);
    color: var(--info);
}

/* ============================================
   LISTS & TRANSACTIONS
   ============================================ */
.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

.list-item:last-child {
    border-bottom: none;
}

.list-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.list-icon.deposit { background: rgba(0, 212, 170, 0.15); color: var(--success); }
.list-icon.withdraw { background: rgba(255, 107, 107, 0.15); color: var(--error); }
.list-icon.trade { background: rgba(108, 92, 231, 0.15); color: var(--secondary); }
.list-icon.referral { background: rgba(116, 185, 255, 0.15); color: var(--info); }

.list-content {
    flex: 1;
    min-width: 0;
}

.list-title {
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.list-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.list-amount {
    text-align: right;
    font-weight: 600;
}

.list-amount.positive { color: var(--success); }
.list-amount.negative { color: var(--error); }

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-container {
    margin: 16px 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.progress-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.badge-success { background: rgba(0, 212, 170, 0.15); color: var(--success); }
.badge-warning { background: rgba(255, 193, 7, 0.15); color: var(--warning); }
.badge-error { background: rgba(255, 107, 107, 0.15); color: var(--error); }
.badge-info { background: rgba(116, 185, 255, 0.15); color: var(--info); }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.95rem;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-error { color: var(--error) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }

.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }

.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.animate-fade { animation: fadeIn 0.3s ease; }
.animate-slide { animation: slideUp 0.4s ease; }

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.section-link {
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
}

.section-link:hover {
    text-decoration: underline;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ============================================
   FILE UPLOAD
   ============================================ */
.file-upload {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload:hover {
    border-color: var(--primary);
    background: rgba(0, 212, 170, 0.05);
}

.file-upload input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    color: var(--text-muted);
}

.file-upload-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.file-upload-text span {
    color: var(--primary);
    font-weight: 500;
}
