/* ===== AI NEWS 요약 - Custom Styles ===== */

:root {
    --primary: #5B7FFF;
    --primary-light: #8BA4FF;
    --primary-dark: #3D5BD6;
    --primary-subtle: #EEF2FF;
    --accent: #FF7EB3;
    --accent-light: #FFB3D1;
    --success: #00D68F;
    --warning: #FFB822;
    --danger: #FF5A5A;
    --info: #50C5FF;
    --bg: #F5F7FF;
    --surface: #FFFFFF;
    --border: #E4E9F2;
    --text: #2E3A59;
    --text-secondary: #8F9BB3;
    --text-muted: #C5CEE0;
    --shadow-sm: 0 2px 8px rgba(91,127,255,0.08);
    --shadow-md: 0 4px 20px rgba(91,127,255,0.12);
    --shadow-lg: 0 8px 40px rgba(91,127,255,0.16);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Base ===== */
* { box-sizing: border-box; }

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.875rem;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-weight: 600; color: var(--text); }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* ===== Navbar ===== */
.navbar {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 0;
    z-index: 1030;
    transition: var(--transition);
}
.navbar-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary) !important;
}
.navbar-brand i { font-size: 1.2rem; }
.nav-link {
    font-size: 0.83rem;
    font-weight: 500;
    color: var(--text-secondary) !important;
    padding: 0.5rem 0.85rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.nav-link:hover, .nav-link.active {
    color: var(--primary) !important;
    background: var(--primary-subtle);
}
.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 0.5rem;
    font-size: 0.83rem;
}
.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.75rem;
    font-size: 0.83rem;
}
.dropdown-item:hover { background: var(--primary-subtle); }

/* ===== Main ===== */
.main-content { flex: 1; }

/* ===== Footer ===== */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0 1rem;
    font-size: 0.78rem;
}

/* ===== Cards ===== */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    background: var(--surface);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 1rem 1.25rem;
}

/* ===== Buttons ===== */
.btn { font-size: 0.83rem; font-weight: 500; border-radius: var(--radius-sm); transition: var(--transition); }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(91,127,255,0.3); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-success { background: var(--success); border-color: var(--success); }

/* ===== Forms ===== */
.form-control, .form-select {
    font-size: 0.83rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.85rem;
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(91,127,255,0.15);
}
.form-label { font-weight: 500; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.35rem; }
.form-text { font-size: 0.75rem; }

/* ===== Tables ===== */
.table { font-size: 0.83rem; }
.table th { font-weight: 600; color: var(--text-secondary); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid var(--border); }
.table td { vertical-align: middle; border-color: var(--border); }
.table-hover tbody tr:hover { background: var(--primary-subtle); }

/* ===== Badges ===== */
.badge { font-weight: 500; font-size: 0.72rem; padding: 0.35em 0.65em; border-radius: 6px; }

