/* Modern UI Styles for ITA Document System */

:root {
    --primary-color: #334155;
    --primary-dark: #334155;
    --secondary-color: #64748b;
    --accent-color: #8b5cf6;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #475569;
    --dark-bg: #1f2937;
    --sidebar-bg: #111827;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}



body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e9f2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.swal2-popup.ita-toast {
    border-radius: 0.9rem;
    border: 1px solid rgba(16, 185, 129, 0.18);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(6px);
}

.swal2-popup.ita-toast .swal2-title {
    color: #065f46;
    font-size: 0.95rem;
    font-weight: 700;
}

.swal2-popup.ita-toast .swal2-timer-progress-bar {
    background: linear-gradient(90deg, #10b981, #14b8a6);
}

html {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Sidebar layout behavior */
:root {
    --sidebar-expanded-width: 16rem;
}

#main-sidenav {
    width: var(--sidebar-expanded-width);
    transition: transform 0.3s ease, width 0.3s ease;
}

.flex.h-screen>div.flex-1,
.layout-content-offset {
    transition: margin-left 0.3s ease;
}

/* Dashboard slide carousel fallback styles (works even when some Tailwind utilities are absent) */
.dashboard-carousel-shell {
    --dashboard-mobile-slide-ratio: 4 / 3;
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(51, 65, 85, 0.7);
    background: #0f172a;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.dashboard-slide-frame {
    position: relative;
    height: 300px;
}

.dashboard-slide-item {
    position: absolute;
    inset: 0;
    height: 100%;
    transition: opacity 0.7s ease-in-out;
}

.dashboard-slide-link {
    display: block;
    height: 100%;
    width: 100%;
}

.dashboard-slide-media {
    position: relative;
    height: 100%;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.dashboard-slide-image {
    width: 100% !important;
    height: 100% !important; /* Override Tailwind reset: img,video { height: auto } */
    min-width: 100%;
    min-height: 100%;
    max-width: none !important;
    display: block !important;
    object-fit: contain !important;
    object-position: center;
    background: #0f172a;
}

img.dashboard-slide-image {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
}

.dashboard-slide-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.85rem 1rem;
    z-index: 2;
    background: rgba(2, 6, 23, 0.78);
}

.dashboard-slide-caption-global {
    position: relative;
    z-index: 5;
    padding: 0.75rem 1rem;
    background: rgba(2, 6, 23, 0.92);
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    pointer-events: none;
}

.dashboard-slide-title-global {
    margin: 0;
    color: #fff !important;
    font-size: 0.95rem;
    line-height: 1.3;
    font-weight: 700;
    white-space: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-shadow: none;
}

.dashboard-news-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 30;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.dashboard-slide-title {
    margin: 0;
    color: #fff !important;
    font-size: 1rem;
    line-height: 1.3;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.dashboard-slide-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 30;
    width: 2.6rem;
    height: 2.6rem;
    border: 0;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.4);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, background-color 0.25s ease;
}

.dashboard-slide-control:hover {
    background: rgba(15, 23, 42, 0.65);
}

.dashboard-slide-control-prev {
    left: 0.75rem;
}

.dashboard-slide-control-next {
    right: 0.75rem;
}

.dashboard-carousel-shell:hover .dashboard-slide-control,
.dashboard-carousel-shell:focus-within .dashboard-slide-control {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 767px) {
    .dashboard-slide-control {
        opacity: 1;
        pointer-events: auto;
        width: 2.35rem;
        height: 2.35rem;
    }

    .dashboard-slide-frame {
        height: auto;
        aspect-ratio: var(--dashboard-mobile-slide-ratio);
    }
}

@media (min-width: 768px) {
    .dashboard-slide-frame {
        height: 430px;
    }
}

@media (min-width: 1024px) {
    .dashboard-slide-frame {
        height: 540px;
    }
}

@media (max-width: 767px) {
    .dashboard-news-badge {
        display: none;
    }

    .dashboard-slide-caption {
        padding: 0.7rem 0.8rem;
    }

    .dashboard-slide-caption-global {
        padding: 0.65rem 0.8rem;
    }

    .dashboard-slide-title {
        font-size: 1rem;
    }
}

@media (min-width: 768px) {
    .dashboard-slide-title {
        font-size: 1.2rem;
    }
}

@media (min-width: 1024px) {
    .dashboard-slide-title {
        font-size: 1.35rem;
    }

    .dashboard-slide-title-global {
        font-size: 1.35rem;
    }
}

#main-topbar {
    transition: padding 0.3s ease, box-shadow 0.3s ease, border-color 0.25s ease;
}

#main-topbar .topbar-hide-on-collapse {
    transition: opacity 0.25s ease, max-width 0.3s ease, transform 0.25s ease, margin 0.25s ease;
}

.dashboard-title-ghost {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transform: translateX(4px);
}

body.dashboard-page:not(.topbar-collapsed) .dashboard-title-ghost {
    max-width: 65vw;
    opacity: 1;
    transform: translateX(0);
}

@media (min-width: 768px) {
    body.dashboard-page:not(.topbar-collapsed) .dashboard-title-ghost {
        max-width: none;
    }
}

body.topbar-collapsed #main-topbar {
    height: 3px;
    min-height: 3px;
    padding: 0 !important;
    background: transparent !important;
    border-bottom: 2px solid rgba(5, 150, 105, 0.8);
    box-shadow: none;
    overflow: visible;
}

body.topbar-collapsed #main-topbar > div {
    height: 0;
    min-height: 0;
    overflow: visible;
}

body.topbar-collapsed #main-topbar .topbar-hide-on-collapse {
    opacity: 0;
    max-width: 0;
    margin: 0 !important;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-4px);
    white-space: nowrap;
}

