/* Extended Cosmic Theme Styles for Consistency Across All Pages */

/* Force cosmic background on all pages */
html, body {
    margin: 0;
    padding: 0;
    background: #0c0a1a !important;
    background: linear-gradient(135deg, #0c0a1a 0%, #1a1a2e 50%, #16213e 100%) !important;
    color: white !important;
    font-family: 'Inter', sans-serif !important;
    min-height: 100vh;
}

/* Cosmic Hero - Consistent across all pages */
.cosmic-hero {
    position: relative;
    min-height: 100vh;
    width: 100%;
    background: linear-gradient(245deg, #0c0a1a, #1e1a3e, #2a225a, #4a3a9a);
    background-size: 400% 400%;
    animation: cosmicGradient 20s ease infinite;
    overflow: hidden;
}

@keyframes cosmicGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Canvas positioning */
.cosmic-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Content positioning */
.cosmic-hero-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    text-align: center;
}

/* Auth navigation - Consistent positioning */
.cosmic-auth-nav {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    gap: 1rem;
    z-index: 20;
}

.cosmic-auth-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cosmic-auth-btn:hover {
    background: rgba(163, 159, 252, 0.2);
    color: white;
    border-color: rgba(163, 159, 252, 0.3);
    transform: translateY(-1px);
}

.cosmic-auth-btn.signup {
    background: linear-gradient(135deg, #a39ffc 0%, #5865f2 100%);
    color: white;
    border: none;
}

.cosmic-auth-btn.signup:hover {
    background: linear-gradient(135deg, #8b87ff 0%, #4752c4 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(163, 159, 252, 0.3);
}

/* Form Container - Consistent glassmorphism */
.cosmic-form, .auth-form {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 2rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Title Styles */
.cosmic-title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #a39ffc 0%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.cosmic-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

.cosmic-cta {
    font-size: 1rem;
    margin-bottom: 2rem;
    color: rgba(163, 159, 252, 0.9);
    font-weight: 500;
    text-align: center;
}

/* Form Inputs - Consistent styling */
.cosmic-input, .cosmic-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
    box-sizing: border-box;
}

.cosmic-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.cosmic-input:focus, .cosmic-select:focus {
    outline: none;
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
    background: rgba(255, 255, 255, 0.15);
}

.cosmic-select option {
    background: #1f2937;
    color: white;
}

/* Button Styles */
.cosmic-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    white-space: nowrap;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.cosmic-btn:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.cosmic-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

.cosmic-btn-loading {
    position: relative;
    color: transparent;
}

.cosmic-btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

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

/* Secondary Button */
.cosmic-btn-secondary {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    backdrop-filter: blur(10px);
}

.cosmic-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Alert Styles */
.cosmic-alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
}

.cosmic-alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.cosmic-alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.cosmic-alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

/* Text Utilities */
.cosmic-text-muted {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.15s ease;
}

.cosmic-text-muted:hover {
    color: rgba(255, 255, 255, 0.8);
}

.text-cosmic-accent {
    color: #a39ffc;
    text-decoration: none;
    transition: color 0.15s ease;
}

.text-cosmic-accent:hover {
    color: #8b87ff;
    text-decoration: underline;
}

/* Modal Styles */
.cosmic-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.cosmic-modal[style*="display: flex"] {
    display: flex !important;
}

.cosmic-modal-dialog {
    background: rgba(26, 26, 46, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
}

.cosmic-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cosmic-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: white;
}

.cosmic-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: all 0.15s ease;
}

.cosmic-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.cosmic-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 8rem);
}

.cosmic-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Utility Classes */
.cosmic-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Spacing Utilities */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

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

/* Responsive Design */
@media (max-width: 640px) {
    .cosmic-title {
        font-size: 2rem;
    }
    
    .cosmic-subtitle {
        font-size: 1rem;
    }
    
    .cosmic-form, .auth-form {
        padding: 1.5rem;
    }
    
    .cosmic-auth-nav {
        position: relative;
        top: auto;
        right: auto;
        justify-content: center;
        margin-bottom: 2rem;
        padding: 0 1rem;
    }
    
    .cosmic-modal-dialog {
        width: 95%;
        margin: 1rem;
    }
}

/* Ensure consistency with dashboard */
.cosmic-container {
    max-width: 28rem;
    margin: 0 auto;
    padding: 0 1rem;
}

.cosmic-form-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 2rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Form Grid */
.cosmic-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .cosmic-form-grid {
        grid-template-columns: 1fr;
    }
}

/* Ensure all pages have consistent styling */
.cosmic-page {
    min-height: 100vh;
    overflow-x: hidden;
}
