/* assets/css/style.css */
:root {
    --ink: #17212f;
    --muted: #64748b;
    --line: #d8e0ea;
    --panel: #ffffff;
    --panel-soft: #f7f9fc;
    --nav: #182331;
    --nav-2: #223044;
    --brand: #0f766e;
    --brand-2: #2563eb;
    --accent: #f59e0b;
    --danger: #dc2626;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow-md: 0 14px 35px rgba(15, 23, 42, .10);
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--ink);
    background:
        linear-gradient(135deg, rgba(15, 118, 110, .06), transparent 28%),
        linear-gradient(315deg, rgba(245, 158, 11, .08), transparent 30%),
        #eef3f7 !important;
}

/* Make sure elements that will be animated by GSAP are hidden initially if needed, 
   though it's better to let GSAP handle initial states in JS to prevent FOUC without JS */
.gs-reveal {
    /* visibility: hidden; -- Removed to prevent blank page if GSAP fails to load */
}

.sidebar {
    background: var(--nav) !important;
    box-shadow: 8px 0 28px rgba(15, 23, 42, .16) !important;
}

.sidebar > .h-16 {
    height: 72px;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, .96), rgba(37, 99, 235, .92)) !important;
}

.sidebar a.text-xl {
    font-style: normal !important;
    letter-spacing: .02em;
}

.sidebar .flex-1.bg-white {
    background: var(--nav) !important;
    padding: 10px;
}

.nav-group {
    border: 0 !important;
    margin-bottom: 10px;
}

.nav-group-header {
    background: rgba(255, 255, 255, .07) !important;
    color: #dbeafe !important;
    border: 1px solid rgba(255, 255, 255, .08) !important;
    border-radius: 8px;
    padding: 10px 12px !important;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.nav-items {
    background: transparent !important;
    padding: 6px 0 0 !important;
}

.nav-item {
    color: #cbd5e1 !important;
    display: flex !important;
    align-items: center;
    gap: 9px;
    padding: 9px 10px 9px 14px !important;
    margin: 2px 0;
    border-radius: 8px;
    font-size: 13px !important;
}

.nav-item:hover {
    background: rgba(255, 255, 255, .10) !important;
    color: #ffffff !important;
    transform: translateX(2px);
}

.nav-item.active {
    background: rgba(255, 255, 255, .15) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: inset 3px 0 0 #7dd3fc;
}

.nav-item.active i {
    color: #ffffff !important;
}

.nav-item i {
    color: #7dd3fc !important;
    width: 18px !important;
}

.top-toolbar {
    height: 58px !important;
    background: rgba(255, 255, 255, .92) !important;
    border-bottom: 1px solid var(--line) !important;
    box-shadow: var(--shadow-sm) !important;
    backdrop-filter: blur(14px);
}

.top-toolbar a {
    border-radius: 8px;
    font-size: 13px;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.top-toolbar a:hover {
    background: #eef6ff;
    transform: translateY(-1px);
}

.active-mod-btn {
    background: #e6f6f3 !important;
    color: #0f766e !important;
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .18);
}

#page-title {
    color: var(--ink);
    font-weight: 700;
    letter-spacing: .01em;
}

#main-content-area {
    background: transparent !important;
    padding: 20px !important;
}

.bg-white {
    border-color: rgba(148, 163, 184, .28);
}

.rounded-lg {
    border-radius: 8px !important;
}

button,
.btn {
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, transform .16s ease;
}

/* ─── Premium Textbox, Select & Textarea Design ─── */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="search"],
input[type="tel"],
input[type="url"],
select,
textarea {
    background-color: #f8fafc; /* Premium soft slate-50 background */
    border: 1.5px solid #cbd5e1; /* Sleek, defined border */
    color: var(--ink);
    font-family: inherit;
    font-size: 0.875rem; /* Clean, modern body-text scale */
    border-radius: 8px; /* Perfect smooth corners */
    padding: 0.625rem 0.875rem; /* Generous touch targets */
    box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.04), var(--shadow-sm); /* Inner depth */
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); /* Smooth animations */
    outline: none;
}

/* Search inputs with a left magnifier icon */
.relative:has(> .fa-search) > input[type="text"],
.univ-search .search-input {
    padding-left: 2.25rem !important;
}

.relative:has(> .fa-search) > .fa-search,
.univ-search .search-icon {
    position: absolute !important;
    left: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    pointer-events: none;
    color: #9ca3af;
}

.univ-search {
    position: relative;
    flex-shrink: 0;
}

/* Hover State */
input[type="text"]:hover,
input[type="number"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="date"]:hover,
input[type="search"]:hover,
input[type="tel"]:hover,
input[type="url"]:hover,
select:hover,
textarea:hover {
    border-color: #94a3b8 !important; /* Darker border on hover */
    background-color: #ffffff !important; /* Solid pure white bg to pop out */
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02), 0 4px 12px rgba(15, 23, 42, 0.06) !important; /* Elevated shadow */
    transform: translateY(-0.5px); /* Micro-interaction lift */
}

