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

body {
    font-family: 'Segoe UI', Tequila, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 40px 20px;
    animation: fadeInDown 0.8s ease-out;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
    margin-bottom: 15px;
}

.news-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    margin-top: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.news-status:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.news-status:active {
    transform: translateY(0);
}

.status-icon {
    font-size: 1.1em;
}

.mode-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    animation: fadeIn 1s ease-out;
}

.mode-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 30px;
    font-size: 1em;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.mode-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.button-container {
    text-align: center;
    margin: 40px 0;
    animation: fadeIn 1s ease-out;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.update-btn {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
    color: white;
    border: none;
    padding: 15px 35px;
    font-size: 1em;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.update-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.update-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.news-preview {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.6s ease-out;
}

.news-preview h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.news-list {
    display: grid;
    gap: 15px;
}

.news-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.news-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
    border-color: #667eea;
}

.news-item.selected {
    background: #e8eaf6;
    border-color: #667eea;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.2);
}

.news-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
    gap: 10px;
}

.news-item-category {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    white-space: nowrap;
}

.news-item-source {
    color: #888;
    font-size: 0.85em;
}

.news-item-title {
    color: #222;
    font-size: 1.05em;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.news-item-summary {
    color: #666;
    font-size: 0.9em;
    line-height: 1.6;
    margin-bottom: 10px;
}

.news-item-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.news-keyword {
    background: #dee2e6;
    color: #495057;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 500;
}

.generate-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 20px 50px;
    font-size: 1.3em;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.generate-btn:active {
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 1.2em;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.loading {
    text-align: center;
    color: white;
    padding: 40px;
    animation: fadeIn 0.5s ease-out;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.result-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.6s ease-out;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.result-header h2 {
    color: #333;
    font-size: 1.8em;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.blog-post {
    border: 2px solid #f0f0f0;
    border-radius: 15px;
    padding: 30px;
    background: #fafafa;
}

.post-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.category {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.date {
    color: #888;
    font-size: 0.9em;
    display: flex;
    align-items: center;
}

.post-title {
    color: #222;
    font-size: 1.8em;
    margin-bottom: 20px;
    line-height: 1.4;
}

.post-content {
    color: #444;
    font-size: 1.05em;
    line-height: 1.8;
    margin-bottom: 20px;
}

.post-content h4 {
    color: #333;
    margin: 25px 0 15px;
    font-size: 1.3em;
}

.post-content p {
    margin-bottom: 15px;
}

.post-content ul, .post-content ol {
    margin-left: 25px;
    margin-bottom: 15px;
}

.post-content li {
    margin-bottom: 8px;
}

.post-content strong {
    color: #667eea;
    font-weight: 600;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.tag {
    background: #e8eaf6;
    color: #5c6bc0;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 500;
}

footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    padding: 20px;
    opacity: 0.9;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
}

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

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

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

@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .subtitle {
        font-size: 1em;
    }

    .generate-btn {
        padding: 15px 35px;
        font-size: 1.1em;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .post-title {
        font-size: 1.5em;
    }

    .blog-post {
        padding: 20px;
    }
}
