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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    overflow-x: hidden;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    position: relative;
    z-index: 1;
}

/* Background */
body {
    background-color: #0a0e17; /* Deep blue background */
    background-image: none;
}

/* Theme Variables */
:root {
    /* Color Palette */
    --primary: #6c63ff;
    --primary-dark: #564fc9;
    --primary-light: #8a84ff;
    --secondary: #2d3748;
    --dark: #1a202c;
    --light: #f7fafc;
    --accent: #9f7aea;
    --space: #0f172a;
    --star: #e2e8f0;
    
    /* Theme Colors */
    --nebula-blue: #4cc9f0;
    --warp-purple: #7b2cbf;
    --energy-yellow: #f9c74f;
    --star-white: #f8f9fa;
    --deep-space: #0a0e17;
    
    /* UI Colors */
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    
    /* Typography */
    --font-primary: 'Roboto', sans-serif;
    --font-heading: 'Orbitron', sans-serif;
    --font-mono: 'Courier New', monospace;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition: 250ms ease-in-out;
    --transition-slow: 400ms ease-in-out;
}

/* Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    color: var(--light);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #0a0e17 0%, #1a1a2e 100%);
    background-attachment: fixed;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Stars background */
body::before {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.6;
    animation: floatParticle linear infinite;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--light);
}

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

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

a:hover {
    color: var(--primary-light);
    text-decoration: none;
}

p {
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

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

.btn-outline:hover {
    background-color: rgba(108, 99, 255, 0.1);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

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

.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--light);
    background-color: rgba(255, 255, 255, 0.05);
    background-clip: padding-box;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    color: var(--light);
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(108, 99, 255, 0.25);
}

/* Cards */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: rgba(26, 32, 44, 0.7);
    background-clip: border-box;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    backdrop-filter: blur(5px);
    overflow: hidden;
}

/* Blue Space Theme */
.blue-space-theme {
    color: #e2e8f0;
}

/* Ensure main content takes up available space */
main {
    flex: 1;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Add some space at the bottom of the page */
main > .container {
    padding-bottom: 3rem;
}

.blue-space-theme .header {
    background: rgba(10, 14, 23, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(76, 201, 240, 0.2);
}

.blue-space-theme .nav-links a {
    color: #e2e8f0;
    transition: color 0.3s ease;
}

.blue-space-theme .nav-links a:hover,
.blue-space-theme .nav-links a.active {
    color: var(--nebula-blue);
}

.blue-space-theme .btn-primary {
    background: var(--nebula-blue);
    color: var(--dark);
    border: none;
    transition: all 0.3s ease;
}

.blue-space-theme .btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 201, 240, 0.4);
}

.blue-space-theme .footer {
    background: rgba(10, 14, 23, 0.9);
    border-top: 1px solid rgba(76, 201, 240, 0.2);
}

/* Stars Animation */
@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.blue-space-theme::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(1px 1px at 10% 20%, white, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 20% 30%, white, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 15% 70%, white, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 25% 60%, white, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 35% 50%, white, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 45% 40%, white, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 55% 30%, white, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 65% 20%, white, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 75% 10%, white, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 85% 90%, white, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 100px 100px;
    opacity: 0.3;
    z-index: -1;
    animation: twinkle 5s infinite;
}

.card-header {
    padding: 1rem 1.25rem;
    margin-bottom: 0;
    background-color: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-body {
    flex: 1 1 auto;
    padding: 1.25rem;
}

.card-footer {
    padding: 0.75rem 1.25rem;
    background-color: rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Alerts */
.alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
}

.alert-success {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}

.alert-danger {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

.alert-warning {
    color: #664d03;
    background-color: #fff3cd;
    border-color: #ffecb5;
}

.alert-info {
    color: #055160;
    background-color: #cff4fc;
    border-color: #b6effb;
}

/* Utilities */
.container {
    width: 100%;
    padding-right: 1rem;
    padding-left: 1rem;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Responsive Helpers */
.hidden { display: none !important; }

@media (max-width: 767.98px) {
    .hidden-sm { display: none !important; }
}

@media (min-width: 768px) and (max-width: 1023.98px) {
    .hidden-md { display: none !important; }
}

@media (min-width: 1024px) {
    .hidden-lg { display: none !important; }
}

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

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

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

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

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