* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #2D3FE0;
    --primary-light: #4F5FFF;
    --primary-dark: #1E2BB0;
    --secondary: #00D1C1;
    --accent: #FF6B6B;
    --success: #2ECC71;
    --warning: #F1C40F;
    --error: #E74C3C;
    --background: #F8FAFC;
    --surface: #FFFFFF;
    --foreground: #1E293B;
    --muted: #64748B;
    --border: #E2E8F0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-lg: 20px;
    --header-height: 72px;
    --bottom-nav-height: 64px;
}

body {
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: none;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

/* Modern Header */
.app-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    color: var(--foreground);
    padding: 0 24px;
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.app-header-nav {
    display: flex;
    gap: 12px;
}

.app-header-btn {
    background: var(--background);
    color: var(--foreground);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-header-btn:hover {
    background: white;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Layout */
.app-content {
    display: flex;
    flex: 1;
}

.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid var(--border);
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
}

.sidebar-item {
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s;
    color: var(--muted);
    font-weight: 500;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-item:hover {
    background: var(--background);
    color: var(--foreground);
}

.sidebar-item.active {
    background: rgba(45, 63, 224, 0.08);
    color: var(--primary);
    font-weight: 700;
}

.sidebar-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Bottom Navigation (Mobile Only) */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    z-index: 100;
    padding: 0 10px;
}

.bottom-nav-list {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    list-style: none;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: none;
    padding: 4px 0;
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-icon {
    font-size: 20px;
}

/* Table Styles */
.table-container {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th {
    background: #F8FAFC;
    padding: 16px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

/* Status Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

/* Cards */
.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Buttons */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    width: auto;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(45, 63, 224, 0.3);
}

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

/* Form Inputs */
input, textarea, select {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    font-size: 15px;
    background: #FDFDFD;
    transition: all 0.2s;
}

/* Dashboard specific */
.welcome-banner {
    background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
    border-radius: var(--radius-lg);
    padding: 40px;
    color: white;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    border: 1px solid var(--border);
}

/* Hub Page Styles */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.hub-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .sidebar {
        display: none;
    }

    .bottom-nav {
        display: block;
    }

    .main-content {
        padding: 20px;
        padding-bottom: calc(var(--bottom-nav-height) + 20px);
    }

    .app-header {
        padding: 0 16px;
    }

    .app-header h1 {
        font-size: 18px;
    }

    .app-header-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .welcome-banner {
        padding: 24px;
        margin-bottom: 20px;
    }

    .welcome-banner h2 {
        font-size: 24px !important;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 28px !important;
    }

    .card {
        padding: 20px;
        margin-bottom: 16px;
    }

    /* Stack grid elements on mobile */
    .dashboard-layout {
        grid-template-columns: 1fr !important;
    }

    /* Responsive Table to Cards */
    .table thead {
        display: none;
    }

    .table tr {
        display: block;
        border-bottom: 8px solid var(--background);
        padding: 10px 0;
    }

    .table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 20px;
        border-bottom: 1px solid var(--border);
        text-align: right;
    }

    .table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--muted);
        text-align: left;
        font-size: 13px;
    }

    .table td:last-child {
        border-bottom: none;
    }

    .hub-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .hub-card {
        padding: 24px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 14px;
        width: 100%; /* Most buttons should be full width on mobile */
    }

    /* Subscription grid on mobile */
    .subscription-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .subscription-card-featured {
        transform: scale(1) !important;
    }
}

/* Footer & Sources */
.app-footer {
    background: #1e293b;
    color: #94a3b8;
    padding: 40px 20px;
    margin-top: auto;
    font-size: 13px;
    text-align: center;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.app-footer p {
    margin-bottom: 12px;
}

.sources {
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 12px;
    line-height: 1.5;
}

.sources strong {
    color: white;
    display: block;
    margin-bottom: 6px;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.loader {
    width: 40px; height: 40px; border: 4px solid #f3f3f3; 
    border-top: 4px solid var(--primary); border-radius: 50%; 
    animation: spin 1s linear infinite; margin-bottom: 16px;
}
