/* =========================
   GLOBAL COLOR SYSTEM
   TwiStar Design System
   ========================= */
:root {
    /* Core Colors */
    --bg-main: #000030;
    --bg-panel: #0000C8;
    --bg-panel-dark: #00008f;
    
    /* Brand Colors */
    --primary: #9600E1;
    --primary-dark: #6d00a6;
    --primary-light: #b300ff;
    --secondary: #CC9CDF;
    
    /* Status Colors */
    --danger: #C80000;
    --danger-dark: #a00000;
    --success: #00a060;
    --success-light: #c6f6d5;
    --warning: #ffc107;
    
    /* Accent */
    --accent: #FFD700;
    
    /* Text Colors */
    --text-main: #ffffff;
    --text-muted: #CC9CDF;
    --text-dark: #000030;
    
    /* UI Colors */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.2);
    --shadow-color: rgba(0, 0, 0, 0.5);
    --overlay: rgba(0, 0, 48, 0.9);
}

/* =========================
   GLOBAL RESET
   ========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    background: linear-gradient(160deg, var(--bg-main), #00001a);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Page wrapper for sticky footer */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-wrapper main,
main.container {
    flex: 1;
}

/* =========================
   TYPOGRAPHY
   ========================= */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    margin-bottom: 0.5em;
}

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

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s, opacity 0.2s;
}

a:hover {
    color: var(--secondary);
    opacity: 0.9;
}

/* =========================
   LAYOUT CONTAINERS
   ========================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.app {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* =========================
   NAVIGATION BAR
   ========================= */
.navbar {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    height: 50px;
    box-shadow: 0 4px 20px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: none;
    width: 100%;
    padding: 0 24px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
    text-decoration: none;
}

.logo:hover {
    color: var(--accent);
    opacity: 0.9;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: var(--text-main);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background 0.2s, transform 0.2s;
}

.nav-menu a:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* =========================
   SIDEBAR
   ========================= */
.sidebar {
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    padding: 1.5rem;
    box-shadow: 4px 0 20px var(--shadow-color);
}

.sidebar h1, .sidebar h2 {
    margin: 0 0 1.5rem;
    font-size: 1.4rem;
    color: var(--accent);
}

.sidebar .nav a,
.nav a {
    display: block;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.3rem;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s, transform 0.2s;
}

.sidebar .nav a:hover,
.nav a:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

/* =========================
   MAIN CONTENT AREA
   ========================= */
.main {
    padding: 2rem;
}

main.container {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* =========================
   CARDS & PANELS
   ========================= */
.card, .content {
    background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-dark));
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 12px 30px var(--shadow-color);
}

.card h2, .content h1 {
    margin-top: 0;
    color: var(--accent);
}

.card h3, .content h2 {
    color: var(--secondary);
}

.content p {
    margin-bottom: 1rem;
    color: var(--text-main);
}

.content ul, .content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.content li {
    margin-bottom: 0.5rem;
}

/* =========================
   BUTTONS
   ========================= */
.btn, .button {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}

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

.btn-primary:hover, .button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(150, 0, 225, 0.6);
}

.btn-secondary, .button.secondary {
    background: var(--bg-panel);
    color: var(--text-main);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover, .button.secondary:hover {
    background: var(--bg-panel-dark);
    transform: translateY(-1px);
}

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

.btn-danger:hover, .button.danger:hover {
    background: var(--danger-dark);
    box-shadow: 0 0 0 3px rgba(200, 0, 0, 0.4);
}

.btn-success, .button.success {
    background: var(--success);
    color: white;
}

.btn-success:hover, .button.success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 160, 96, 0.4);
}

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

/* =========================
   FORM ELEMENTS
   ========================= */
.form-control, input[type="text"], input[type="email"], 
input[type="password"], textarea, select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(0, 0, 48, 0.5);
    color: var(--text-main);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(150, 0, 225, 0.3);
}

.form-control::placeholder, input::placeholder, textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

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

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

/* =========================
   BADGES & TAGS
   ========================= */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 6px;
    background: var(--accent);
    color: var(--text-dark);
    font-weight: 700;
}

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

.badge.secondary {
    background: var(--secondary);
    color: var(--text-dark);
}

/* =========================
   ALERTS & MESSAGES
   ========================= */
.alert, .message {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-success, .message.success {
    background: rgba(0, 160, 96, 0.2);
    border: 1px solid var(--success);
    color: #90EE90;
}

.alert-danger, .message.error {
    background: rgba(200, 0, 0, 0.2);
    border: 1px solid var(--danger);
    color: #ff6b6b;
}

.alert-warning, .message.warning {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid var(--warning);
    color: var(--warning);
}

.alert-info, .message.info {
    background: rgba(0, 0, 200, 0.2);
    border: 1px solid var(--bg-panel);
    color: var(--secondary);
}

/* =========================
   TABLES
   ========================= */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: rgba(150, 0, 225, 0.2);
    color: var(--accent);
    font-weight: 600;
}

tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* =========================
   FOOTER
   ========================= */
.footer {
    background: linear-gradient(180deg, var(--primary-dark), #4a0070);
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: auto;
    flex-shrink: 0;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

/* =========================
   STATUS INDICATORS
   ========================= */
.status-card {
    background: rgba(0, 0, 48, 0.5);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.status-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.status-item:last-child {
    border-bottom: none;
}

.status-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 14px;
    font-weight: bold;
}

.status-icon.success {
    background: var(--success);
    color: white;
}

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

.status-icon.warning {
    background: var(--warning);
    color: var(--text-dark);
}

/* =========================
   UTILITY CLASSES
   ========================= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-primary { color: var(--primary); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* =========================
   SCROLLBAR STYLING
   ========================= */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* =========================
   RESPONSIVE DESIGN
   ========================= */
@media (max-width: 768px) {
    .app {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        width: 260px;
        z-index: 200;
        transition: left 0.3s;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .navbar .container {
        flex-wrap: wrap;
    }
    
    .nav-menu {
        gap: 1rem;
        font-size: 0.9rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}
