/* ═══════════════════════════════════════════════════════════════════════════
   COMPONENTS - Buttons, Cards, Forms
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-8);
    border-radius: var(--radius-full);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-sm);
    transition: transform var(--duration-normal) var(--ease-out-back),
                box-shadow var(--duration-normal) var(--ease-out-quart),
                background var(--duration-normal) var(--ease-out-quart);
    will-change: transform;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--duration-normal);
}

.btn:hover::before {
    opacity: 1;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--bg-primary);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-glow);
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-secondary {
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    background: transparent;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    background: rgba(0, 240, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    transition: transform var(--duration-slow) var(--ease-out-expo),
                border-color var(--duration-normal) var(--ease-out-quart),
                box-shadow var(--duration-slow) var(--ease-out-expo);
    will-change: transform;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
                rgba(0, 240, 255, 0.08) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--duration-normal);
    pointer-events: none;
}

.card:hover {
    border-color: var(--border-accent);
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.card:hover::before {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════════════ */

.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    margin-bottom: var(--space-2);
    color: var(--text-secondary);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: var(--space-4);
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    transition: border-color var(--duration-normal),
                box-shadow var(--duration-normal);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1);
    animation: inputFocusGlow 0.3s ease;
}

@keyframes inputFocusGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.4);
    }
    100% {
        box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1);
    }
}

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

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

.form-feedback {
    display: none;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    margin-top: var(--space-4);
    text-align: center;
    animation: feedbackSlideIn 0.3s ease;
}

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

.form-feedback.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent-green);
}

.form-feedback.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════════════════ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    color: var(--accent-primary);
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TAGS
   ═══════════════════════════════════════════════════════════════════════════ */

.tag {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    transition: all var(--duration-fast);
}

.tag:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOADER
   ═══════════════════════════════════════════════════════════════════════════ */

.loader {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: var(--z-loader);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity var(--duration-slow), visibility var(--duration-slow);
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-logo {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: var(--space-8);
    animation: logoGlow 2s ease-in-out infinite;
}

.loader-bar {
    width: 200px;
    height: 3px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.loader-progress {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 0.1s linear;
    border-radius: var(--radius-full);
    position: relative;
}

.loader-progress::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 50%;
    filter: blur(8px);
}

.loader-text {
    margin-top: var(--space-6);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    animation: blink 1s step-end infinite;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CUSTOM CURSOR
   ═══════════════════════════════════════════════════════════════════════════ */

.cursor {
    display: none;
    pointer-events: none;
    z-index: var(--z-cursor);
    /* Performance optimizations */
    will-change: transform;
    contain: layout style;
}

@media (pointer: fine) and (hover: hover) {
    .cursor {
        display: block;
        position: fixed;
        will-change: transform;
    }

    .cursor-ring {
        width: 40px;
        height: 40px;
        border: 1px solid var(--accent-primary);
        border-radius: 50%;
        transition: width var(--duration-normal) var(--ease-out-back),
                    height var(--duration-normal) var(--ease-out-back),
                    background var(--duration-normal),
                    border-width var(--duration-normal);
        mix-blend-mode: difference;
    }

    .cursor-ring.hover {
        width: 60px;
        height: 60px;
        background: rgba(0, 240, 255, 0.15);
        border-width: 2px;
    }

    .cursor-ring.click {
        transform: scale(0.8);
    }

    .cursor-dot {
        width: 6px;
        height: 6px;
        background: var(--accent-primary);
        border-radius: 50%;
        box-shadow: 0 0 10px var(--accent-primary);
    }
}
