/* Google Fonts - Pretendard */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

/* ===================================
   WASSO Platform - Blue Glassmorphism Theme
   =================================== */

:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-primary-light: #3b82f6;
    --color-sidebar-bg: #0c1929;
    --color-sidebar-hover: #162d50;
    --color-sidebar-active: #1e3a5f;
    --color-accent: #60a5fa;
    --color-bg: #e8eef6;
    --color-card: #ffffff;
    --color-text: #1e293b;
    --color-text-secondary: #64748b;
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-blur: 20px;
    --glass-shadow:
        0 8px 32px rgba(31, 38, 135, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', Roboto, sans-serif;
}

/* ===== Page Transition ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
main {
    animation: fadeIn 0.3s ease-out;
}

/* ===== Background with colored blobs for glass effect ===== */
.glass-bg {
    background: linear-gradient(135deg, #dbeafe 0%, #e8eef6 30%, #ede9fe 60%, #dbeafe 100%);
    position: relative;
    min-height: 100vh;
}
.glass-bg::before {
    content: '';
    position: fixed;
    top: -20%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(96,165,250,0.25) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
.glass-bg::after {
    content: '';
    position: fixed;
    bottom: -10%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139,92,246,0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

/* ===== Glassmorphism Sidebar ===== */
.sidebar-nav {
    background: linear-gradient(180deg, rgba(12, 25, 41, 0.95) 0%, rgba(22, 45, 80, 0.92) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(96, 165, 250, 0.1);
}

.sidebar-link.active {
    background: rgba(96, 165, 250, 0.15);
    color: white;
    position: relative;
    border: 1px solid rgba(96, 165, 250, 0.2);
}
.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background-color: #60a5fa;
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 12px rgba(96, 165, 250, 0.6);
}

/* ===== Glassmorphism Header ===== */
.header-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-border);
    position: relative;
}
.header-glass::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 50%, transparent 100%);
    opacity: 0.5;
}

/* legacy support */
.header-blue-accent {
    position: relative;
}
.header-blue-accent::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 50%, transparent 100%);
}

/* ===== Mobile Header (blue gradient stays, add glass border) ===== */
.mobile-header-glass {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.92) 0%, rgba(29, 78, 216, 0.95) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.15);
}

/* ===== Mobile Bottom Tab (Glassmorphism) ===== */
.mobile-bottom-tab {
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-top: 1px solid var(--glass-border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
}

/* ===== Glassmorphism Card ===== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    box-shadow:
        var(--glass-shadow),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.glass-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 16px 48px rgba(31, 38, 135, 0.18),
        0 4px 12px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* Basic card - also glass */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: 0.75rem;
    border: 1px solid var(--glass-border);
    box-shadow:
        var(--glass-shadow),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
    transform: translateY(-1px);
    box-shadow:
        0 12px 40px rgba(31, 38, 135, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* ===== Stat Card - Glass with hover lift ===== */
.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    box-shadow:
        var(--glass-shadow),
        0 0 0 1px rgba(255, 255, 255, 0.15);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 20px 50px rgba(37, 99, 235, 0.16),
        0 8px 20px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* ===== Modal - FULL WHITE, NO GLASS (가독성) ===== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-backdrop[data-static="true"] {
    cursor: default;
}
.modal-backdrop[data-static="true"].modal-shake .modal-content {
    animation: modal-shake 0.3s ease-in-out;
}
.modal-content {
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
    width: 100%;
    /* NO glass - full white for readability */
}

@keyframes modal-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* ===== Table - Glass ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table thead th {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    background: rgba(240, 244, 248, 0.7);
    border-bottom: 1px solid rgba(219, 228, 239, 0.6);
    text-align: left;
}
.data-table tbody td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--color-text);
    border-bottom: 1px solid rgba(241, 245, 249, 0.5);
}
.data-table tbody tr:hover {
    background: rgba(239, 246, 255, 0.5);
}

/* Glass table wrapper */
.table-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow:
        var(--glass-shadow),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* ===== Badge Styles ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    backdrop-filter: blur(4px);
}
.badge-blue { background: rgba(219, 234, 254, 0.8); color: #1d4ed8; border: 1px solid rgba(191, 219, 254, 0.5); }
.badge-green { background: rgba(220, 252, 231, 0.8); color: #15803d; border: 1px solid rgba(187, 247, 208, 0.5); }
.badge-red { background: rgba(254, 226, 226, 0.8); color: #b91c1c; border: 1px solid rgba(254, 202, 202, 0.5); }
.badge-yellow { background: rgba(254, 249, 195, 0.8); color: #a16207; border: 1px solid rgba(254, 240, 138, 0.5); }
.badge-gray { background: rgba(241, 245, 249, 0.8); color: #475569; border: 1px solid rgba(226, 232, 240, 0.5); }

/* ===== Toggle Switch ===== */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: #cbd5e1;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.25s ease;
}
.toggle-switch.active {
    background-color: var(--color-primary);
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.3);
}
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform 0.25s ease;
}
.toggle-switch.active::after {
    transform: translateX(20px);
}

/* ===== Auth Pages (Login / Register) ===== */
.auth-bg {
    background: linear-gradient(135deg, #0c1929 0%, #1e3a5f 40%, #2563eb 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.auth-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(96, 165, 250, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(37, 99, 235, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 60% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 40%);
    animation: authBgPulse 8s ease-in-out infinite alternate;
}
@keyframes authBgPulse {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Auth card - Glass style on dark bg */
.auth-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 1.5rem;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
}
.auth-card-inner {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 1rem;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Auth input on glass */
.auth-input {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(203, 213, 225, 0.6);
    border-radius: 0.75rem;
    transition: all 0.2s ease;
}
.auth-input:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Auth button */
.auth-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

/* ===== Glass Form Input ===== */
.glass-input {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(203, 213, 225, 0.4);
    border-radius: 0.75rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}
.glass-input:focus {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
}

/* ===== Blue Gradient Utilities ===== */
.bg-blue-gradient {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}
.bg-navy-gradient {
    background: linear-gradient(180deg, #0c1929 0%, #162d50 100%);
}

/* ===== Scrollbar ===== */
aside::-webkit-scrollbar { width: 4px; }
aside::-webkit-scrollbar-track { background: transparent; }
aside::-webkit-scrollbar-thumb { background-color: rgba(96, 165, 250, 0.3); border-radius: 2px; }

/* ===== Mobile font-size fix ===== */
@media screen and (max-width: 768px) {
    input, select, textarea { font-size: 16px !important; }
}

/* ===== Glass utility ===== */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
}
