/* Custom styles for HU ROBOTICS CRM */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&family=Hanken+Grotesk:wght@600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

body {
    background-color: #f3f7fa;
    background-image: 
        radial-gradient(at 0% 0%, rgba(200, 218, 255, 0.25) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(201, 230, 255, 0.25) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(211, 228, 254, 0.2) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(241, 245, 249, 0.3) 0px, transparent 50%);
    background-attachment: fixed;
    font-family: 'Noto Sans KR', sans-serif;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    display: inline-block;
    vertical-align: middle;
    line-height: 1;
}

.icon-fill {
    font-variation-settings: 'FILL' 1;
}

/* Custom Scrollbars - Premium Minimalist */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.3);
}

::-webkit-scrollbar-thumb {
    background: rgba(203, 213, 225, 0.6);
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.8);
}

/* Smooth Transitions & Perspective Configuration */
.transition-all-custom {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.nav-active {
    font-weight: 700;
    color: #00478d !important;
    border-right: 4px solid #00478d;
    background: linear-gradient(90deg, rgba(208, 225, 251, 0.4) 0%, rgba(208, 225, 251, 0) 100%);
    transform: translateX(2px);
}

/* 3D Depth Card (Glassmorphism + Lift) */
.premium-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 1.25rem;
    box-shadow: 
        0 10px 30px -10px rgba(0, 71, 141, 0.02), 
        0 1px 1px 0 rgba(255, 255, 255, 0.8) inset,
        0 24px 48px -12px rgba(0, 0, 0, 0.01);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.premium-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    transition: 0.6s ease-in-out;
    z-index: 1;
}

.premium-card:hover::before {
    left: 150%;
}

.premium-card:hover {
    transform: translateY(-6px) scale(1.008);
    box-shadow: 
        0 30px 60px -15px rgba(0, 71, 141, 0.08), 
        0 1px 3px rgba(0, 0, 0, 0.01),
        inset 0 1px 1px rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 71, 141, 0.2);
    background: rgba(255, 255, 255, 0.85);
}

/* 3D Tilt Effect Utilities */
.tilt-container {
    perspective: 1200px;
}

.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.15s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.25s ease;
    will-change: transform;
}

.tilt-card:hover {
    transform: scale3d(1.02, 1.02, 1.02);
    box-shadow: 
        0 30px 60px -15px rgba(0, 71, 141, 0.12),
        0 0 2px 1px rgba(0, 71, 141, 0.05),
        inset 0 1px 1px rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 71, 141, 0.2);
}

/* Glare Sheen Overlay */
.card-sheen {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 10;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 80%);
    border-radius: inherit;
    mix-blend-mode: overlay;
    transition: opacity 0.3s ease;
}

/* Neon Glow effects for critical components */
.glow-primary:hover {
    box-shadow: 
        0 0 25px rgba(0, 71, 141, 0.25),
        0 20px 40px rgba(0, 71, 141, 0.05);
    border-color: rgba(0, 71, 141, 0.4);
}

.glow-error:hover {
    box-shadow: 
        0 0 25px rgba(186, 26, 26, 0.2),
        0 20px 40px rgba(186, 26, 26, 0.05);
    border-color: rgba(186, 26, 26, 0.4);
}

.glow-success:hover {
    box-shadow: 
        0 0 25px rgba(34, 197, 94, 0.2),
        0 20px 40px rgba(34, 197, 94, 0.05);
    border-color: rgba(34, 197, 94, 0.4);
}

/* Premium Animated Buttons */
.btn-premium {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(0, 71, 141, 0.15);
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 71, 141, 0.25);
}

.btn-premium:active {
    transform: translateY(1px);
}

