/* ImpHyve Cosmic UI System - Modern Astronomical Design */
/* Creative Commons Attribution-NonCommercial-NoDerivatives (CC BY-NC-ND) */

:root {
    /* Cosmic Color Palette */
    --cosmic-primary: #ff1744;
    --cosmic-primary-dark: #d50000;
    --cosmic-primary-light: #ff5983;
    --cosmic-secondary: #00bcd4;
    --cosmic-secondary-dark: #0097a7;
    --cosmic-accent: #ffc107;
    --cosmic-accent-dark: #ff8f00;
    
    /* Space Background Colors */
    --space-bg-primary: #0a0a0a;
    --space-bg-secondary: #1a1a1a;
    --space-bg-tertiary: #2d2d2d;
    --space-bg-card: rgba(26, 26, 26, 0.9);
    --space-bg-overlay: rgba(0, 0, 0, 0.8);
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #666666;
    --text-accent: #ff1744;
    
    /* Border Colors */
    --border-primary: #333333;
    --border-secondary: #444444;
    --border-accent: #ff1744;
    
    /* Shadow Colors */
    --shadow-cosmic: 0 0 20px rgba(255, 23, 68, 0.3);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-button: 0 5px 15px rgba(255, 23, 68, 0.3);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Typography */
    --font-family-primary: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-family-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

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

/* Cosmic Background Effects */
.cosmic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.cosmic-stars {
    position: absolute;
    width: 100%;
    height: 100%;
    background: transparent;
}

.cosmic-star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: cosmic-twinkle 3s infinite;
}

.cosmic-star:nth-child(odd) {
    animation-duration: 2s;
}

.cosmic-star:nth-child(even) {
    animation-duration: 4s;
}

@keyframes cosmic-twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Cosmic Nebula Effect */
.cosmic-nebula {
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, 
        rgba(255, 23, 68, 0.1) 0%, 
        rgba(0, 188, 212, 0.05) 25%, 
        transparent 50%);
    animation: cosmic-drift 20s linear infinite;
    opacity: 0.3;
}

@keyframes cosmic-drift {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Typography System */
.text-cosmic-primary { color: var(--cosmic-primary); }
.text-cosmic-secondary { color: var(--cosmic-secondary); }
.text-cosmic-accent { color: var(--cosmic-accent); }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }

.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; }

/* Layout System */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--space-md);
}

.grid {
    display: grid;
    gap: var(--space-md);
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }

/* Spacing Utilities */
.p-0 { padding: 0; }
.p-1 { padding: var(--space-xs); }
.p-2 { padding: var(--space-sm); }
.p-3 { padding: var(--space-md); }
.p-4 { padding: var(--space-lg); }
.p-5 { padding: var(--space-xl); }

.m-0 { margin: 0; }
.m-1 { margin: var(--space-xs); }
.m-2 { margin: var(--space-sm); }
.m-3 { margin: var(--space-md); }
.m-4 { margin: var(--space-lg); }
.m-5 { margin: var(--space-xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }
.mt-5 { margin-top: var(--space-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }
.mb-5 { margin-bottom: var(--space-xl); }

/* Button System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: var(--radius-lg);
    font-family: var(--font-family-primary);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    user-select: none;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--cosmic-primary), var(--cosmic-primary-dark));
    color: white;
    box-shadow: var(--shadow-button);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 23, 68, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--cosmic-primary);
    border: 2px solid var(--cosmic-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--cosmic-primary);
    color: white;
    transform: translateY(-2px);
}

.btn-accent {
    background: linear-gradient(135deg, var(--cosmic-accent), var(--cosmic-accent-dark));
    color: var(--space-bg-primary);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.3);
}

.btn-accent:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 193, 7, 0.4);
}

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

.btn-ghost:hover:not(:disabled) {
    background: var(--space-bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-secondary);
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.875rem;
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1.125rem;
}

.btn-xl {
    padding: var(--space-lg) var(--space-2xl);
    font-size: 1.25rem;
}

/* Card System */
.card {
    background: var(--space-bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-secondary);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    transform: translateY(-2px);
}

.card-header {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-primary);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

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

.card-body {
    margin-bottom: var(--space-md);
}

.card-footer {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-primary);
}

/* Form System */
.form-group {
    margin-bottom: var(--space-lg);
}

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

.form-input {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    background: var(--space-bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-family-primary);
    font-size: 1rem;
    transition: all var(--transition-normal);
}

.form-input:focus {
    outline: none;
    border-color: var(--cosmic-primary);
    box-shadow: 0 0 0 3px rgba(255, 23, 68, 0.1);
}

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

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

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.form-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    background: var(--space-bg-secondary);
    cursor: pointer;
}

.form-radio {
    width: 1.25rem;
    height: 1.25rem;
    border: 1px solid var(--border-primary);
    border-radius: 50%;
    background: var(--space-bg-secondary);
    cursor: pointer;
}

/* Navigation System */
.navbar {
    background: var(--space-bg-card);
    border-bottom: 1px solid var(--border-primary);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cosmic-primary);
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-normal);
    position: relative;
}

.nav-link:hover {
    color: var(--cosmic-primary);
}

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--cosmic-primary);
    border-radius: 1px;
}

/* Modal System */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--space-bg-overlay);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--space-bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-2xl);
    padding: var(--space-2xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-card);
}

.modal-header {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-primary);
}

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

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-normal);
}

.modal-close:hover {
    color: var(--cosmic-primary);
}

/* Alert System */
.alert {
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    border: 1px solid;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border-primary);
    border-top-color: var(--cosmic-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-sm);
    }
    
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .navbar-nav {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-content {
        margin: var(--space-sm);
        padding: var(--space-lg);
    }
}

@media (max-width: 480px) {
    .text-4xl { font-size: 2rem; }
    .text-5xl { font-size: 2.5rem; }
    
    .card {
        padding: var(--space-md);
    }
    
    .btn-lg {
        padding: var(--space-md) var(--space-lg);
        font-size: 1rem;
    }
}

/* Animation Utilities */
.animate-fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.animate-slide-up {
    animation: slideUp 0.5s ease-out;
}

.animate-slide-down {
    animation: slideDown 0.5s ease-out;
}

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

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

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

/* Utility Classes */
.hidden { display: none; }
.visible { display: block; }
.invisible { visibility: hidden; }
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-100 { opacity: 1; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: 9999px; }

.shadow { box-shadow: var(--shadow-card); }
.shadow-lg { box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6); }

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

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

.select-none { user-select: none; }
.select-text { user-select: text; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-scroll { overflow: scroll; }
