/* 
   Premium UI: Dark Pink & White Theme
   Colors:
   --primary: #AB1922 (Deep Rose)
   --accent: #D01F29
   --bg: #F8F9FA
   --text: #2C3E50
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #D01F29; /* New Corporate Red */
    --primary-hover: #AB1922; /* Slightly darker shade for hover */
    --accent-color: #EF5350;
    --bg-color: #F8F9FA;
    --card-bg: #FFFFFF;
    --text-main: #2C3E50;
    --text-muted: #7F8C8D;
    --border-radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    background-color: var(--bg-color) !important;
    color: var(--text-main);
    line-height: 1.6;
}

.background-login {
    background-color: var(--bg-color) !important;
    color: var(--text-main) !important;
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-wrapper > .row {
    width: 100%;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: #FFFFFF;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    color: var(--text-main);
    transition: var(--transition);
    padding: 20px 0 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #EEE;
}

.sidebar-brand {
    padding: 20px;
    flex-shrink: 0;
    text-align: center;
}

.sidebar-brand a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none !important;
    color: var(--text-main) !important;
}

.sidebar-brand img {
    max-width: 100%;
    height: auto;
    margin-bottom: 15px;
    border-radius: 4px;
}

.sidebar-brand span {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.2px;
    line-height: 1.2;
    color: var(--primary-color);
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav > li > a {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: var(--text-main) !important;
    text-decoration: none !important;
    font-weight: 600; /* Semibold */
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.sidebar-nav > li > a i {
    width: 20px;
    margin-right: 12px;
    font-size: 16px;
    text-align: center;
    color: var(--text-muted);
    transition: var(--transition);
}

.sidebar-nav > li > a:hover {
    background: #FCE4EC;
    color: var(--primary-color) !important;
    border-left-color: var(--primary-color);
}

.sidebar-nav > li > a:hover i {
    color: var(--primary-color) !important;
}

.sidebar-nav > li.active > a {
    background: #FCE4EC;
    color: var(--primary-color) !important;
    border-left-color: var(--primary-color);
}

/* Sidebar Account Section */
.nav-divider {
    height: 1px;
    background: #EEE;
    margin: 15px 25px;
}

.nav-header {
    padding: 10px 25px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav > li > a.text-danger:hover {
    background: #FFF1F0;
    color: #F5222D !important;
    border-left-color: #F5222D;
}

/* Main Content Adjustment */
.main-content {
    margin-left: 260px;
    padding: 30px;
    min-height: 100vh;
    transition: var(--transition);
}

@media (max-width: 991px) {
    .sidebar {
        width: 0;
        left: -260px;
    }
    .main-content {
        margin-left: 0;
    }
}

/* Override Bootstrap Container for Sidebar Layout */
.container {
    width: 100% !important;
    padding: 0 !important;
}

/* Reload overlay adjust */
.reload {
    left: 260px !important;
    width: calc(100% - 260px) !important;
}

/* Buttons */
.btn {
    border-radius: 8px !important;
    font-weight: 500 !important;
    padding: 8px 20px !important;
    transition: var(--transition) !important;
    text-transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color)) !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(173, 20, 87, 0.2) !important;
}

.btn-premium:hover {
    background-color: #C2185B !important;
    color: #FFFFFF !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(216, 27, 96, 0.3);
}

/* DataTables Buttons */
.dt-button {
    background: var(--primary-color) !important;
    color: #FFFFFF !important;
    border: none !important;
}

/* Cards & Containers */
.container {
    width: 90% !important;
    max-width: 1400px;
}

.well, .panel, .thumbnail {
    background: var(--card-bg) !important;
    border: none !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--shadow) !important;
    padding: 25px !important;
}

/* Page Headers */
h2 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Forms */
.form-control {
    border-radius: 8px !important;
    border: 1px solid #E0E0E0 !important;
    padding: 10px 15px !important;
    height: auto !important;
    box-shadow: none !important;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(173, 20, 87, 0.1) !important;
}

/* Tables */
.table {
    background: #FFF;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #EEE;
}

.table thead th {
    background: #fdf2f7 !important;
    color: var(--primary-color) !important;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 600;
    padding: 15px !important;
    border: none !important;
}

.table tbody td {
    padding: 15px !important;
    vertical-align: middle !important;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #fafbfc;
}