/* Focus State */
input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
    border-color: var(--brand) !important; /* Brand teal primary highlight */
    background-color: #ffffff !important; /* Solid pure white bg */
    box-shadow: 
        0 0 0 4px rgba(15, 118, 110, 0.16), /* Beautiful brand glowing ring */
        0 4px 16px rgba(15, 118, 110, 0.08), 
        inset 0 1px 1px rgba(0,0,0,0.05) !important;
    transform: translateY(-1px) !important; /* Active lift */
}

/* Focus State for blue theme override */
.theme-blue input:focus,
.theme-blue select:focus,
.theme-blue textarea:focus {
    border-color: var(--brand-2) !important;
    box-shadow: 
        0 0 0 4px rgba(37, 99, 235, 0.16), 
        0 4px 16px rgba(37, 99, 235, 0.08) !important;
}

/* Specific tweaks for inline table cells (like in payroll processing) to maintain compact styling */
table input[type="number"],
table input[type="text"] {
    background-color: transparent !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 11px !important;
    text-align: right !important;
    width: 100% !important;
}

table input[type="number"]:hover,
table input[type="text"]:hover {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: var(--shadow-sm) !important;
    transform: none !important;
}

table input[type="number"]:focus,
table input[type="text"]:focus {
    background-color: #ffffff !important;
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15) !important;
    transform: none !important;
}

button:hover {
    transform: translateY(-1px);
}

table thead {
    background: #eef3f7;
}

table tr:hover td {
    background: rgba(15, 118, 110, .035);
}

#bell-dropdown {
    border: 1px solid rgba(148, 163, 184, .35) !important;
    border-radius: 10px !important;
    box-shadow: var(--shadow-md) !important;
}

/* Feed refresh */
.social-shell {
    display: grid;
    grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    max-width: 1320px;
    margin: 0 auto;
    width: 100%;
}

@media (min-width: 1101px) {
    .social-shell {
        grid-template-columns: minmax(190px, 240px) minmax(420px, 760px) minmax(220px, 300px);
    }
}

.feed-card,
.social-panel {
    background: rgba(255,255,255,.94) !important;
    border: 1px solid rgba(148, 163, 184, .28) !important;
    border-radius: 8px !important;
    box-shadow: var(--shadow-sm) !important;
}

.feed-card:hover {
    box-shadow: var(--shadow-md) !important;
}

.avatar-ring {
    background: linear-gradient(135deg, var(--brand), var(--brand-2)) !important;
}

.post-btn:hover {
    background: #edf7f6 !important;
    color: var(--brand) !important;
}

.drop-zone {
    background: #f8fbfd !important;
    border-color: #cbd5e1 !important;
}

.drop-zone.dragover {
    background: #e6f6f3 !important;
    border-color: var(--brand) !important;
}

/* Modern Photo Upload Styles - Redesigned & Premium */
.photo-upload-wrapper {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 1.25rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 20px -2px rgba(15, 76, 129, 0.05), 0 2px 8px -1px rgba(15, 76, 129, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.photo-upload-wrapper:hover {
    box-shadow: 0 10px 25px -5px rgba(15, 76, 129, 0.08), 0 8px 16px -6px rgba(15, 76, 129, 0.04);
    border-color: rgba(15, 76, 129, 0.2);
}

.profile-preview-container {
    position: relative;
    border-radius: 1.25rem; /* squircle */
    overflow: hidden;
    border: 4px solid #ffffff;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    background: #f8fafc;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-preview-container:hover {
    transform: scale(1.03);
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.15);
}

.profile-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.profile-preview-container:hover img {
    transform: scale(1.08);
}

.profile-preview-container .initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f4c81, #4b91cc);
    color: white;
    font-size: 2.75rem;
    font-weight: 700;
    letter-spacing: -0.05em;
}

/* Beautiful hover action label */
.profile-preview-container::after {
    content: '\f030'; /* camera icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    inset: 0;
    background: rgba(15, 76, 129, 0.4);
    backdrop-filter: blur(2px);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-preview-container:hover::after {
    opacity: 1;
}

.photo-drop-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #64748b;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.photo-drop-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 76, 129, 0.02), rgba(75, 145, 204, 0.02));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-drop-zone:hover::before, .photo-drop-zone.dragover::before {
    opacity: 1;
}

.photo-drop-zone:hover, .photo-drop-zone.dragover {
    border-color: #0f4c81;
    color: #0f4c81;
    background: rgba(15, 76, 129, 0.01);
    box-shadow: 0 8px 20px -6px rgba(15, 76, 129, 0.08), 0 0 0 4px rgba(15, 76, 129, 0.04);
}

.photo-drop-zone i {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.photo-drop-zone:hover i, .photo-drop-zone.dragover i {
    color: #0f4c81;
    transform: translateY(-4px) scale(1.05);
}

.photo-drop-zone.dragover i {
    animation: floatIcon 1.5s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(-4px); }
    50% { transform: translateY(-8px); }
}

.photo-drop-zone p {
    margin: 0;
    transition: color 0.3s ease;
}

.photo-drop-zone .hint {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.7;
    margin-top: 0.25rem;
    color: #94a3b8;
}

.hidden-input {
    display: none;
}

/* Toast Notification Styles */
#toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 300px;
    max-width: 450px;
    background: #ffffff;
    border-left: 4px solid var(--brand);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    transform: translateX(120%);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.toast-content {
    flex-grow: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--ink);
    margin-bottom: 0.125rem;
}

