/* ========================================
   CODESAFE GLOBAL THEME
   Dark Glassmorphism Design System
   ======================================== */

/* ========================================
   CSS VARIABLES - LOCKED COLOR PALETTE
   ======================================== */
:root {
    --bg-dark: #0b0f1a;
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.12);
    --accent-primary: #7c7cff;
    --accent-glow: rgba(124, 124, 255, 0.35);
    --text-primary: #e5e7eb;
    --text-muted: #9ca3af;
    --error-color: #ef4444;
    --success-color: #22c55e;
    --blur-amount: 14px;
    --border-radius-card: 18px;
    --border-radius-input: 12px;
    --transition-smooth: 0.25s ease;
}

/* ========================================
   GLOBAL RESET & BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 
                 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 
                 'Noto Color Emoji', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
}

/* ========================================
   ANIMATED DEPTH BACKGROUND
   ======================================== */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at 30% 20%, 
        rgba(124, 124, 255, 0.08) 0%, 
        transparent 50%
    );
    animation: float 35s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at 70% 80%, 
        rgba(124, 124, 255, 0.05) 0%, 
        transparent 50%
    );
    animation: float 40s ease-in-out infinite reverse;
    pointer-events: none;
    z-index: 0;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

/* Ensure content is above animated background */
body > * {
    position: relative;
    z-index: 1;
}

/* ========================================
   GLOBAL GLASSMORPHISM UTILITIES
   ======================================== */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-card);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
}

.glass-input {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-input);
    color: var(--text-primary);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    transition: all var(--transition-smooth);
}

.glass-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

/* ========================================
   GLOBAL BUTTON STYLES
   ======================================== */
.btn-primary {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: var(--border-radius-input);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-smooth);
    box-shadow: 0 4px 16px var(--accent-glow);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: #9d9dff;
    box-shadow: 0 6px 20px rgba(124, 124, 255, 0.5);
    transform: translateY(-2px);
}

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

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    padding: 0.875rem 1.75rem;
    border-radius: var(--border-radius-input);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-smooth);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-danger {
    background: var(--error-color);
    color: white;
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: var(--border-radius-input);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-smooth);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.45);
    transform: translateY(-2px);
}

/* ========================================
   GLOBAL ALERT STYLES
   ======================================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-input);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    animation: slideIn 0.4s ease-out;
}

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

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success-color);
}

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

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

/* ========================================
   GLOBAL FORM STYLES
   ======================================== */
.form-group {
    margin-bottom: 1.25rem;
}

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

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.875rem 1.125rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-input);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-smooth);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

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

.form-hint {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* ========================================
   GLOBAL TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
}

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

p {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
}

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

a:hover {
    color: #9d9dff;
}

/* ========================================
   GLOBAL ANIMATIONS
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}

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

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

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.35rem; }
}

@media (max-width: 480px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}