body.topbar-collapsed #main-topbar #sidebar-toggle-btn {
    position: fixed;
    top: 0.5rem;
    left: 1rem;
    z-index: 70;
    width: 2.1rem;
    height: 2.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgba(5, 150, 105, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 20px rgba(2, 44, 34, 0.28);
}

body.topbar-collapsed #main-topbar #topbar-toggle-btn {
    position: fixed;
    top: 0.5rem;
    left: 1rem;
    right: auto;
    z-index: 70;
    width: 2.1rem;
    height: 2.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgba(5, 150, 105, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 20px rgba(2, 44, 34, 0.28);
}

@media (min-width: 1024px) {
    body.sidebar-hidden #main-sidenav {
        transform: translateX(-100%);
    }

    body.sidebar-hidden .flex.h-screen>div.flex-1,
    body.sidebar-hidden .layout-content-offset {
        margin-left: 0 !important;
    }

    body:not(.sidebar-hidden) .flex.h-screen>div.flex-1,
    body:not(.sidebar-hidden) .layout-content-offset {
        margin-left: var(--sidebar-expanded-width) !important;
    }
}

@media (max-width: 1023px) {
    #main-sidenav {
        transform: translateX(-100%);
    }

    body.sidebar-mobile-open #main-sidenav {
        transform: translateX(0);
    }

    .flex.h-screen>div.flex-1,
    .layout-content-offset {
        margin-left: 0 !important;
    }
}

/* Custom Scrollbar for Sidenav */
.custom-scrollbar::-webkit-scrollbar {
    width: 5px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Navbar Improvements (Scoped to prevent global conflicts) */
.top-navbar nav {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

/* Card Improvements */
.card-modern {
    background: white;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card-modern:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

/* Form Improvements */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(71, 85, 105, 0.1);
    transform: translateY(-1px);
}

/* Button Improvements */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(71, 85, 105, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(71, 85, 105, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2563eb 100%);
    transition: all 0.3s ease;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    transition: all 0.3s ease;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    transition: all 0.3s ease;
}

/* Table Improvements */
table thead {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

table tbody tr {
    transition: all 0.2s ease;
}

table tbody tr:hover {
    background: #f8fafc;
    transform: scale(1.01);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Alert Improvements */
.alert {
    border-radius: 12px;
    animation: slideInDown 0.5s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Badge Improvements */
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Icon Improvements */
.icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(71, 85, 105, 0.3);
}

/* File Upload Improvements */
input[type="file"]::file-selector-button {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

input[type="file"]::file-selector-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.4);
}

/* DataTables Custom Styling */
.dataTables_wrapper {
    padding: 20px 0;
}

.dataTables_filter input {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

.dataTables_filter input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(71, 85, 105, 0.1);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive sidebar behavior for mobile/tablet */
@media (max-width: 1023px) {
    #main-sidenav {
        width: var(--sidebar-expanded-width);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    body.sidebar-mobile-open #main-sidenav {
        transform: translateX(0);
    }

    .flex.h-screen>div.flex-1,
    .layout-content-offset {
        margin-left: 0 !important;
    }
}

/* Glassmorphism Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Pulse Animation for Important Elements */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}


/* Additional Animations */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slideInDown {
    animation: slideInDown 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.animate-fadeIn {
    animation: fadeIn 0.6s ease-in;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

.animate-bounceIn {
    animation: bounceIn 0.6s ease-out;
}

/* Hover Effects for Cards */
.card-hover-effect {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover-effect:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Button Ripple Effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Tooltip Styles */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}

.tooltip:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* Progress Bar */
.progress-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    background-size: 200% 100%;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.success {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    color: white;
}

.status-badge.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.status-badge.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.status-badge.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}


/* Enhanced Sidebar Styles */
aside {
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom Scrollbar for Sidebar */
aside::-webkit-scrollbar {
    width: 6px;
}

aside::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

aside::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #475569 0%, #334155 100%);
    border-radius: 10px;
}

aside::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
}

/* Sidebar Menu Item Active State */
aside nav ul li a.active {
    background: linear-gradient(90deg, rgba(71, 85, 105, 0.2) 0%, rgba(71, 85, 105, 0.05) 100%);
    border-left: 3px solid #475569;
    color: #94a3b8;
}

aside nav ul li a.active .w-10 {
    background: linear-gradient(135deg, rgba(71, 85, 105, 0.3) 0%, rgba(71, 85, 105, 0.1) 100%);
    box-shadow: 0 4px 6px -1px rgba(71, 85, 105, 0.3);
}

/* Sidebar Glow Effect on Hover */
aside nav ul li a:hover::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 70%;
    background: linear-gradient(180deg, transparent, currentColor, transparent);
    border-radius: 0 2px 2px 0;
}

/* Icon Pulse Animation on Hover */
aside nav ul li a:hover .w-10 i {
    animation: iconPulse 0.6s ease-in-out;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Sidebar Background Pattern */
/* Sidebar Background Pattern */
aside::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(71, 85, 105, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(100, 116, 139, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

aside>* {
    position: relative;
    z-index: 1;
}

/* Menu Item Shine Effect */
aside nav ul li a::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

aside nav ul li a:hover::after {
    left: 100%;
}

/* Badge for Menu Items (optional) */
.menu-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 0.625rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
}

/* Sidebar Footer Animation */
/* Sidebar Footer Animation - Disabled to prevent visibility issues
aside .absolute.bottom-0 {
    opacity: 1 !important;
} */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Menu Items Stagger Animation */
/* Menu Items Stagger Animation - Disabled to prevent visibility issues
aside nav ul li {
    opacity: 1 !important;
} */

/* Clean end of file */