/* Footer */
footer {
    background: #FFF;
    padding: 40px 0;
    margin-top: 60px;
    border-top: 1px solid #EEE;
}

.footer-space {
    color: var(--text-muted);
    font-size: 14px;
}

/* Status Badges */
.status-pill {
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    color: #FFFFFF !important;
    letter-spacing: 0.5px;
}

.status-approved, .status-present {
    background-color: #28a745 !important; /* Green */
}

.status-pending, .status-late {
    background-color: #fd7e14 !important; /* Orange */
}

.status-progress {
    background-color: #6c757d !important; /* Grey */
}

.status-rejected, .status-absent {
    background-color: #dc3545 !important; /* Red */
}

.status-request {
    background-color: var(--primary-color) !important; /* Dark Pink */
}

/* Modern Cards & Layouts */
.card-modern {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(0,0,0,0.05);
    transition: var(--transition);
}

.card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.welcome-card {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: #FFFFFF !important;
    padding: 40px;
}

.welcome-card h1 {
    font-weight: 800;
    margin-top: 0;
    color: #FFF;
}

.stat-card {
    text-align: center;
    border-radius: 12px;
    padding: 25px;
    height: 100%;
}

.stat-card i {
    font-size: 32px;
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 10px;
    background: rgba(0,0,0,0.05);
}

