/* Global Styles & Variables */
:root {
    --primary-color: #3b82f6;
    /* Blue 500 */
    --primary-hover: #2563eb;
    /* Blue 600 */

    /* Semantic Colors */
    --success-color: #10b981;
    /* Emerald 500 */
    --warning-color: #f59e0b;
    /* Amber 500 */
    --danger-color: #ef4444;
    /* Red 500 */
    --info-color: #0ea5e9;
    /* Sky 500 */

    /* Dark Mode Core */
    --bg-dark: #121212;
    --bg-surface: #1e1e1e;
    --bg-gradient-start: #1e1e1e;
    --bg-gradient-end: #121212;

    --text-color: #f8fafc;
    /* Slate 50 */
    --text-muted: #94a3b8;
    /* Slate 400 */
    --surface-color: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --font-family: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.3s ease;
}

/* Responsive & Mobile-First Sidebar */
.sidebar-overlay {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 40;
}

#sidebar {
    transition: transform 0.3s ease-in-out, width 0.3s ease-in-out;
}

@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 50;
    }

    #sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
    }
}

/* Glassmorphism Refinement */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-dark {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Utilities (Tailwind-like) */
.h-screen {
    height: 100vh;
}

.w-full {
    width: 100%;
}

.max-w-md {
    max-width: 28rem;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.text-center {
    text-align: center;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mt-4 {
    margin-top: 1rem;
}

.p-8 {
    padding: 2rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.space-y-6>*+* {
    margin-top: 1.5rem;
}

.block {
    display: block;
}

.hidden {
    display: none;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-2xl {
    border-radius: 1rem;
}

.shadow-2xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Typography */
.font-sans {
    font-family: var(--font-family);
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-white {
    color: #fff;
}

.text-white\/80 {
    color: rgba(255, 255, 255, 0.8);
}

.text-white\/70 {
    color: rgba(255, 255, 255, 0.7);
}

.text-white\/40 {
    color: rgba(255, 255, 255, 0.4);
}

.text-red-300 {
    color: #fca5a5;
}

/* Components */
.bg-gradient {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.backdrop-blur-lg {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.bg-white\/10 {
    background-color: rgba(255, 255, 255, 0.1);
}

.bg-white\/5 {
    background-color: rgba(255, 255, 255, 0.05);
}

.border {
    border-width: 1px;
}

.border-white\/20 {
    border-color: rgba(255, 255, 255, 0.2);
}

.border-white\/10 {
    border-color: rgba(255, 255, 255, 0.1);
}

.border-transparent {
    border-color: transparent;
}

/* Transitions */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transform {
    transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.hover\:-translate-y-0\.5:hover {
    --tw-translate-y: -0.125rem;
    transform: translateY(-0.125rem);
}

/* Forms */
input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-color);
}

button {
    background-color: var(--primary-color);
    cursor: pointer;
    border: none;
}

button:hover {
    background-color: var(--primary-hover);
}

/* Dashboard specific placeholders */
.dashboard-layout {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 250px;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--border-color);
    padding: 1rem;
}

.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Toast System */
#toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 400px;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.show {
    transform: translateX(0);
}

.toast.hide {
    transform: translateX(120%);
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-msg {
    font-size: 0.875rem;
    font-weight: 500;
    flex: 1;
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-error {
    border-left: 4px solid var(--danger-color);
}

.toast-warning {
    border-left: 4px solid var(--warning-color);
}

.toast-info {
    border-left: 4px solid var(--info-color);
}

/* Loading Skeletons */
.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0.08) 50%,
            rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 0.25rem;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Form Speed Optimization */
input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.btn-speed {
    transition: transform 0.1s ease;
}

.btn-speed:active {
    transform: scale(0.95);
}