/* AstroHub Web App - Dark Mystical Theme */
:root {
    --bg-primary: #0A0A1A;
    --bg-secondary: #12122A;
    --bg-card: #1A1A35;
    --bg-card-hover: #252550;
    
    --primary: #6B46C1;
    --primary-light: #9F7AEA;
    --primary-dark: #553C9A;
    
    --accent-gold: #F6AD55;
    --accent-purple: #9F7AEA;
    
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    
    --border-color: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(107, 70, 193, 0.3);
    
    --success: #48BB78;
    --error: #F56565;
    --warning: #ED8936;
    
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px rgba(107, 70, 193, 0.3);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Layout */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.app-header {
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: bold;
}

.logo-icon {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 8px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    transition: all 0.3s;
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
    background: var(--bg-card);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.lang-toggle:hover {
    background: var(--bg-card-hover);
}

#auth-nav, #user-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

#user-nav {
    display: none;
}

#user-name {
    color: var(--text-secondary);
    font-weight: 500;
}

#user-credits {
    background: linear-gradient(135deg, var(--accent-gold), #DD6B20);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Main Content */
#main-content {
    flex: 1;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
    border-radius: var(--radius-xl);
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(107, 70, 193, 0.15), transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(246, 173, 85, 0.1), transparent 50%);
    pointer-events: none;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.feature-card.primary {
    background: linear-gradient(135deg, var(--primary-dark), var(--bg-card));
    border-color: var(--primary);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.feature-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--success);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

/* CTA Section */
.cta-section {
    margin: 40px 0;
}

.cta-card {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-xl);
    padding: 40px;
    text-align: center;
}

.cta-card h2 {
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.cta-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(107, 70, 193, 0.4);
}

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

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Page Header */
.page-header {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-secondary);
}

/* Section Title */
.section-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-left: 10px;
    border-left: 3px solid var(--primary);
}

/* Auth Pages */
.auth-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 40px 20px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
}

.auth-header h2 {
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary-light);
    text-decoration: none;
}

/* Form Styles */
.styled-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.2);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Form Card */
.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 30px;
}

.form-card h3 {
    margin-bottom: 24px;
    text-align: center;
}

/* Feature Intro */
.feature-intro {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-xl);
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
}

.intro-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.feature-intro h2 {
    margin-bottom: 12px;
}

.feature-intro p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Info Cards */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 30px;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
}

.info-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.info-card h4 {
    margin-bottom: 4px;
}

.info-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Login Prompt */
.login-prompt {
    background: rgba(107, 70, 193, 0.1);
    border: 1px dashed var(--primary);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    margin: 16px 0;
}

.login-prompt p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Credit Info */
.credit-info {
    text-align: center;
    padding: 12px;
    color: var(--text-secondary);
}

.credit-cost {
    background: rgba(246, 173, 85, 0.2);
    color: var(--accent-gold);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

/* Loading & Error States */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.loading-state.personalized {
    background: linear-gradient(135deg, rgba(107, 70, 193, 0.1), rgba(246, 173, 85, 0.05));
    border-radius: var(--radius-lg);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.spinner.gold {
    border-top-color: var(--accent-gold);
}

.spinner.small {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

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

.loading-state p {
    color: var(--text-secondary);
}

.error-state {
    text-align: center;
    padding: 40px;
}

.error-state span {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
}

.error-state p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.error-message {
    color: var(--error);
    font-size: 0.9rem;
    text-align: center;
}

/* Result Container */
.result-container {
    margin-top: 30px;
}

/* Messages */
.message {
    padding: 12px;
    border-radius: var(--radius-md);
    margin-top: 16px;
    text-align: center;
}

.message.success {
    background: rgba(72, 187, 120, 0.2);
    color: var(--success);
}

.message.error {
    background: rgba(245, 101, 101, 0.2);
    color: var(--error);
}

/* Footer */
.app-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 30px 20px;
    text-align: center;
    margin-top: auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary-light);
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .nav-links {
        display: none;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .auth-card {
        padding: 30px 20px;
    }
}
