@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/11.1.0/sweetalert2.min.css');
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css");

:root {
    --bs-primary: #dc2626;
    --bs-primary-rgb: 220, 38, 38;
    --bs-primary-text-emphasis: #f87171;
    --bs-primary-bg-subtle: rgba(220, 38, 38, 0.14);
    --bs-primary-border-subtle: rgba(220, 38, 38, 0.3);
    --bs-link-color: #ef4444;
    --bs-link-hover-color: #dc2626;
    --app-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition-speed: 0.25s;
    --card-radius: 14px;
    --pill-radius: 9999px;
}

[data-bs-theme="dark"] {
    --body-bg: #0b0f19;
    --surface-bg: #111827;
    --surface-card: #151e2e;
    --surface-card-hover: #1c273c;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.04);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --brand-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #991b1b 100%);
    --brand-glow: rgba(220, 38, 38, 0.35);
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --navbar-bg: rgba(15, 23, 42, 0.88);
    --table-hover-bg: rgba(255, 255, 255, 0.03);
    --bs-primary: #dc2626;
    --bs-primary-rgb: 220, 38, 38;
    --bs-primary-text-emphasis: #f87171;
    --bs-primary-bg-subtle: rgba(220, 38, 38, 0.16);
    --bs-primary-border-subtle: rgba(220, 38, 38, 0.35);
}

[data-bs-theme="light"] {
    --body-bg: #f8fafc;
    --surface-bg: #ffffff;
    --surface-card: #ffffff;
    --surface-card-hover: #f1f5f9;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-subtle: rgba(0, 0, 0, 0.04);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --brand-gradient: linear-gradient(135deg, #dc2626 0%, #b91c1c 50%, #7f1d1d 100%);
    --brand-glow: rgba(220, 38, 38, 0.2);
    --card-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.05), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
    --navbar-bg: rgba(255, 255, 255, 0.92);
    --table-hover-bg: rgba(15, 23, 42, 0.02);
    --bs-primary: #dc2626;
    --bs-primary-rgb: 220, 38, 38;
    --bs-primary-text-emphasis: #b91c1c;
    --bs-primary-bg-subtle: rgba(220, 38, 38, 0.12);
    --bs-primary-border-subtle: rgba(220, 38, 38, 0.28);
}

body {
    font-family: var(--app-font) !important;
    background-color: var(--body-bg) !important;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

main {
    flex: 1 0 auto;
}

/* Glassmorphic Navbar */
.navbar-modern {
    background: var(--navbar-bg) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-speed) ease;
}

/* Modern Card Kitchen */
.card {
    background-color: var(--surface-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--card-radius) !important;
    box-shadow: var(--card-shadow) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
}

.card:hover {
    border-color: rgba(220, 38, 38, 0.35) !important;
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
    font-weight: 600;
    padding: 0.9rem 1.25rem;
}

.card-header-gradient {
    background: var(--brand-gradient) !important;
    color: #ffffff !important;
    border: none !important;
}

/* Red Brand Elements */
.btn-primary {
    --bs-btn-bg: #dc2626 !important;
    --bs-btn-border-color: #dc2626 !important;
    --bs-btn-hover-bg: #b91c1c !important;
    --bs-btn-hover-border-color: #b91c1c !important;
    --bs-btn-active-bg: #991b1b !important;
    --bs-btn-active-border-color: #991b1b !important;
    --bs-btn-focus-shadow-rgb: 220, 38, 38 !important;
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}

.btn-primary:hover {
    background-color: #b91c1c !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
}

.btn-outline-primary {
    --bs-btn-color: #ef4444 !important;
    --bs-btn-border-color: #dc2626 !important;
    --bs-btn-hover-bg: #dc2626 !important;
    --bs-btn-hover-border-color: #dc2626 !important;
    --bs-btn-active-bg: #dc2626 !important;
    --bs-btn-active-border-color: #dc2626 !important;
    color: #ef4444 !important;
    border-color: #dc2626 !important;
}

.btn-outline-primary:hover {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}

.bg-primary {
    background-color: #dc2626 !important;
}

.text-primary {
    color: #ef4444 !important;
}

.bg-primary-subtle {
    background-color: rgba(220, 38, 38, 0.14) !important;
}

.text-primary-emphasis {
    color: #f87171 !important;
}

.border-primary {
    border-color: #dc2626 !important;
}

.border-primary-subtle {
    border-color: rgba(220, 38, 38, 0.3) !important;
}

/* Modern Badges & Metrics */
.metric-pill {
    padding: 0.35rem 0.75rem;
    border-radius: var(--pill-radius);
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Modern Form Controls */
.form-control, .form-select {
    border-radius: 10px !important;
    border: 1px solid var(--border-color) !important;
    padding: 0.65rem 1rem !important;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.22) !important;
}

/* Modern Toggle Switches */
.form-switch .form-check-input {
    width: 2.75em !important;
    height: 1.5em !important;
    cursor: pointer;
    border-radius: 2em !important;
    transition: background-position 0.2s ease-in-out, background-color 0.2s ease;
}

.form-switch .form-check-input:checked {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
}

/* Modern Countdown Pill */
.timer-pill {
    font-family: 'Plus Jakarta Sans', monospace;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.5px;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Key Sensitive Blur */
.key-sensi {
    filter: blur(4px);
    transition: filter 0.2s ease;
    cursor: pointer;
    user-select: all;
}
.key-sensi:hover {
    filter: blur(0px);
}

/* Modern Tables */
.table {
    --bs-table-bg: transparent;
    vertical-align: middle;
}

.table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.table td {
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.85rem 0.75rem;
}

/* Modern Theme Toggle Button */
.theme-toggle-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: var(--surface-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
    background: var(--surface-card-hover);
    transform: rotate(15deg);
}
