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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8f4f3 0%, #f0e9e7 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #d4b5ad;
}

header h1 {
    font-size: 2rem;
    font-weight: 500;
    color: #7b4239;
    letter-spacing: -0.5px;
    margin-bottom: 1.5rem;
}

.description {
    font-size: 1rem;
    line-height: 1.7;
    color: #8b5852;
    max-width: 700px;
    margin: 0 auto;
    font-weight: 400;
}

main {
    flex: 1;
}

.input-section {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 2rem;
}

label {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    color: #7b4239;
    margin-bottom: 0.75rem;
}

#topic-input {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.2s ease;
    margin-bottom: 1rem;
}

#topic-input:focus {
    outline: none;
    border-color: #a4655c;
}

#generate-btn {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    color: white;
    background: linear-gradient(135deg, #a4655c 0%, #8b5852 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(123, 66, 57, 0.2);
}

#generate-btn:hover {
    background: linear-gradient(135deg, #8b5852 0%, #7b4239 100%);
    box-shadow: 0 6px 16px rgba(123, 66, 57, 0.3);
    transform: translateY(-1px);
}

#generate-btn:active {
    transform: scale(0.98) translateY(0);
}

#generate-btn:disabled {
    background: linear-gradient(135deg, #c89b92 0%, #b08780 100%);
    cursor: not-allowed;
    box-shadow: none;
}

.loading {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    border: 3px solid #f0e9e7;
    border-top: 3px solid #a4655c;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading p {
    color: #666;
    font-size: 0.95rem;
}

.error {
    background-color: #fff5f5;
    color: #c53030;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #c53030;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.results {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.headlines-section {
    margin-bottom: 3rem;
}

.headlines-section h2,
.keywords-section h2 {
    font-size: 1.25rem;
    font-weight: 500;
    color: #7b4239;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5c9c5;
}

#headlines-list {
    list-style: none;
}

#headlines-list li {
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #faf7f6 0%, #f8f4f3 100%);
    border-radius: 8px;
    border-left: 4px solid #a4655c;
    font-size: 1rem;
    color: #333;
    line-height: 1.5;
}

.keywords-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.keyword-tag {
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #f8f4f3 0%, #f0e9e7 100%);
    border: 1.5px solid #d4b5ad;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #7b4239;
    text-align: center;
    transition: all 0.2s ease;
}

.keyword-tag:hover {
    background: linear-gradient(135deg, #e5c9c5 0%, #d4b5ad 100%);
    border-color: #a4655c;
    transform: translateY(-2px);
}

.hidden {
    display: none !important;
}

footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid #d4b5ad;
    text-align: center;
    color: #8b5852;
    font-size: 0.9rem;
}

footer a {
    color: #7b4239;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

footer a:hover {
    color: #a4655c;
}

@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .input-section,
    .results {
        padding: 1.5rem;
    }

    .keywords-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    #headlines-list li {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.25rem;
    }

    .keywords-grid {
        grid-template-columns: 1fr 1fr;
    }
}
