:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --bg-color: #f3f4f6;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --error-color: #ef4444;
    --panel-width: 400px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

/* Header */
.header {
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.api-key-section {
    display: flex;
    gap: 0.5rem;
}

.api-key-section input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    width: 300px;
}

.api-key-section button {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.2s;
}

.api-key-section button:hover {
    background: var(--secondary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* RSS Section */
.rss-section {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    transition: margin-right 0.3s ease;
}

.rss-section.active {
    margin-right: 0;
}

.rss-section.collapsed {
    margin-right: calc(-1 * var(--panel-width));
}

.rss-header {
    margin-bottom: 2rem;
}

.rss-header h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.rss-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.rss-controls input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}

.rss-controls button {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.2s;
}

.rss-controls button:hover {
    background: var(--secondary-color);
}

.summarize-btn {
    background: var(--success-color) !important;
}

.summarize-btn:hover {
    background: #059669 !important;
}

.rss-feeds {
    display: grid;
    gap: 1.5rem;
}

.rss-item {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.rss-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.rss-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.rss-item .meta {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.rss-item p {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.rss-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.rss-item a:hover {
    text-decoration: underline;
}

/* Side Panel */
.side-panel {
    width: var(--panel-width);
    background: white;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

.side-panel.hidden {
    transform: translateX(var(--panel-width));
}

.panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    transition: background 0.2s;
}

.tab-btn:hover {
    background: var(--bg-color);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
}

.panel {
    display: none;
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.panel.active {
    display: block;
}

.panel h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.input-group input,
.input-group textarea {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}

.input-group button {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.2s;
}

.input-group button:hover {
    background: var(--secondary-color);
}

.status {
    padding: 0.5rem;
    margin: 0.5rem 0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.status.success {
    background: #d1fae5;
    color: #065f46;
}

.status.error {
    background: #fee2e2;
    color: #991b1b;
}

.status.info {
    background: #dbeafe;
    color: #1e40af;
}

/* Progress Bar */
.progress-container {
    margin: 1rem 0;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success-color);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    text-align: center;
}

/* Video Preview */
.video-preview {
    margin-top: 1rem;
}

.video-preview video {
    width: 100%;
    border-radius: 0.375rem;
}

/* Proxy Content */
.proxy-content {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 0.375rem;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 0.875rem;
}

/* Chat Messages */
.chat-messages {
    height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 0.375rem;
}

.message {
    margin-bottom: 1rem;
}

.message.user {
    text-align: right;
}

.message.assistant {
    text-align: left;
}

.message-content {
    display: inline-block;
    padding: 0.75rem;
    border-radius: 0.75rem;
    max-width: 80%;
}

.message.user .message-content {
    background: var(--primary-color);
    color: white;
}

.message.assistant .message-content {
    background: white;
    border: 1px solid var(--border-color);
}

.chat-input {
    display: flex;
    gap: 0.5rem;
}

.chat-input textarea {
    resize: none;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    font-size: 1.125rem;
    color: #6b7280;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .side-panel {
        width: 100%;
        height: 50vh;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
    
    .side-panel.hidden {
        transform: translateY(100%);
    }
    
    .rss-section.collapsed {
        margin-right: 0;
    }
}
