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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
}

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

/* Header */
.header {
    background: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-stats {
    display: flex;
    gap: 2rem;
}

.stat {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

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

/* Sidebar */
.sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.sessions-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.session-item {
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.session-item:hover {
    background: #e9ecef;
}

.session-item.active {
    background: #e3f2fd;
    border-left-color: #2196f3;
}

.session-item.issue {
    background: #fff3cd;
    border-left-color: #ff9800;
}

.session-item.error {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.session-item.done {
    background: #d4edda;
    border-left-color: #28a745;
}

.session-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.session-status.active {
    background: #2196f3;
    color: white;
}

.session-status.paused {
    background: #ff9800;
    color: white;
}

.session-status.done {
    background: #28a745;
    color: white;
}

.session-status.error {
    background: #dc3545;
    color: white;
}

.session-url {
    font-size: 0.85rem;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-time {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.25rem;
}

/* Main Panel */
.main-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    background: #f8f9fa;
}

.tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.tab:hover {
    background: #e9ecef;
}

.tab.active {
    color: #2196f3;
    border-bottom-color: #2196f3;
    background: white;
}

/* Tab Content */
.tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-primary {
    background: #2196f3;
    color: white;
}

.btn-primary:hover {
    background: #1976d2;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
}

.btn:hover {
    opacity: 0.9;
}

/* Logs */
.logs-controls {
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.logs-container {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    height: 500px;
    overflow-y: auto;
}

.log-entry {
    margin-bottom: 0.5rem;
    padding: 0.25rem;
}

.log-entry.INFO {
    color: #4ec9b0;
}

.log-entry.WARN {
    color: #dcdcaa;
}

.log-entry.ERROR {
    color: #f48771;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background: #f8f9fa;
    font-weight: 600;
}

tr:hover {
    background: #f8f9fa;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
}

.close {
    float: right;
    font-size: 1.5rem;
    cursor: pointer;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: #999;
}

/* Settings */
.settings-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.settings-section h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

/* Content Viewer */
.scraped-content-viewer {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
}

.scraped-content-viewer h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.content-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.content-info p {
    margin: 0.5rem 0;
}

.content-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.content-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.content-tab:hover {
    color: #2196f3;
}

.content-tab.active {
    color: #2196f3;
    border-bottom-color: #2196f3;
}

.content-view {
    display: none;
}

.content-view.active {
    display: block;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
}
