:root {
    --bg-color: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --success: #22c55e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Pretendard', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Animated Bubbles */
.background-bubbles {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    overflow: hidden;
}
.bubble {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite alternate;
}
.bubble-1 {
    width: 400px; height: 400px;
    background: #4f46e5;
    top: -10%; left: -10%;
}
.bubble-2 {
    width: 500px; height: 500px;
    background: #0ea5e9;
    bottom: -20%; right: -10%;
    animation-delay: -5s;
}
.bubble-3 {
    width: 300px; height: 300px;
    background: #db2777;
    top: 40%; left: 40%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.2); }
}

/* Glass Panels */
.glass-panel, .glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Login View */
.login-container {
    width: 100%; max-width: 420px;
    margin: 15vh auto;
    padding: 40px;
    display: none;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s ease-out;
}
.login-container.active {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}
.login-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}
.badge {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    vertical-align: super;
}
.login-header p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}
.input-group ion-icon {
    position: absolute;
    left: 16px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 20px;
}
.input-group input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}
.input-group input:focus {
    border-color: var(--primary);
}

.security-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 25px;
}
.security-notice ion-icon {
    color: var(--success);
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}
.security-notice p {
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.5;
    text-align: left;
}
.security-notice strong {
    color: var(--success);
    font-size: 14px;
    margin-bottom: 4px;
    display: inline-block;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: #fff;
    border-radius: 12px;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    text-align: center;
}
.loading-overlay.active {
    display: flex;
}
.loader {
    width: 80px; height: 80px;
    margin-bottom: 20px;
}
.loader svg {
    width: 100%; height: 100%;
    animation: rotate 2s linear infinite;
}
.loader circle {
    fill: none;
    stroke: var(--primary);
    stroke-width: 4;
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
    animation: dash 1.5s ease-in-out infinite;
    stroke-linecap: round;
}
@keyframes rotate { 100% { transform: rotate(360deg); } }
@keyframes dash {
    0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 200; stroke-dashoffset: -35px; }
    100% { stroke-dasharray: 90, 200; stroke-dashoffset: -124px; }
}
.loading-overlay h3 { margin-bottom: 10px; font-size: 20px; }
.loading-overlay p { color: var(--text-muted); font-size: 14px; }


/* Dashboard View */
.dashboard-container {
    display: none;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.dashboard-container.active {
    display: block;
    opacity: 1;
}

.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    margin-bottom: 30px;
    border-radius: 20px;
}
.dash-title h2 { font-weight: 700; background: -webkit-linear-gradient(45deg, #3b82f6, #8b5cf6); -webkit-background-clip: text; -webkit-text-fill-color: transparent;}
.req-credits {
    display: flex; gap: 15px; align-items: center;
}
.req-group { display: flex; flex-direction: column; gap: 4px; }
.req-group label { font-size: 12px; color: var(--text-muted); }
.req-group input { 
    width: 70px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); 
    color: #fff; padding: 6px 10px; border-radius: 8px; text-align: center;
}
.btn-secondary { background: rgba(255,255,255,0.1); color: #fff; padding: 8px 16px; border-radius: 8px; }
.btn-secondary:hover { background: rgba(255,255,255,0.2); }
.btn-outline { background: transparent; border: 1px solid rgba(255,255,255,0.2); color: #fff; padding: 8px 16px; border-radius: 8px; }
.btn-outline:hover { background: rgba(255,255,255,0.1); }

/* Animated Arrows */
.req-credits-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(239, 68, 68, 0.1);
    padding: 10px 20px;
    border-radius: 16px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.bounce-arrow-left, .bounce-arrow-right {
    color: var(--danger);
    font-size: 24px;
}
.bounce-arrow-left { animation: bounceLeft 1s infinite alternate; }
.bounce-arrow-right { animation: bounceRight 1s infinite alternate; }

@keyframes bounceLeft {
    0% { transform: translateX(0); }
    100% { transform: translateX(8px); }
}
@keyframes bounceRight {
    0% { transform: translateX(0); }
    100% { transform: translateX(-8px); }
}

/* Remaining Credits Banner */
.remaining-credits-banner {
    margin-bottom: 30px;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(249, 115, 22, 0.15));
    border-color: rgba(249, 115, 22, 0.3);
}
.remaining-credits-banner h3 {
    font-size: 20px;
    color: #fff;
    font-weight: 700;
}
.remaining-stats {
    display: flex;
    gap: 30px;
}
.stat-item {
    text-align: center;
}
.stat-item .stat-label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.stat-item .stat-value {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
}
.stat-item.highlight .stat-value {
    color: #facc15;
}
.stat-item .stat-unit {
    font-size: 14px;
    color: var(--text-muted);
}

/* Ad Containers */
.ad-bottom {
    margin: 30px auto 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
}

.ad-side {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    height: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}
.ad-side.left { left: 20px; }
.ad-side.right { right: 20px; }

@media (max-width: 1200px) {
    .ad-side { display: none; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dash-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 15px;
    }
    .req-credits-wrapper {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    .req-credits {
        flex-wrap: wrap;
        justify-content: space-between;
    }
    .req-group {
        flex: 1 1 30%;
    }
    .req-group input {
        width: 100%;
    }
    .bounce-arrow-left, .bounce-arrow-right {
        display: none;
    }
    .remaining-credits-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 15px;
    }
    .remaining-stats {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
    }
    .stat-item .stat-value {
        font-size: 20px;
    }
    .ad-bottom {
        width: 100%;
        max-width: 100%;
    }
    
    .camcamp-link {
        position: relative;
        top: 0;
        left: 0;
        margin: 15px auto;
        width: calc(100% - 30px);
        max-width: 420px;
        justify-content: center;
    }
    .login-container {
        margin-top: 5vh;
    }
}

/* CamCamp Floating Link */
.camcamp-link {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(139, 92, 246, 0.2));
    border: 1px solid rgba(236, 72, 153, 0.4);
    border-radius: 16px;
    text-decoration: none;
    color: #fff;
    z-index: 1000;
    transition: all 0.3s ease;
    animation: glow 2s infinite alternate;
}
.camcamp-link:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 20px rgba(236, 72, 153, 0.3);
}
.camcamp-icon {
    font-size: 28px;
    color: #fbcfe8;
    display: flex;
}
.camcamp-text {
    display: flex;
    flex-direction: column;
}
.camcamp-text strong {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
}
.camcamp-text span {
    font-size: 12px;
    color: #fbcfe8;
}

