/* ========================================
   FONTS
   ======================================== */

/* Custom Heading Font - TASAOrbiterDeck */
@font-face {
    font-family: 'TASAOrbiterDeck';
    src: url('../fonts/TASAOrbiterDeck-Medium.otf') format('opentype');
    font-weight: 500;
    font-display: swap;
}

/* Body Font - Montserrat from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

/* ========================================
   CSS VARIABLES - LIGHT THEME (DEFAULT)
   ======================================== */

:root {
    /* Colors - Light Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f0f2f5;
    --bg-card: #ffffff;
    
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    
    --border-color: #e0e0e0;
    --border-light: #f0f0f0;
    
    --accent-primary: #ff9233;
    --accent-hover: #ff7a0f;
    --accent-light: #fff4ec;
    --accent-secondary: #468dff;
    --accent-secondary-hover: #2b75e6;
    
    --success: #34a853;
    --error: #d93025;
    --warning: #fbbc04;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
    
    /* Typography */
    --font-body: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'TASAOrbiterDeck', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Transitions */
    --transition: all 0.3s ease;
}

/* ========================================
   CSS VARIABLES - DARK THEME
   ======================================== */

[data-theme="dark"] {
    /* Colors - Dark Theme */
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --bg-card: #1a1a1a;
    
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-tertiary: #808080;
    
    --border-color: #444444;
    --border-light: #555555;
    
    --accent-primary: #ff9233;
    --accent-hover: #ffaa5c;
    --accent-light: #3d2614;
    --accent-secondary: #468dff;
    --accent-secondary-hover: #6ba3ff;
    
    --success: #4caf50;
    --error: #f44336;
    --warning: #ff9800;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.5);
}

/* ========================================
   GLOBAL STYLES
   ======================================== */

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5em;
}

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

p {
    margin-bottom: 1em;
    color: var(--text-secondary);
}

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

a:hover {
    color: var(--accent-hover);
}

/* ========================================
   THEME TOGGLE BUTTON
   ======================================== */

.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.4em 0.8em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    font-size: 0.9em;
    color: var(--text-secondary);
    transition: var(--transition);
    margin-left: 1em;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.theme-toggle-icon {
    font-size: 1.2em;
}

/* ========================================
   HEADER / NAVIGATION
   ======================================== */

.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1em 2em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1em;
}

.logo {
    height: 40px;
    width: auto;
    display: block;
}

.header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1em;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.user-info a {
    color: var(--text-secondary);
    padding: 0.5em 1em;
    border-radius: 6px;
    transition: var(--transition);
}

.user-info a:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ========================================
   BUTTONS
   ======================================== */

button, .btn, input[type="submit"] {
    font-family: var(--font-body);
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0.75em 1.5em;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

button:hover, .btn:hover, input[type="submit"]:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

button:disabled, .btn:disabled, input[type="submit"]:disabled {
    background: var(--text-tertiary);
    cursor: not-allowed;
    opacity: 0.6;
}

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

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

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

.btn-danger:hover {
    background: #c62828;
}

/* ========================================
   FORMS
   ======================================== */

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    font-family: var(--font-body);
    width: 100%;
    padding: 0.75em;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1em;
    transition: var(--transition);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}

label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1.5em;
}

/* ========================================
   CARDS
   ======================================== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5em;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* ========================================
   MESSAGES & ALERTS
   ======================================== */

.message {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5em;
    margin-bottom: 1.5em;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.error {
    background: var(--error);
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    border: none;
    padding: 1em;
    border-radius: 8px;
}

.success {
    background: var(--success);
    color: white;
    border: none;
    padding: 1em;
    border-radius: 8px;
}

/* ========================================
   TABLES
   ======================================== */

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
}

th {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    text-align: left;
    padding: 1em;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 1em;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

tr:hover {
    background: var(--bg-secondary);
}

/* ========================================
   LOADING SPINNER
   ======================================== */

.loading {
    text-align: center;
    padding: 2em;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1em;
    }
    
    .user-info {
        flex-direction: column;
        width: 100%;
    }
    
    .theme-toggle {
        margin-left: 0;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }
}