.toast-message {
    font-size: 0.8125rem;
    color: var(--muted);
    line-height: 1.4;
}

.toast-close {
    font-size: 0.875rem;
    color: #cbd5e1;
    cursor: pointer;
    transition: color 0.2s;
}

.toast-close:hover {
    color: var(--danger);
}

.toast-success { border-left-color: #10b981; }
.toast-success .toast-icon { color: #10b981; }

.toast-error { border-left-color: var(--danger); }
.toast-error .toast-icon { color: var(--danger); }

.toast-info { border-left-color: var(--brand-2); }
.toast-info .toast-icon { color: var(--brand-2); }

.toast-warning { border-left-color: var(--accent); }
.toast-warning .toast-icon { color: var(--accent); }

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input:checked + .toggle-slider {
    background-color: var(--brand);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

input:focus + .toggle-slider {
    box-shadow: 0 0 1px var(--brand);
}

.notification-card {
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(148, 163, 184, .30);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.notification-card.unread {
    border-left: 4px solid var(--brand);
    background: linear-gradient(90deg, rgba(15,118,110,.08), rgba(255,255,255,.96) 30%);
}

@media (max-width: 1100px) {
    .social-shell {
        grid-template-columns: 1fr;
    }
    .social-shell > aside {
        display: none;
    }
}

/* ─── Mobile / responsive layout ─── */
.toolbar-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0.25rem;
    border-radius: 8px;
}

.toolbar-modules .mod-btn,
.toolbar-modules a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 40px;
    border-radius: 6px;
    -webkit-tap-highlight-color: transparent;
}

/* Global Modal Z-Index Elevation */
.fixed.inset-0.z-50 {
    z-index: 2000 !important;
}

@media (max-width: 639px) {
    .toolbar-modules a {
        font-size: 0;
        padding: 0.5rem 0.625rem;
        min-width: 44px;
    }

    .toolbar-modules a i {
        font-size: 1.05rem;
        margin: 0;
    }

    .toolbar-modules .h-6,
    .toolbar-modules .h-5 {
        display: none;
    }

    .toolbar-lang {
        display: none !important;
    }

    #main-content-area {
        padding: 0.5rem !important;
    }

    .page-toolbar,
    .bg-gray-100.p-2.border-b {
        padding: 0.5rem !important;
    }

    /* Tables: ensure horizontal scroll on small screens */
    #main-content-area > .overflow-auto,
    #main-content-area > .flex-1.overflow-auto,
    #main-content-area .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }

    /* Modals full-width & scrollable on phones */
    .fixed.inset-0.z-50 {
        overflow-y: auto !important;
        align-items: flex-start !important;
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .fixed.inset-0 > .bg-white,
    .fixed.inset-0 > div[class*="rounded"] {
        width: calc(100% - 1rem) !important;
        max-width: 100% !important;
        margin-left: 0.5rem !important;
        margin-right: 0.5rem !important;
    }

    /* Calendar */
    .cal-page-layout {
        flex-direction: column !important;
        height: auto !important;
        min-height: 0;
    }

    .cal-sidebar {
        width: 100% !important;
        max-height: none;
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .cal-header {
        font-size: 10px;
        padding: 6px 2px;
    }

    .cal-day {
        min-height: 52px;
        padding: 3px 4px;
    }

    .cal-day .day-num {
        font-size: 11px;
    }

    .holiday-dot,
    .leave-dot,
    .checkin-dot {
        font-size: 8px;
        padding: 0 2px;
        max-width: 100%;
    }

    .cal-nav-row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .cal-nav-row h2 {
        font-size: 1rem;
        min-width: 0;
    }

    /* Maps overlay */
    .maps-overlay-panel {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        max-height: 200px !important;
        margin: 0.5rem;
    }

    .maps-map-wrap {
        min-height: 280px;
    }

    /* Employee profile header */
    .emp-profile-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }

    /* Feed comment indent */
    .comment-node.ml-8 {
        margin-left: 1rem !important;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .cal-sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        width: 100% !important;
    }

    .cal-page-layout {
        flex-direction: column !important;
    }
}

@media (max-width: 480px) {
    .social-shell {
        gap: 12px;
    }

    .feed-card .flex.gap-3 {
        flex-wrap: wrap;
    }
}

/* Custom Animations & Patterns */
@keyframes pulse-slow {
    0%, 100% { transform: scale(1.05); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}
.animate-pulse-slow {
    animation: pulse-slow 8s ease-in-out infinite;
}

.pattern-grid {
    background-image: radial-gradient(circle, #4b91cc 1px, transparent 1px);
    background-size: 30px 30px;
}

.text-primary-light { color: #8ab4d9; }

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #e8eef5;
}
::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}
