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

:root {
    --primary-color: #1a1a2e;
    --secondary-color: #16213e;
    --accent-color: #0f3460;
    --highlight-color: #e94560;
    --text-color: #eaeaea;
    --text-muted: #a0a0a0;
    --border-color: #2a2a3e;
    --news-panel: #1e3a5f;
    --claude-panel: #2d1b4e;
    --gpt-panel: #1b3a2d;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background: var(--accent-color);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    position: relative;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--highlight-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.refresh-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    padding: 0.75rem 1.5rem;
    background: var(--highlight-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: #d63650;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(233, 69, 96, 0.4);
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 4rem;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--highlight-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Grid Container */
.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    animation: fadeIn 0.5s ease-in;
    overflow-x: hidden;
    width: 100%;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Panel Styles */
.panel {
    background: var(--secondary-color);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: slideIn 0.5s ease-out;
    border-left: 4px solid var(--highlight-color);
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

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

.panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.4);
}

.panel.news {
    border-left-color: #3498db;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--news-panel) 100%);
}

.panel.claude {
    border-left-color: #9b59b6;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--claude-panel) 100%);
}

.panel.gpt {
    border-left-color: #2ecc71;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--gpt-panel) 100%);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.panel-type {
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.3);
}

.panel.news .panel-type {
    color: #3498db;
}

.panel.claude .panel-type {
    color: #9b59b6;
}

.panel.gpt .panel-type {
    color: #2ecc71;
}

.panel-timestamp {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.panel-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    line-height: 1.4;
}

.panel-content p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.panel-content .summary {
    margin-bottom: 1rem;
}

.panel-content .analysis {
    font-style: italic;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 5px;
    margin-top: 1rem;
}

/* News List Styles */
.news-list {
    overflow-y: auto;
    max-height: calc(80vh - 150px);
}

.news-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.news-item:last-child {
    border-bottom: none;
}

.news-title {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.news-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

/* Analysis Text Styles */
.analysis-text {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 5px;
    line-height: 1.6;
    overflow-y: auto;
    max-height: calc(80vh - 150px);
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

/* Panel Count */
.panel-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Empty Message */
.empty-message {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 2rem;
}

/* Ensure panel content scrolls */
.panel-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel-content .meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.panel-content a {
    color: var(--highlight-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.panel-content a:hover {
    color: #d63650;
    text-decoration: underline;
}

/* Footer */
footer {
    background: var(--accent-color);
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.3);
}

footer p {
    color: var(--text-muted);
    margin: 0.25rem 0;
}

#lastUpdate, #status {
    color: var(--text-color);
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .grid-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .panel {
        max-height: none;
    }

    .news-list,
    .analysis-text {
        max-height: 500px;
    }
}

@media (max-width: 900px) {
    .refresh-btn {
        position: static;
        margin-top: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }
}

/* Job Header */
.job-header {
    grid-column: 1 / -1;
    background: var(--accent-color);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--highlight-color);
}

.job-header:first-child {
    margin-top: 0;
}

.job-header h2 {
    color: var(--text-color);
    font-size: 1.3rem;
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
