/* C3NGINX - Core Styles */

/* CSS Variables - Dark Theme (default) */
:root {
    --primary: #0a0a0a;
    --surface: #111111;
    --surface-hover: #1a1a1a;
    --border: #2a2a2a;
    --accent: #2ec8c2;
    --accent-hover: #26b0aa;
    --muted: #888888;
    --text: #ffffff;
    --text-secondary: #a0a0a0;
    --error: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
}

/* Light Theme */
[data-theme="light"] {
    --primary: #ffffff;
    --surface: #f8f9fa;
    --surface-hover: #e9ecef;
    --border: #dee2e6;
    --accent: #0d9488;
    --accent-hover: #0f766e;
    --muted: #6c757d;
    --text: #212529;
    --text-secondary: #495057;
    --error: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
}

/* Smooth theme transition */
html {
    transition: background-color 0.3s ease;
}

body, .bg-primary, .bg-surface {
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Base */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Page loader - Shows immediately, hides when ready */
#page-loader {
    position: fixed;
    inset: 0;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

#page-loader .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Main content - Hidden until ready */
#app {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#app.ready {
    opacity: 1;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease forwards;
}

.animate-slideIn {
    animation: slideIn 0.3s ease forwards;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 1rem;
    height: 44px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--surface-hover);
    border-color: var(--muted);
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
}

.btn-ghost:hover:not(:disabled) {
    color: var(--text);
    background: var(--surface);
}

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

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

/* Inputs */
.input {
    width: 100%;
    height: 44px;
    padding: 0 1rem;
    font-size: 0.875rem;
    background: var(--primary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s ease;
}

.input:focus {
    border-color: var(--accent);
}

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

.input-icon {
    padding-left: 2.75rem;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.375rem;
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.badge-info {
    background: rgba(46, 200, 194, 0.1);
    color: var(--accent);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.toast-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.toast-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
    border-radius: 0.375rem;
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Utilities */
.text-accent { color: var(--accent); }
.text-muted { color: var(--muted); }
.text-error { color: var(--error); }
.text-success { color: var(--success); }

.bg-primary { background: var(--primary); }
.bg-surface { background: var(--surface); }

.border-default { border-color: var(--border); }

/* Layout helpers */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
}

@media (min-width: 769px) {
    .hide-desktop { display: none !important; }
}