/* ===== Auth Pages ===== */
.auth-wrapper {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.auth-card {
    max-width: 420px;
    width: 100%;
    animation: fadeInUp 0.5s ease;
}
.auth-card .card { border: none; box-shadow: var(--shadow-lg); border-radius: var(--radius-lg); }
.auth-card .card-body { padding: 2.5rem; }
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header i { font-size: 2.5rem; color: var(--primary); margin-bottom: 0.75rem; display: block; }
.auth-header h3 { font-size: 1.25rem; margin-bottom: 0.35rem; }
.auth-header p { color: var(--text-muted); font-size: 0.83rem; }

/* ===== Landing Page ===== */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}
.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite reverse;
}
.hero-content { position: relative; z-index: 1; }
.hero-content h1 { font-size: 2.5rem; font-weight: 700; color: #fff; line-height: 1.3; }
.hero-content p { color: rgba(255,255,255,0.85); font-size: 1.05rem; max-width: 600px; }
.hero-content .btn-light { font-weight: 600; padding: 0.7rem 2rem; border-radius: 50px; }

.feature-card {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: var(--transition);
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.feature-icon {
    width: 64px; height: 64px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 1.5rem;
}
.feature-card h5 { font-size: 1rem; margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.83rem; color: var(--text-secondary); margin-bottom: 0; }

.steps-section { background: var(--surface); }
.step-item { text-align: center; padding: 1.5rem; }
.step-number {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
    font-weight: 700;
    font-size: 1.1rem;
}
.step-item h5 { font-size: 0.95rem; }
.step-item p { font-size: 0.8rem; color: var(--text-secondary); }

.cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
    padding: 4rem 0;
    text-align: center;
    color: #fff;
}
.cta-section h2 { color: #fff; font-size: 1.75rem; }
.cta-section p { color: rgba(255,255,255,0.85); }

/* ===== Settings Page ===== */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
.category-item input[type="checkbox"] { display: none; }
.category-label {
    display: flex; align-items: center; justify-content: center;
    padding: 0.65rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.83rem;
    font-weight: 500;
    transition: var(--transition);
    text-align: center;
}
.category-label:hover { border-color: var(--primary-light); background: var(--primary-subtle); }
.category-item input:checked + .category-label {
    border-color: var(--primary);
    background: var(--primary-subtle);
    color: var(--primary);
}
.channel-option { cursor: pointer; }
.channel-option input[type="radio"] { display: none; }
.channel-card {
    padding: 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
    text-align: center;
}
.channel-card:hover { border-color: var(--primary-light); }
.channel-option input:checked + .channel-card {
    border-color: var(--primary);
    background: var(--primary-subtle);
}
.channel-card i { font-size: 2rem; margin-bottom: 0.5rem; display: block; }
.channel-card span { font-weight: 500; font-size: 0.85rem; }

.day-checks { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.day-check input { display: none; }
.day-label {
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
}
.day-label:hover { border-color: var(--primary-light); }
.day-check input:checked + .day-label {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

/* ===== News List ===== */
.news-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    background: var(--surface);
    transition: var(--transition);
    margin-bottom: 1rem;
}
.news-item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.news-meta { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.news-meta span { font-size: 0.75rem; color: var(--text-secondary); display: flex; align-items: center; gap: 0.3rem; }
.news-summary-preview {
    font-size: 0.83rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== News Detail ===== */
.news-detail-content { line-height: 1.8; font-size: 0.88rem; }
.news-detail-content ul { padding-left: 1.5rem; }
.news-detail-content li { margin-bottom: 0.5rem; }
.article-list .article-item {
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    transition: var(--transition);
}
.article-list .article-item:hover { background: var(--primary-subtle); }

/* ===== Admin ===== */
.stat-card {
    border: none;
    border-radius: var(--radius);
    padding: 1.25rem;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card .stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-card .stat-label { font-size: 0.75rem; color: var(--text-secondary); }

/* ===== Loading ===== */
.loading-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    flex-direction: column;
}
.loading-spinner { text-align: center; }

/* ===== Modal ===== */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.modal-header { padding: 1.25rem 1.5rem 0.75rem; }
.modal-body { padding: 0.75rem 1.5rem; font-size: 0.88rem; }
.modal-footer { padding: 0.75rem 1.5rem 1.25rem; }

/* ===== Animations ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.fade-in-up { animation: fadeInUp 0.5s ease forwards; }
.fade-in { animation: fadeIn 0.4s ease forwards; }
.stagger-1 { animation-delay: 0.1s; opacity: 0; }
.stagger-2 { animation-delay: 0.2s; opacity: 0; }
.stagger-3 { animation-delay: 0.3s; opacity: 0; }
.stagger-4 { animation-delay: 0.4s; opacity: 0; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero-content h1 { font-size: 1.75rem; }
    .hero-section { padding: 3rem 0; }
    .auth-card .card-body { padding: 1.75rem; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ===== Page Header ===== */
.page-header { margin-bottom: 1.5rem; padding-top: 1.5rem; }
.page-header h2 { font-size: 1.35rem; margin-bottom: 0.25rem; }
.page-header p { color: var(--text-secondary); font-size: 0.83rem; margin-bottom: 0; }

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-state i { font-size: 3rem; color: var(--text-muted); margin-bottom: 1rem; display: block; }
.empty-state h5 { color: var(--text-secondary); font-size: 1rem; }
.empty-state p { color: var(--text-muted); font-size: 0.83rem; }

/* ===== Status Badge ===== */
.status-success { background: rgba(0,214,143,0.12); color: #00a86b; }
.status-failed { background: rgba(255,90,90,0.12); color: #d63031; }
.status-active { background: rgba(0,214,143,0.12); color: #00a86b; }
.status-inactive { background: rgba(255,90,90,0.12); color: #d63031; }

/* AI Summary Markdown Overrides */
.news-detail-content h1, .news-detail-content h2, .news-detail-content h3,
.markdown-preview h1, .markdown-preview h2, .markdown-preview h3 {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: var(--primary-color) !important;
    margin-top: 1.25rem !important;
    margin-bottom: 0.75rem !important;
    border-bottom: 2px solid var(--primary-subtle);
    display: inline-block;
    padding-bottom: 2px;
}

.news-detail-content p, .markdown-preview p {
    margin-bottom: 0.75rem;
}

.news-detail-content li, .markdown-preview li {
    margin-bottom: 0.5rem;
}

.markdown-preview {
    font-size: 0.88rem;
    color: var(--text-main);
}

