/* Daily Briefing Agent - Professional Styling */
/* ============================================= */

/* Modern CSS Reset and Variables */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --border-color: #e2e8f0;
    --border-focus: #3b82f6;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    font-feature-settings: 'kern' 1, 'liga' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Page Header */
.page-header {
    text-align: center;
    padding: 3rem 2rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="rgba(255,255,255,0.1)"><polygon points="0,0 1000,0 1000,100 0,100"/></svg>');
    background-size: 100px 100px;
    opacity: 0.1;
}

.page-header h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgb(0 0 0 / 0.1);
}

/* Main Content */
.main-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
    position: relative;
}

/* Input Section */
.input-section {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 3rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    position: relative;
    backdrop-filter: blur(10px);
    margin-bottom: 3rem;
}

.input-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%);
    border-radius: var(--radius-xl);
    z-index: -1;
}

.input-section textarea {
    width: 100%;
    min-height: 300px;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    line-height: 1.6;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    resize: vertical;
    transition: var(--transition);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.input-section textarea::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.input-section textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1), var(--shadow-md);
    transform: translateY(-1px);
}

.generate-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
}

.generate-btn:hover::before {
    left: 100%;
}

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

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

/* Output Section */
.output-section {
    display: none;
    justify-content: center;
    margin-top: 3rem;
    animation: fadeInUp 0.6s ease-out;
}

.briefing-content {
    width: 100%;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 3rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    position: relative;
    backdrop-filter: blur(10px);
}

.briefing-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%);
    border-radius: var(--radius-xl);
    z-index: -1;
}

.briefing-content h2 {
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    margin-top: 3rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-color);
    position: relative;
}

.briefing-content h2:first-child {
    margin-top: 0;
}

.briefing-content h2::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--primary-light);
}

.briefing-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    line-height: 1.7;
}

.briefing-content ul {
    color: var(--text-secondary);
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.briefing-content li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
    position: relative;
}

.briefing-content li::marker {
    color: var(--primary-color);
    font-weight: bold;
}

.briefing-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Loading Modal */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeInUp 0.3s ease-out;
}

.loading-content {
    background: var(--bg-primary);
    padding: 3rem;
    border-radius: var(--radius-xl);
    text-align: center;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
    position: relative;
    border: 1px solid var(--border-color);
}

.loading-content .close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.loading-content .close-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

.loading-content p {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.step {
    padding: 0.75rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: var(--transition);
    border-radius: var(--radius);
    background: var(--bg-tertiary);
}

.step.active {
    color: var(--primary-color);
    font-weight: 600;
    background: rgb(59 130 246 / 0.1);
    transform: translateX(5px);
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 30px;
    right: 30px;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    color: white;
    display: none;
    align-items: center;
    gap: 1rem;
    z-index: 1100;
    box-shadow: var(--shadow-xl);
    min-width: 300px;
    animation: fadeInUp 0.3s ease-out;
    backdrop-filter: blur(10px);
}

.toast.success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
}

.toast.error {
    background: linear-gradient(135deg, var(--error-color) 0%, #dc2626 100%);
}

.toast button {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: auto;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.toast button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-header {
        padding: 2rem 1rem 1.5rem;
    }
    
    .main-content {
        padding: 2rem 1rem;
    }
    
    .input-section {
        padding: 2rem;
        margin-bottom: 2rem;
    }
    
    .input-section textarea {
        min-height: 250px;
        font-size: 1rem;
    }
    
    .briefing-content {
        padding: 2rem;
    }
    
    .briefing-content h2 {
        font-size: 1.5rem;
    }
    
    .toast {
        top: 20px;
        right: 20px;
        left: 20px;
        min-width: auto;
    }
    
    .loading-content {
        margin: 1rem;
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 1.5rem 1rem 1rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 1.5rem 0.75rem;
    }
    
    .input-section {
        padding: 1.5rem;
    }
    
    .input-section textarea {
        min-height: 200px;
        padding: 1rem;
    }
    
    .generate-btn {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }
    
    .briefing-content {
        padding: 1.5rem;
    }
    
    .briefing-content h2 {
        font-size: 1.25rem;
        margin-top: 2rem;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.5rem !important; }
.mb-2 { margin-bottom: 1rem !important; }
.mb-3 { margin-bottom: 1.5rem !important; }

/* Focus Management */
.input-section textarea:focus-visible,
.generate-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .page-header,
    .input-section,
    .loading-overlay,
    .toast {
        display: none !important;
    }
    
    .briefing-content {
        box-shadow: none;
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}