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

:root {
    --primary-bg: #f6f6f6;
    --primary-text: #1a1a1a;
    --secondary-text: #666;
    --border-color: #ddd;
    --button-bg: #e8e8e8;
    --button-hover: #d0d0d0;
    --accent-color: #4a90e2;
}

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

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 5px;
}

.subtitle {
    color: var(--secondary-text);
    font-size: 0.9em;
}

.stories-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.story-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    transition: all 0.2s ease;
}

.story-item:hover {
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.story-main {
    flex: 1;
}

.story-title {
    font-size: 1.3em;
    margin-bottom: 10px;
    font-weight: 600;
}

.story-title a {
    color: var(--accent-color);
    text-decoration: none;
}

.story-title a:hover {
    text-decoration: underline;
}

.story-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85em;
    color: var(--secondary-text);
}

.score {
    font-weight: 600;
    color: var(--primary-text);
}

.btn-brain {
    background: var(--button-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 1.3em;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-brain:hover {
    background: var(--button-hover);
    transform: scale(1.1);
}

.btn-brain:active {
    transform: scale(0.95);
}

.no-stories {
    text-align: center;
    padding: 40px 20px;
    color: var(--secondary-text);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--secondary-text);
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--primary-text);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.summary-text {
    font-size: 1em;
    line-height: 1.8;
    color: var(--primary-text);
}

.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--secondary-text);
}

.loading p {
    font-style: italic;
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .story-item {
        flex-direction: column;
        padding: 15px;
    }

    .story-meta {
        flex-wrap: wrap;
    }

    .btn-brain {
        align-self: flex-start;
    }
}
