/* ========================================
   DashPro - Global Design System
   ======================================== */

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

/* ========================================
   CSS Reset
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

ul, ol {
    list-style: none;
}

img, svg {
    display: block;
    max-width: 100%;
}

button, input, textarea, select {
    font: inherit;
    color: inherit;
}

a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: var(--transition);
}

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

/* ========================================
   CSS Variables
   ======================================== */
:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --text-muted: #6e6e73;
    --accent-primary: #6C5CE7;
    --accent-secondary: #A29BFE;
    --accent-gradient: linear-gradient(135deg, #6C5CE7 0%, #a855f7 50%, #06b6d4 100%);
    --success: #34C759;
    --danger: #FF3B30;
    --warning: #FF9500;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Border Radius */
    --border-radius: 16px;
    --border-radius-sm: 10px;
    --border-radius-xs: 8px;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Shadows */
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(108, 92, 231, 0.15);

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

/* ========================================
   Base Typography
   ======================================== */
body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1 { font-size: 32px; font-weight: 700; line-height: 1.2; margin-bottom: 8px; }
h2 { font-size: 24px; font-weight: 600; line-height: 1.3; margin-bottom: 8px; }
h3 { font-size: 20px; font-weight: 600; line-height: 1.3; margin-bottom: 6px; }
h4 { font-size: 18px; font-weight: 600; line-height: 1.4; margin-bottom: 4px; }
h5 { font-size: 16px; font-weight: 500; line-height: 1.4; margin-bottom: 4px; }
h6 { font-size: 14px; font-weight: 500; line-height: 1.4; margin-bottom: 4px; }

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
}

/* ========================================
   Custom Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) var(--bg-primary);
}

/* ========================================
   Selection
   ======================================== */
::selection {
    background: rgba(108, 92, 231, 0.3);
    color: white;
}

::-moz-selection {
    background: rgba(108, 92, 231, 0.3);
    color: white;
}

/* ========================================
   Utility Classes
   ======================================== */

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Flexbox */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }

/* Grid */
.grid { display: grid; }

/* Gap */
.gap-xs { gap: 4px; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.gap-xl { gap: 32px; }

/* Padding */
.p-xs { padding: 4px; }
.p-sm { padding: 8px; }
.p-md { padding: 16px; }
.p-lg { padding: 24px; }
.p-xl { padding: 32px; }
.px-sm { padding-left: 8px; padding-right: 8px; }
.px-md { padding-left: 16px; padding-right: 16px; }
.px-lg { padding-left: 24px; padding-right: 24px; }
.py-sm { padding-top: 8px; padding-bottom: 8px; }
.py-md { padding-top: 16px; padding-bottom: 16px; }
.py-lg { padding-top: 24px; padding-bottom: 24px; }

/* Margin */
.m-sm { margin: 8px; }
.m-md { margin: 16px; }
.m-lg { margin: 24px; }
.m-xl { margin: 32px; }
.mt-xs { margin-top: 4px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mt-xl { margin-top: 32px; }
.mb-xs { margin-bottom: 4px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.mb-xl { margin-bottom: 32px; }
.ml-sm { margin-left: 8px; }
.ml-md { margin-left: 16px; }
.mr-sm { margin-right: 8px; }
.mr-md { margin-right: 16px; }
.mx-auto { margin-left: auto; margin-right: auto; }

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

/* Text Sizes */
.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }
.text-md { font-size: 15px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 24px; }
.text-2xl { font-size: 32px; }

/* Text Colors */
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

/* Font Weights */
.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Sizing */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* Display */
.hidden { display: none; }
.visible { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* Truncate */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

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

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

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

@keyframes fadeOut {
    to { opacity: 0; transform: translateY(10px); }
}

/* Animation Classes */
.animate-fadeIn {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

.animate-slideUp {
    opacity: 0;
    animation: slideUp 0.5s ease forwards;
}

.animate-slideDown {
    opacity: 0;
    animation: slideDown 0.3s ease forwards;
}

.animate-slideInLeft {
    opacity: 0;
    animation: slideInLeft 0.4s ease forwards;
}

.animate-scaleIn {
    opacity: 0;
    animation: scaleIn 0.3s ease forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Staggered animation delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ========================================
   Glass Effect
   ======================================== */
.glass {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
    user-select: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

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

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: rgba(255, 59, 48, 0.15);
    color: var(--danger);
    border: 1px solid rgba(255, 59, 48, 0.2);
}

.btn-danger:hover {
    background: rgba(255, 59, 48, 0.25);
}

.btn-success {
    background: rgba(52, 199, 89, 0.15);
    color: var(--success);
    border: 1px solid rgba(52, 199, 89, 0.2);
}

.btn-success:hover {
    background: rgba(52, 199, 89, 0.25);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--border-radius-xs);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   Badges
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.badge-success {
    background: rgba(52, 199, 89, 0.15);
    color: var(--success);
}

.badge-danger {
    background: rgba(255, 59, 48, 0.15);
    color: var(--danger);
}

.badge-warning {
    background: rgba(255, 149, 0, 0.15);
    color: var(--warning);
}

.badge-info {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-secondary);
}

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

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

.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-xs);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

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

textarea.form-input {
    min-height: 80px;
    resize: vertical;
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2386868b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
}

/* ========================================
   Card
   ======================================== */
.card {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    background: var(--bg-card-hover);
    transform: scale(1.01);
    box-shadow: var(--shadow-card);
}

.card-static {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 24px;
}

/* ========================================
   Toast Notifications
   ======================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: var(--border-radius-sm);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(30, 30, 40, 0.9);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-size: 14px;
    animation: slideUp 0.3s ease;
    box-shadow: var(--shadow-card);
    min-width: 280px;
    pointer-events: all;
}

.toast-success {
    border-left: 3px solid var(--success);
}

.toast-error {
    border-left: 3px solid var(--danger);
}

.toast-warning {
    border-left: 3px solid var(--warning);
}

.toast.removing {
    animation: fadeOut 0.3s ease forwards;
}

/* ========================================
   Gradient Text
   ======================================== */
.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   Divider
   ======================================== */
.divider {
    height: 1px;
    background: var(--glass-border);
    margin: 16px 0;
}