@keyframes glow {
    from { box-shadow: 0 0 10px rgba(236, 72, 153, 0.2); }
    to { box-shadow: 0 0 20px rgba(236, 72, 153, 0.6); }
}
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.card {
    padding: 24px;
    display: flex;
    gap: 20px;
    align-items: center;
    transition: transform 0.3s ease;
}
.card:hover { transform: translateY(-5px); }
.card-icon {
    width: 60px; height: 60px;
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary);
    border-radius: 16px;
    display: flex; justify-content: center; align-items: center;
    font-size: 28px;
}
.card-content h3 { font-size: 15px; color: var(--text-muted); font-weight: 500; margin-bottom: 8px; }
.card-content h1 { font-size: 32px; font-weight: 700; margin-bottom: 12px;}
.card-content h1 .unit { font-size: 16px; color: var(--text-muted); font-weight: 400;}

.progress-bar {
    width: 100%; height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px; overflow: hidden;
}
.progress {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    width: 0%;
    transition: width 1s ease-out;
}

.highlight-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border-color: rgba(139, 92, 246, 0.3);
}
.highlight-card .card-icon { background: rgba(139, 92, 246, 0.2); color: #a78bfa;}
.sub-text { font-size: 14px; color: #cbd5e1; }

/* Table Container */
.table-container { padding: 30px; }
.table-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.table-header h3 { font-size: 20px; }

.filter-tabs {
    display: flex; gap: 10px; background: rgba(0,0,0,0.3); padding: 5px; border-radius: 12px;
}
.tab {
    padding: 8px 16px; background: transparent; color: var(--text-muted); border-radius: 8px;
}
.tab.active { background: var(--primary); color: #fff; }

.table-wrapper {
    overflow-x: auto;
}
table {
    width: 100%; border-collapse: separate; border-spacing: 0 8px;
}
th {
    text-align: left; padding: 12px 16px; color: var(--text-muted); font-weight: 500; font-size: 14px;
    border-bottom: 1px solid var(--glass-border);
}
td {
    padding: 16px; background: rgba(255,255,255,0.03); font-size: 15px;
}
tr td:first-child { border-radius: 12px 0 0 12px; }
tr td:last-child { border-radius: 0 12px 12px 0; }
tr:hover td { background: rgba(255,255,255,0.07); }

.grade-badge {
    padding: 4px 10px; border-radius: 8px; font-weight: 600; font-size: 14px;
}
.grade-A { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.grade-B { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.grade-C { background: rgba(234, 179, 8, 0.2); color: #facc15; }
.grade-D { background: rgba(249, 115, 22, 0.2); color: #fb923c; }
.grade-F { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.grade-P { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

.row-checkbox {
    width: 18px; height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}
