/**
 * Cicada Investment Platform - Professional UI Design
 * Inspired by Binance, RedotPay, and Bybit
 * Modern Dark Theme with Professional Trading Interface
 */

/* ============================================
   CSS VARIABLES - PROFESSIONAL THEME
============================================ */

:root {
    /* Dark Theme Colors - Binance Inspired */
    --bg-primary: #0B0E11;
    --bg-secondary: #1E2329;
    --bg-tertiary: #2B3139;
    --bg-hover: #2C3240;
    --bg-card: #181A20;
    --bg-modal: #1E2329;
    
    /* Trading Platform Colors */
    --color-buy: #0ECB81;
    --color-sell: #F6465D;
    --color-warning: #FCD535;
    --color-info: #3772FF;
    
    /* Accent Colors */
    --primary: #F0B90B;
    --primary-hover: #FCD535;
    --secondary: #3772FF;
    --accent-blue: #1E3A8A;
    --accent-purple: #7C3AED;
    
    /* Text Colors */
    --text-primary: #EAECEF;
    --text-secondary: #B7BDC6;
    --text-muted: #848E9C;
    --text-disabled: #5E6673;
    
    /* Border & Divider */
    --border-color: #2B3139;
    --divider-color: #2B3139;
    
    /* Status Colors */
    --success: #0ECB81;
    --danger: #F6465D;
    --warning: #FCD535;
    --info: #3772FF;
    
    /* Glass Morphism */
    --glass-bg: rgba(30, 35, 41, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.6);
    
    /* Neon Glow */
    --glow-primary: 0 0 20px rgba(240, 185, 11, 0.3);
    --glow-success: 0 0 20px rgba(14, 203, 129, 0.3);
    --glow-danger: 0 0 20px rgba(246, 70, 93, 0.3);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Roboto Mono', monospace;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Light Theme Override (Optional) */
[data-theme="light"] {
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F5;
    --bg-tertiary: #FAFAFA;
    --bg-hover: #F0F0F0;
    --bg-card: #FFFFFF;
    --text-primary: #181A20;
    --text-secondary: #474D57;
    --text-muted: #848E9C;
    --border-color: #E6E8EA;
}

/* ============================================
   RESET & BASE STYLES
============================================ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Custom Scrollbar - Binance Style */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Selection */
::selection {
    background: var(--primary);
    color: var(--bg-primary);
}

/* ============================================
   TYPOGRAPHY
============================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

/* ============================================
   BUTTONS - TRADING PLATFORM STYLE
============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Primary Button - Buy/Long */
.btn-primary {
    background: var(--color-buy);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: #0bb870;
    box-shadow: var(--glow-success);
    transform: translateY(-2px);
}

/* Secondary Button - Sell/Short */
.btn-secondary {
    background: var(--color-sell);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: #d93a52;
    box-shadow: var(--glow-danger);
    transform: translateY(-2px);
}

/* Accent Button - Premium/Gold */
.btn-accent {
    background: linear-gradient(135deg, var(--primary), #FCD535);
    color: var(--bg-primary);
    font-weight: 600;
    box-shadow: var(--glow-primary);
}

.btn-accent:hover {
    box-shadow: 0 0 30px rgba(240, 185, 11, 0.5);
    transform: translateY(-2px);
}

/* Outline Button */
.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Button Sizes */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   CARDS - MODERN DESIGN
============================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

/* Glass Card Effect */
.card-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

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

/* Card Body */
.card-body {
    color: var(--text-secondary);
}

/* Card Footer */
.card-footer {
    padding-top: var(--spacing-md);
    margin-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

/* ============================================
   TRADING STATS CARD
============================================ */

.stats-card {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
}

.stats-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
    margin: 0.5rem 0;
}

.stats-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-change {
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.stats-change.positive {
    color: var(--success);
}

.stats-change.negative {
    color: var(--danger);
}

/* ============================================
   FORMS - PROFESSIONAL STYLE
============================================ */

.form-group {
    margin-bottom: var(--spacing-lg);
}

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

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 3px rgba(240, 185, 11, 0.1);
}

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

/* Input with Icon */
.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.input-group .form-input {
    padding-right: 2.5rem;
}

/* ============================================
   BADGES & TAGS
============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(14, 203, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(14, 203, 129, 0.3);
}

.badge-danger {
    background: rgba(246, 70, 93, 0.15);
    color: var(--danger);
    border: 1px solid rgba(246, 70, 93, 0.3);
}

.badge-warning {
    background: rgba(252, 213, 53, 0.15);
    color: var(--warning);
    border: 1px solid rgba(252, 213, 53, 0.3);
}

.badge-info {
    background: rgba(55, 114, 255, 0.15);
    color: var(--info);
    border: 1px solid rgba(55, 114, 255, 0.3);
}

.badge-primary {
    background: rgba(240, 185, 11, 0.15);
    color: var(--primary);
    border: 1px solid rgba(240, 185, 11, 0.3);
}

/* ============================================
   TABLES - TRADING STYLE
============================================ */

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.table th {
    padding: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

/* ============================================
   MODALS - MODERN OVERLAY
============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 14, 17, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: var(--spacing-lg);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.25rem;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
}

/* ============================================
   LOADING & SPINNERS
============================================ */

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 14, 17, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
    z-index: 10000;
}

/* ============================================
   ALERTS & NOTIFICATIONS
============================================ */

.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid;
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.alert-success {
    background: rgba(14, 203, 129, 0.1);
    border-color: rgba(14, 203, 129, 0.3);
    color: var(--success);
}

.alert-danger {
    background: rgba(246, 70, 93, 0.1);
    border-color: rgba(246, 70, 93, 0.3);
    color: var(--danger);
}

.alert-warning {
    background: rgba(252, 213, 53, 0.1);
    border-color: rgba(252, 213, 53, 0.3);
    color: var(--warning);
}

.alert-info {
    background: rgba(55, 114, 255, 0.1);
    border-color: rgba(55, 114, 255, 0.3);
    color: var(--info);
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    min-width: 300px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-xl);
    z-index: 10001;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   UTILITY CLASSES
============================================ */

/* Text Colors */
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.text-primary { color: var(--primary) !important; }
.text-muted { color: var(--text-muted) !important; }

/* Background Colors */
.bg-primary { background: var(--bg-primary) !important; }
.bg-secondary { background: var(--bg-secondary) !important; }
.bg-card { background: var(--bg-card) !important; }

/* Flex Utilities */
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

/* Spacing */
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

/* Text Alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* ============================================
   RESPONSIVE BREAKPOINTS
============================================ */

@media (max-width: 1024px) {
    html { font-size: 15px; }
}

@media (max-width: 768px) {
    html { font-size: 14px; }
    
    .card {
        padding: var(--spacing-md);
    }
    
    .modal-content {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 95vh;
    }
    
    .toast {
        right: 1rem;
        left: 1rem;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    html { font-size: 13px; }
}
