/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

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

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Main content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Input section */
.input-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.brief-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.95rem;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    color: #718096;
    font-size: 0.85rem;
}

.generate-btn {
    padding: 14px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Output section */
.output-section {
    background: white;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.brief-container {
    display: flex;
    flex-direction: column;
}

.brief-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    text-align: center;
}

.brief-header h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.brief-meta {
    opacity: 0.9;
    font-size: 0.95rem;
}

.brief-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.brief-section {
    border-left: 4px solid #667eea;
    padding-left: 20px;
}

.brief-section h3 {
    color: #2d3748;
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: 600;
}

/* Title options */
.title-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.title-option {
    background: #f7fafc;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
    font-weight: 500;
    transition: all 0.3s ease;
}

.title-option:hover {
    background: #edf2f7;
    transform: translateX(5px);
}

/* Content outline */
.content-outline {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    white-space: pre-line;
    line-height: 1.7;
}

/* Key points */
.key-points {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.key-point {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: #f7fafc;
    border-radius: 8px;
}

.key-point::before {
    content: "🎯";
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Recommended sources */
.recommended-sources {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    white-space: pre-line;
    line-height: 1.7;
}

/* Brief actions */
.brief-actions {
    padding: 20px 30px;
    background: #f8fafc;
    display: flex;
    gap: 15px;
    justify-content: center;
    border-top: 1px solid #e2e8f0;
}

.primary-btn, .secondary-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn {
    background: #667eea;
    color: white;
}

.primary-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.secondary-btn {
    background: #e2e8f0;
    color: #4a5568;
}

.secondary-btn:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
}

/* Error section */
.error-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.error-container h3 {
    color: #e53e3e;
    font-size: 1.3rem;
}

.error-container p {
    color: #718096;
    max-width: 500px;
}

.retry-btn {
    padding: 10px 20px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: #c53030;
    transform: translateY(-1px);
}

/* Footer */
footer {
    text-align: center;
    padding: 20px 0;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
}

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

    header h1 {
        font-size: 2rem;
    }

    header p {
        font-size: 1rem;
    }

    .input-section,
    .brief-content {
        padding: 20px;
    }

    .brief-header {
        padding: 20px;
    }

    .brief-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .brief-actions button {
        width: 100%;
    }
}

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

    .brief-section {
        padding-left: 15px;
    }

    .title-option,
    .key-point {
        padding: 10px 12px;
    }
}

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

.btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Smooth transitions */
.input-section,
.output-section,
.error-section {
    transition: all 0.5s ease;
}

/* Copy feedback */
.copy-feedback {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #48bb78;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.copy-feedback.show {
    transform: translateX(0);
}
