/* Google Fonts - Prompt */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4f46e5;
    /* Indigo 600 */
    --secondary-color: #ec4899;
    /* Pink 500 */
    --accent-color: #06b6d4;
    /* Cyan 500 */
    --background-start: #f3f4f6;
    --background-end: #e5e7eb;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --sidebar-bg: #1e1b4b;
    /* Dark Indigo */
    --sidebar-text: #e0e7ff;
}

body {
    font-family: 'Prompt', sans-serif;
    background: linear-gradient(135deg, var(--background-start), var(--background-end));
    min-height: 100vh;
    color: var(--text-main);
    margin: 0;
}

/* Glassmorphism Utilities */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

.glass-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Gradient Text */
.text-gradient {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Sidebar Customization */
.sidebar-custom {
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #312e81 100%);
    color: var(--sidebar-text);
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-right: 4px solid var(--accent-color);
}

.sidebar-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-right: 4px solid var(--secondary-color);
    font-weight: 600;
}

/* Button Gradients */
.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    transition: filter 0.3s;
}

.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background: #f0f9ff;
}

/* Login Page Specifics */
.login-body {
    background: linear-gradient(135deg, #4f46e5 0%, #ec4899 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.login-box {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 420px;
}

/* Custom Input Fields */
.input-custom {
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    width: 100%;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-custom:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Table Styling */
.table-custom th {
    background-color: #f9fafb;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

.table-custom tr {
    transition: background-color 0.2s;
}

.table-custom tr:hover td {
    background-color: #fce7f3;
    /* very light pink hover */
}

/* ==========================================
   Responsive & Mobile Enhancements
   ========================================== */

/* Custom backdrop blur fallback classes */
.backdrop-blur-xs {
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* Sidebar transition utilities for CSS fallback since they are not compiled in assets/tailwind.css */
.-translate-x-full {
    transform: translateX(-100%) !important;
}
.translate-x-0 {
    transform: translateX(0) !important;
}

#sidebar {
    will-change: transform;
    backface-visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#sidebar-backdrop {
    will-change: opacity;
    transition: opacity 0.3s ease-in-out !important;
}

.opacity-0 {
    opacity: 0 !important;
}

.opacity-100 {
    opacity: 1 !important;
}

#close-sidebar {
    position: absolute !important;
    top: 1rem !important;
    right: 1rem !important;
    z-index: 60 !important;
}

/* Pure CSS layout rules for sidebar and backdrop on mobile/tablet */
@media (max-width: 1023px) {
    #sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        height: 100vh !important;
        width: 18rem !important; /* w-72 */
        z-index: 50 !important;
        transform: translateX(-100%) !important;
        display: flex !important;
    }
    
    #sidebar:not(.-translate-x-full) {
        transform: translateX(0) !important;
    }

    #sidebar-backdrop {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background-color: rgba(0, 0, 0, 0.45) !important;
        z-index: 40 !important;
    }
}

@media (min-width: 1024px) {
    .lg\:translate-x-0 {
        transform: translateX(0) !important;
    }
    .lg\:static {
        position: static !important;
    }
    .lg\:h-screen {
        height: 100vh !important;
    }
}

/* Responsive Tables inside Cards on mobile/tablet */
@media (max-width: 1024px) {
    .glass-card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-custom,
    table.w-full,
    table.min-w-full {
        min-width: 650px;
    }
    
    /* Make sure table container does not cut off shadows */
    .glass-card {
        padding-bottom: 1rem;
    }
}

/* Global Modal Responsiveness overrides for hardcoded widths */
@media (max-width: 768px) {
    .relative.p-8.border.w-96,
    .relative.p-8.border.w-\[600px\],
    [id*="Modal"] > div,
    [id*="modal"] > div {
        width: 92% !important;
        max-width: 95vw !important;
        margin-left: auto;
        margin-right: auto;
        padding: 1.5rem !important;
    }

    /* Form control adjustments on mobile */
    .input-custom {
        padding: 0.6rem 0.8rem;
    }
}