/* CSS Variables */
:root {
    --primary-color: #e74c3c;
    --primary-hover: #c0392b;
    --secondary-color: #3498db;
    --secondary-hover: #2980b9;
    --background-color: #f5f6fa;
    --card-background: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #dcdde1;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--primary-color), #c0392b);
    border-radius: var(--border-radius);
    color: white;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.logo-container {
    margin-bottom: 15px;
}

.logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    padding: 10px;
    box-shadow: var(--shadow);
}

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

.tagline {
    font-size: 1rem;
    opacity: 0.9;
}

/* Main Content */
main {
    flex: 1;
}

/* Controls Section */
.controls {
    background: var(--card-background);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.control-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
    transition: var(--transition);
}

.control-group select:hover {
    border-color: var(--secondary-color);
}

.control-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Button Styles */
.button-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
    min-width: 150px;
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #c0392b);
    color: white;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), #2980b9);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* Output Section */
.output {
    background: var(--card-background);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    min-height: 200px;
}

#headlines-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.placeholder-text p {
    margin-bottom: 10px;
}

.placeholder-text .disclaimer {
    font-size: 0.9rem;
    color: var(--primary-color);
}

/* Headline Card */
.headline-card {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    padding: 20px;
    border-radius: 10px;
    border-left: 5px solid var(--primary-color);
    animation: slideIn 0.5s ease;
}

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

.headline-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.4;
}

.headline-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.headline-source {
    font-style: italic;
}

.headline-date {
    color: #636e72;
}

.headline-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Actions Section */
.actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.btn-action {
    background: var(--card-background);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    flex: 1;
    min-width: 120px;
}

.btn-action:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 25px 20px;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

.disclaimer-footer {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.powered-by {
    font-size: 0.9rem;
}

.powered-by a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.powered-by a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    box-shadow: var(--shadow-hover);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

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

    header {
        padding: 20px 15px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 0.9rem;
    }

    .logo {
        width: 60px;
        height: 60px;
    }

    .controls {
        padding: 20px;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .checkbox-group {
        flex-direction: column;
        gap: 10px;
    }

    .headline-text {
        font-size: 1.1rem;
    }

    .headline-meta {
        flex-direction: column;
        gap: 5px;
    }

    .actions {
        flex-direction: column;
    }

    .btn-action {
        width: 100%;
    }
}

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

    .headline-text {
        font-size: 1rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #1a1a2e;
        --card-background: #16213e;
        --text-primary: #eaeaea;
        --text-secondary: #a0a0a0;
        --border-color: #2a2a4a;
    }

    .control-group select {
        background-color: #0f0f23;
        color: var(--text-primary);
    }

    .headline-card {
        background: linear-gradient(135deg, #2d3436, #353b48);
    }

    .headline-text {
        color: #ffeaa7;
    }
}

/* Print styles */
@media print {
    .controls,
    .actions,
    .button-group {
        display: none;
    }

    .headline-card {
        break-inside: avoid;
        border: 1px solid #333;
    }
}
