/* ============================================
   SCP HMIS - Main Integrated Design System
   ============================================ */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --sidebar-width: 280px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    transition: background-color 0.3s, color 0.3s;
}

.dark {
    background-color: #0f172a;
    color-scheme: dark;
}

.light {
    background-color: #f8fafc;
    color-scheme: light;
}

/* Scrollbar Styling */
.custom-scroll::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.dark .custom-scroll::-webkit-scrollbar-thumb {
    background: #334155;
}

/* Layout */
.app-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
}

.content-scroll {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    scroll-behavior: smooth;
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .content-scroll {
        padding: 2rem;
    }
}

/* Main Header */
.main-header {
    height: 90px;
    min-height: 90px;
    max-height: 90px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    overflow: hidden;
}

.light .main-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
}

.dark .main-header {
    background: #1e293b;
    border-bottom: 1px solid #1e293b;
}

/* Custom Select Dropdowns */
select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem !important;
}

.dark select {
    background-color: #1e293b;
    color: #f8fafc;
    border-color: #334155 !important;
}

.dark select option {
    background-color: #0f172a;
    color: #f8fafc;
}

/* Transitions */
[x-cloak] {
    display: none !important;
}

.text-dark-contrast {
    color: #94a3b8;
}

.dark .text-dark-contrast {
    color: #cbd5e1;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

.dark ::-webkit-scrollbar-track {
    background: #020617;
}

::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.4);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(37, 99, 235, 0.6);
}

/* === ANIMATIONS === */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0px rgba(37, 99, 235, 0.4);
    }

    100% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Responsive Sidebar */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        border-right-width: 0;
        width: 280px;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        display: flex !important;
        box-shadow: 20px 0 50px -10px rgba(0, 0, 0, 0.5);
    }

    .main-header {
        padding: 0 1rem;
        height: 80px;
        min-height: 80px;
    }
}

@media (min-width: 1025px) {
    .sidebar {
        transform: translateX(0) !important;
        display: flex !important;
    }
}