.stat-card.primary i { color: var(--primary-color); background: #FCE4EC; }
.stat-card.info i { color: #0288D1; background: #E1F5FE; }
.stat-card.warning i { color: #F57C00; background: #FFF3E0; }
.stat-card.success i { color: #388E3C; background: #E8F5E9; }

/* Login Page Custom Styles */
/* Forcefully fix the 'Squeezed' layout and Dark Background */
body.background-login {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    color: #333 !important;
}

.login-wrapper {
    min-height: 100vh !important;
    height: auto !important;
    padding-top: 12vh !important;
    padding-bottom: 50px !important;
    display: block !important;
    width: 100% !important;
}

.login-wrapper > .row {
    margin: 0 !important;
    width: 100% !important;
    display: block !important;
}

.login-card {
    background: #ffffff !important;
    padding: 40px !important;
    border-radius: 20px !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1) !important;
    border: 1px solid rgba(0,0,0,0.05) !important;
    width: 100% !important;
    max-width: 480px !important;
    margin: 0 auto !important;
    float: none !important;
    display: block !important;
    animation: fadeInDown 0.6s ease-out;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Polish */
.modal-content {
    border-radius: 15px;
    border: none;
}

.modal-header {
    background: var(--primary-color);
    color: #FFF;
    border-radius: 15px 15px 0 0;
}

.modal-header .close {
    color: #FFF;
    opacity: 0.8;
}

/* Utility Animations */
.animate-in {
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form refinement */
.form-control:focus {
    border-color: var(--primary-color) !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 4px rgba(216, 27, 96, 0.1) !important;
}

/* Snackbar / Toast Notifications */
.snackbar-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.snackbar {
    min-width: 300px;
    background: #FFFFFF;
    color: var(--text-main);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    transform: translateX(120%);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 5px solid var(--primary-color);
    pointer-events: auto;
}

.snackbar.show {
    transform: translateX(0);
}

.snackbar-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 14px;
}

.snackbar-icon {
    font-size: 20px;
}

.snackbar-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    line-height: 1;
    transition: var(--transition);
}

.snackbar-close:hover {
    color: var(--primary-color);
}

/* Status Variants */
.snackbar.success { border-left-color: #28a745; }
.snackbar.success i { color: #28a745; }

.snackbar.warning { border-left-color: #fd7e14; }
.snackbar.warning i { color: #fd7e14; }

.snackbar.danger { border-left-color: #dc3545; }
.snackbar.danger i { color: #dc3545; }

.snackbar.info { border-left-color: #0288D1; }
.snackbar.info i { color: #0288D1; }

@keyframes snackbarFadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.95); }
}

.snackbar.fade-out {
    animation: snackbarFadeOut 0.3s forwards;
}

/* DataTables Button Corrections */
.dt-button, .paginate_button.current, .paginate_button:hover {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
}

.paginate_button.active > a {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current, 
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--primary-color) !important;
    color: white !important;
    border: 1px solid var(--primary-color) !important;
}

/* Login Page specific */
.login-body {
    background: radial-gradient(circle at center, #222, #000) !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

.login-card {
    background: #ffffff;
    max-width: 480px;
    width: 100%;
    margin: 40px auto;
    padding: 50px 40px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 10;
}

/* Premium Form Elements */
.premium-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    display: block;
}

.input-with-icon {
    position: relative;
    width: 100%;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 16px;
    z-index: 10;
}

.premium-input {
    padding-left: 45px !important;
    height: 52px !important;
    border-radius: 12px !important;
    border: 1.5px solid #eee !important;
    transition: all 0.3s ease !important;
    font-size: 14px !important;
    background: #fdfdfd !important;
}

.premium-input:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 4px rgba(216, 27, 96, 0.1) !important;
    background-color: #fff !important;
}

.login-footer {
    animation: fadeIn 1s ease 0.5s both;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Final Button Overrides */
.btn-premium {
    background-color: var(--primary-color) !important;
    background: var(--primary-color) !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 14px 28px !important;
    font-weight: 700 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 5px 15px rgba(216, 27, 96, 0.3) !important;
    width: 100%;
}

.btn-premium:hover {
    background-color: var(--primary-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(216, 27, 96, 0.4) !important;
    color: #FFFFFF !important;
}

/* --- MODERN LOADERS & SHIMMER EFFECTS --- */

/* Custom Thin Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
    opacity: 0.5;
}

/* Sidebar Specific Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 4px; /* Even thinner for sidebar */
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(208, 31, 41, 0.1);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.premium-loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999; /* Ensure it is above everything */
    transition: opacity 0.4s ease, visibility 0.4s;
    backdrop-filter: blur(5px);
}

.premium-loader-wrapper.fade-out {
    opacity: 0;
    visibility: hidden;
}

.premium-loader {
    display: flex;
    gap: 12px;
}

.premium-loader .dot {
    width: 18px;
    height: 18px;
    background-color: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(208, 31, 41, 0.3);
    animation: premium-pulse 1.4s infinite ease-in-out;
}

.premium-loader .dot:nth-child(2) { animation-delay: 0.2s; }
.premium-loader .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes premium-pulse {
    0%, 100% { transform: scale(0.7); opacity: 0.4; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* Shimmer / Skeleton Effect */
.shimmer {
    background: #f0f2f5;
    background-image: linear-gradient(to right, #f0f2f5 0%, #e1e4e8 20.21%, #f0f2f5 40.54%, #f0f2f5 100%);
    background-repeat: no-repeat;
    background-size: 1000px 100%;
    display: block;
    position: relative;
    animation: placeholderShimmer 1.8s linear infinite forwards;
    border-radius: var(--border-radius);
    overflow: hidden;
}

@keyframes placeholderShimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

/* Skeleton Components */
.skeleton-card {
    height: 160px;
    width: 100%;
    margin-bottom: 2rem;
}

.skeleton-table-row {
    height: 50px;
    width: 100%;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.skeleton-text {
    height: 16px;
    width: 100%;
    margin-bottom: 12px;
    border-radius: 4px;
}

.skeleton-title {
    height: 28px;
    width: 40%;
    margin-bottom: 24px;
    border-radius: 6px;
}

.skeleton-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
}

/* Page Entrance Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.5s ease forwards;
}

/* DataTables Processing / Loading Overlay */
.dataTables_processing {
    background: white !important;
    border: none !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
    border-radius: 12px !important;
    height: auto !important;
    padding: 24px !important;
    width: 220px !important;
    margin-left: -110px !important;
    top: 50% !important;
    font-weight: 700 !important;
    color: var(--primary-color) !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 12px !important;
}

.dataTables_processing::after {
    content: "";
    display: block;
    width: 100%;
    height: 4px;
    background: #f0f2f5;
    margin-top: 12px;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.dataTables_processing::before {
    content: "";
    position: absolute;
    bottom: 24px;
    left: 24px;
    width: 0;
    height: 4px;
    background: var(--primary-color);
    border-radius: 10px;
    animation: dt-loading 2s infinite ease-in-out;
    z-index: 1;
}

@keyframes dt-loading {
    0% { width: 0; left: 24px; }
    50% { width: calc(100% - 48px); left: 24px; }
    100% { width: 0; left: calc(100% - 24px); }
}
