/* RSS Reader - ERPNext/Frappe UI inspiriertes Design */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* ERPNext Farben */
    --primary: #2490EF;
    --primary-dark: #1976D2;
    --primary-light: #E8F5FF;
    
    --gray-50: #FAFBFC;
    --gray-100: #F5F7FA;
    --gray-200: #E9ECEF;
    --gray-300: #D1D8DD;
    --gray-400: #A8B4C0;
    --gray-500: #6C7680;
    --gray-600: #475569;
    --gray-700: #364152;
    --gray-800: #2E3A47;
    --gray-900: #1E293B;
    
    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;
    
    --text-primary: #1E293B;
    --text-secondary: #475569;
    --text-muted: #6C7680;
    
    --border: #E9ECEF;
    --border-dark: #D1D8DD;
    
    --bg-white: #FFFFFF;
    --bg-page: #F5F7FA;
    
    --sidebar-width: 260px;
    --header-height: 60px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
    overflow-x: hidden;
}

/* Layout */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-white);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    z-index: 100;
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-page);
}

/* Sidebar Header */
.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-white);
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.admin-link {
    font-size: 18px;
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.2s;
    padding: 4px;
}

.admin-link:hover {
    color: var(--primary);
}

/* Sidebar Sections */
.sidebar-section {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.section-header {
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.refresh-btn {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s, transform 0.3s;
    padding: 4px;
}

.refresh-btn:hover {
    color: var(--primary);
    transform: rotate(90deg);
}

/* Sidebar Items */
.sidebar-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 20px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    gap: 10px;
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    background: var(--gray-50);
    color: var(--text-primary);
}

.sidebar-item.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 500;
}

.sidebar-item .icon {
    font-size: 16px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.sidebar-item .label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-item .count {
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
}

.feed-item {
    padding-left: 50px;
    font-size: 13px;
}

/* Content Header */
.content-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-left h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    letter-spacing: -0.02em;
}

.article-count {
    font-size: 13px;
    color: var(--text-muted);
}

.icon-button {
    background: var(--bg-white);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.icon-button:hover {
    background: var(--gray-50);
    border-color: var(--primary);
    color: var(--primary);
}

/* Articles Container */
.articles-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

/* Article Card - ERPNext Stil */
.article-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: all 0.2s;
    cursor: pointer;
}

.article-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-dark);
    transform: translateY(-1px);
}

.article-card.read {
    opacity: 0.6;
}

.article-card.read:hover {
    opacity: 1;
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.article-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.feed-badge {
    background: var(--gray-100);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.article-date {
    font-size: 12px;
    color: var(--text-muted);
}

.article-actions {
    display: flex;
    gap: 8px;
}

.action-button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    padding: 4px;
}

.action-button:hover {
    color: var(--primary);
    transform: scale(1.15);
}

.action-button.active {
    color: var(--warning);
}

.article-content {
    cursor: pointer;
}

.article-image {
    width: 100%;
    height: 180px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

.article-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 8px;
}

.article-author {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* Article Modal - ERPNext Stil */
.article-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    overflow-y: auto;
    padding: 40px 20px;
}

.article-modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.article-modal-content {
    background: var(--bg-white);
    border-radius: 8px;
    max-width: 800px;
    width: 100%;
    margin: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

.close-button {
    background: var(--gray-100);
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    line-height: 1;
    transition: all 0.2s;
}

.close-button:hover {
    background: var(--gray-200);
    color: var(--text-primary);
}

.article-modal-body {
    padding: 32px;
}

.article-detail-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.article-detail-title {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 12px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.article-detail-author {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
    font-style: italic;
}

.article-detail-image {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.article-detail-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.article-detail-content p {
    margin-bottom: 16px;
}

.article-detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 20px 0;
    border: 1px solid var(--border);
}

.article-detail-content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.article-detail-content a:hover {
    text-decoration: underline;
}

.article-detail-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.read-more-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.read-more-link:hover {
    color: var(--primary-dark);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Error Message */
.error-message {
    background: #FEF2F2;
    color: var(--danger);
    padding: 16px;
    border-radius: 6px;
    text-align: center;
    margin: 24px;
    border: 1px solid #FEE2E2;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 240px;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-header {
        padding: 12px 16px;
    }
    
    .articles-container {
        padding: 16px;
    }
    
    .article-card {
        padding: 12px 16px;
    }
    
    .article-modal {
        padding: 20px 12px;
    }
    
    .article-modal-body {
        padding: 20px;
    }
    
    .article-detail-title {
        font-size: 22px;
    }
}

/* Scrollbar Styling - ERPNext Stil */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-card {
    animation: fadeIn 0.3s ease-out;
}

/* Focus States */
button:focus,
.sidebar-item:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .sidebar,
    .content-header,
    .article-actions {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .article-card {
        page-break-inside: avoid;
        border: 1px solid var(--border);
    }
}
