/* Geeky NG Link Builder - Global Styles */

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #818cf8;
    --accent: #10b981;
    --bg: #0a0a0f;
    --bg-elevated: #14141d;
    --bg-card: #1a1a26;
    --bg-input: #1f1f2e;
    --border: #2a2a3a;
    --border-hover: #3a3a4a;
    --text: #f4f4f5;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow: 0 8px 24px rgba(0,0,0,.4);
    --shadow-lg: 0 20px 50px rgba(0,0,0,.5);
    --transition: 200ms cubic-bezier(.4,0,.2,1);
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button, input, textarea, select {
    font-family: inherit;
    font-size: 1rem;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-elevated);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition);
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, .35);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
.btn-ghost:hover {
    background: var(--bg-card);
    border-color: var(--border-hover);
}

.btn-danger {
    background: rgba(239, 68, 68, .12);
    color: var(--danger);
    border-color: rgba(239, 68, 68, .25);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, .18);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 7px 12px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 1rem;
}

/* Forms */
.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.input, .textarea, .select {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    transition: all var(--transition);
}

.input:focus, .textarea:focus, .select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
}

.textarea {
    resize: vertical;
    min-height: 80px;
}

.help {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 6px;
}

/* Alerts */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
    border: 1px solid;
}

.alert-error {
    background: rgba(239, 68, 68, .1);
    border-color: rgba(239, 68, 68, .3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, .1);
    border-color: rgba(16, 185, 129, .3);
    color: #6ee7b7;
}

.alert-info {
    background: rgba(99, 102, 241, .1);
    border-color: rgba(99, 102, 241, .3);
    color: #a5b4fc;
}

/* Logo */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text);
}

.logo-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: grid;
    place-items: center;
    font-size: 1rem;
    color: white;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(99, 102, 241, .3);
}

/* Top nav */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(20, 20, 29, .7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

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

/* Page container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* Loading spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

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

/* Toast */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 12px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    color: var(--text);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
    max-width: 360px;
    animation: toast-in .3s ease;
    pointer-events: auto;
}

.toast.success {
    border-color: rgba(16, 185, 129, .4);
}
.toast.success i { color: var(--success); }

.toast.error {
    border-color: rgba(239, 68, 68, .4);
}
.toast.error i { color: var(--danger); }

.toast.info i { color: var(--primary-light); }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fade-in .2s ease;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 460px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: modal-in .3s cubic-bezier(.34,1.56,.64,1);
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(20px) scale(.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-body {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Utility */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }

@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    .topbar {
        padding: 14px 16px;
    }
}
