/* React 앱의 스타일을 Spring으로 변환한 CSS 파일 */

/* role="menu"인 div 숨김 (드롭다운 등) */
div[role="menu"] {
    display: none !important;
}

/* Reset and Base Styles */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: #334155;
}

/* Container Layout */
.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 220px;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    padding: 32px 0 24px 0;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.sidebar .logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 32px 32px 32px;
}

.sidebar .logo-img {
    width: 40px; 
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: flex; 
    align-items: center; 
    justify-content: center;
    color: #fff; 
    font-size: 22px; 
    font-weight: bold;
}

.sidebar .logo-title {
    font-size: 18px; 
    font-weight: 700; 
    color: #1e293b;
}

.sidebar .logo-desc {
    font-size: 12px; 
    color: #64748b; 
    margin-top: 2px;
}

.sidebar nav {
    flex: 1;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    display: flex; 
    align-items: center;
    gap: 14px;
    padding: 12px 32px;
    font-size: 16px;
    color: #334155;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.sidebar li.active, 
.sidebar li:hover {
    background: #f1f5f9;
    color: #2563eb;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 220px;
    min-height: 100vh;
}

/* Header Styles */
.header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-left {
    display: flex; 
    align-items: center; 
    gap: 24px;
}

.header .search-box {
    position: relative;
}

.header .search-input {
    width: 260px;
    padding: 8px 16px 8px 40px;
    border: 1px solid #cbd5e1;
    border-radius: 24px;
    font-size: 15px;
    background: #f1f5f9;
    outline: none;
}

.header .search-input:focus {
    border-color: #3b82f6;
    background: #fff;
}

.header .search-icon {
    position: absolute; 
    left: 12px; 
    top: 50%; 
    transform: translateY(-50%);
    color: #94a3b8; 
    width: 18px; 
    height: 18px;
}

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

.header .btn {
    padding: 8px 20px;
    border-radius: 24px;
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.header .btn-primary {
    background: #22c55e; 
    color: #fff;
}

.header .btn-primary:hover { 
    background: #16a34a; 
}

.header .btn-secondary {
    background: #f1f5f9; 
    color: #334155;
}

.header .btn-secondary:hover { 
    background: #e2e8f0; 
}

/* Tab Styles */
.tabs {
    background: #fff;
    padding: 0 40px;
    display: flex;
    gap: 8px;
}

.tab {
    padding: 8px 20px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 500;
    background: #f1f5f9;
    color: #64748b;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.tab.active, 
.tab:hover {
    background: #2563eb;
    color: #fff;
}

/* Date Selection */
.date-selection {
    padding: 24px 40px 0 40px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.date-form {
    display: flex;
    gap: 16px;
    align-items: center;
}

.date-form label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-form input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
}

/* Button Styles */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* Content Sections */
.featured-section, 
.posts-section {
    padding: 32px 40px 40px 40px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.post-card {
    background: #fff;
    border-radius: 14px;
    padding: 28px 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    border: 1px solid #f1f5f9;
}

.post-title {
    font-size: 20px;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 8px;
    cursor: pointer;
    color: #2563eb;
}

.post-title:hover {
    text-decoration: underline;
}

.post-content {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 16px;
}

.post-summary {
    margin-top: 6px;
    color: #64748b;
    font-size: 15px;
    padding-left: 20px;
    border-left: 3px solid #e2e8f0;
    background: #f8fafc;
    padding: 12px 20px;
    border-radius: 6px;
}

/* Articles List */
.articles-list {
    margin-top: 16px;
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px;
}

.articles-list .card {
    margin-bottom: calc(1rem + 1px) !important;
}

.article-item {
    margin-bottom: 16px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.article-item:last-child {
    margin-bottom: 0;
}

.article-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #eee;
}

.article-content {
    flex: 1;
}

.article-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.article-title a {
    color: #2563eb;
    text-decoration: underline;
}

.article-summary {
    font-size: 14px;
    color: #64748b;
    margin: 4px 0 2px 0;
}

.article-press {
    font-size: 13px;
    color: #94a3b8;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    align-items: center;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.error {
    color: #dc2626;
    text-align: center;
    padding: 40px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

/* Setting Page Styles */
.setting-content {
    padding: 20px;
    background: #f8fafc;
    min-height: 100vh;
}

.setting-container {
    max-width: 1200px;
    margin: 0 auto;
}

.setting-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.setting-col-md-6 {
    flex: 1;
}

/* Panel Styles */
.setting-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 20px;
    overflow: hidden;
}

.setting-panel h2 {
    background: #f8fafc;
    padding: 20px;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
}

.setting-panel-content {
    padding: 20px;
}

/* Category Section */
.category-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.category-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.category-row {
    display: flex;
    gap: 15px;
    align-items: end;
}

.category-col {
    flex: 1;
}

.category-col:last-child {
    flex: 0 0 auto;
}

.category-col label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #374151;
}

.input-wrapper {
    position: relative;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control:disabled {
    background-color: #f9fafb;
    color: #6b7280;
}

/* Checkbox Styles */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.checkbox-wrapper label {
    margin: 0;
    font-size: 14px;
}

/* Button Styles for Settings */
.btn-primary {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.btn-warning {
    background: #f59e0b;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-warning:hover {
    background: #d97706;
}

/* Table Styles */
.category-tables {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.table-wrapper {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.setting-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.setting-table th {
    background: #f9fafb;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.setting-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.setting-table tr:hover {
    background: #f9fafb;
}

.setting-table tr.selected {
    background: #eff6ff;
}

.setting-table tr.selected td {
    color: #1d4ed8;
}

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

.text-center {
    text-align: center;
}

/* Email Form Styles */
.email-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.email-row {
    display: flex;
    gap: 15px;
    align-items: end;
}

.email-col {
    flex: 1;
}

.email-col.button-col {
    flex: 0 0 auto;
    display: flex;
    gap: 10px;
}

.email-col label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #374151;
}

/* Summary Settings */
.summary-settings {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 500;
    color: #374151;
}

.form-group input[type="number"] {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

/* Subscription Settings */
.subscription-settings {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-inline {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.radio-inline input[type="radio"] {
    margin: 0;
}

.radio-inline label {
    margin: 0;
    cursor: pointer;
}

/* Save Button */
.save-button-container {
    text-align: center;
    margin-top: 30px;
}

.save-button-container .btn-primary {
    padding: 12px 30px;
    font-size: 16px;
}

/* News Platform Footer */
.news-platform-footer {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 16px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #334155;
    font-size: 14px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    min-height: 60px;
    margin-top: auto;
}

/* page-content-wrapper 내에서 푸터가 하단에 위치하도록 */
.page-content-wrapper .news-platform-footer {
    margin-top: auto;
    order: 999;
}

.news-platform-footer .footer-left,
.news-platform-footer .footer-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.news-platform-footer span {
    color: #334155;
    font-weight: 700;
}

.news-platform-footer a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.news-platform-footer a:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .setting-row {
        flex-direction: column;
    }
    
    .category-row, 
    .email-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .category-col, 
    .email-col {
        flex: 1;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .date-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tabs {
        flex-wrap: wrap;
        padding: 0 20px;
    }
    
    .featured-section, 
    .posts-section {
        padding: 20px;
    }
    
    .news-platform-footer {
        flex-direction: column;
        gap: 12px;
        padding: 16px 20px;
        text-align: center;
    }
}