/* Shimmer pulse for loaders */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.shimmer {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Global animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.animate-scale-in {
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Gradient text utility */
.text-gradient-primary {
    background: linear-gradient(135deg, #00478d 0%, #006591 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hide spin-buttons in number inputs globally */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

/* Custom date picker indicator cover trick */
.date-picker-custom::-webkit-calendar-picker-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: auto;
    color: transparent;
    background: transparent;
    cursor: pointer;
}

/* Mobile Typography & Layout Optimization */
@media (max-width: 767.98px) {
    body {
        font-size: 14px;
        letter-spacing: -0.02em;
        line-height: 1.5;
    }
    
    /* Bento Grid KPI Widgets for Mobile */
    .tilt-container {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    .premium-card {
        border-radius: 1rem;
        padding: 1.25rem;
    }

    .premium-card:hover {
        transform: translateY(-2px) scale(1.002);
    }
    
    /* Header optimization */
    header {
        height: 56px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* Premium Mobile Card Layout (Alternative to Tables) */
.mobile-card {
    background: #ffffff;
    border: 1px solid rgba(224, 227, 230, 0.7);
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.015);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.mobile-card:hover, .mobile-card:active {
    border-color: rgba(0, 71, 141, 0.3);
    box-shadow: 0 8px 20px rgba(0, 71, 141, 0.05);
    transform: translateY(-2px);
}

.mobile-card-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
}

/* Mobile Bottom Sheet (Sliding Modals) */
@media (max-width: 767.98px) {
    .mobile-bottom-sheet {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
        border-top-left-radius: 1.5rem !important;
        border-top-right-radius: 1.5rem !important;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
        max-height: 92vh !important;
    }

    .mobile-bottom-sheet.sheet-active {
        transform: translateY(0) !important;
    }
    
    .mobile-bottom-sheet-drag-bar {
        width: 36px;
        height: 5px;
        background-color: #cbd5e1;
        border-radius: 9999px;
        margin: 8px auto 4px auto;
        display: block;
    }
}

/* Bottom Nav Link Active State */
.mobile-nav-active {
    color: #00478d !important;
}

.mobile-nav-active span {
    font-variation-settings: 'FILL' 1, 'wght' 600;
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.mobile-nav-active span.material-symbols-outlined {
    color: #00478d;
}

/* Premium Automatic Bottom Sheet Conversion for Mobile Modals */
@media (max-width: 767.98px) {
    /* Set all modal overlays to align contents at bottom (flex-end) */
    div[id$="-modal"], div[id^="modal-"], div[id^="modal-new-"] {
        display: flex !important; /* Force flex for layout */
        align-items: flex-end !important;
        justify-content: center !important;
        padding: 0 !important;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease-in-out !important;
    }

    div[id$="-modal"]:not(.hidden), div[id^="modal-"]:not(.hidden), div[id^="modal-new-"]:not(.hidden) {
        opacity: 1;
        pointer-events: auto;
    }

    /* Convert inner cards to bottom sheets */
    div[id$="-modal"] > div, div[id^="modal-"] > div, div[id^="modal-new-"] > div {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 1.5rem 1.5rem 0 0 !important;
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
        max-height: 92vh !important;
        margin-bottom: 0 !important;
        margin-top: auto !important;
        display: flex;
        flex-direction: column;
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.08) !important;
    }

    div[id$="-modal"]:not(.hidden) > div, div[id^="modal-"]:not(.hidden) > div, div[id^="modal-new-"]:not(.hidden) > div {
        transform: translateY(0);
    }

    /* Visual Swipe Drag Indicator Bar */
    div[id$="-modal"] > div::before, div[id^="modal-"] > div::before, div[id^="modal-new-"] > div::before {
        content: '';
        width: 40px;
        height: 5px;
        background-color: #e2e8f0;
        border-radius: 9999px;
        margin: 10px auto 2px auto;
        display: block;
        flex-shrink: 0;
    }
    
    /* Ensure content inside sheets remains scrollable and doesn't get cut */
    div[id$="-modal"] form, div[id^="modal-"] form, div[id^="modal-new-"] form {
        overflow-y: auto;
        max-height: calc(92vh - 80px) !important;
    }
}


