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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.9;
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

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

.input-group {
    margin-bottom: 1.5rem;
}

.input-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

.input-field {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #f9fafb;
}

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

.input-field::placeholder {
    color: #9ca3af;
}

/* Research button */
.research-button {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

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

.research-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Status section */
.status-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.status-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-icon {
    flex-shrink: 0;
}

.pulse-dot {
    width: 12px;
    height: 12px;
    background: #667eea;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

.status-content {
    flex: 1;
}

.status-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.status-description {
    color: #6b7280;
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
    animation: progress 3s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Results section */
.results-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
}

.results-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
}

.results-actions {
    display: flex;
    gap: 0.5rem;
}

.action-button {
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    color: #374151;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-button:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.icon {
    width: 16px;
    height: 16px;
}

/* Report content - Academic Style */
.report-content {
    line-height: 1.7;
    color: #2c3e50;
    font-size: 1rem;
    max-width: none;
    font-family: 'Times New Roman', 'Georgia', serif;
    text-align: justify;
}

/* Section Headings - BOLD - 13pt */
.report-content h1 {
    font-size: 13pt;
    font-weight: bold !important;
    color: #000000;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    text-align: left;
    border-bottom: 1px solid #000000;
    padding-bottom: 0.3rem;
    font-family: 'Inter', sans-serif;
    display: block !important;
    clear: both !important;
}

.report-content h1:first-child {
    margin-top: 0;
}

/* Section Subheadings - BOLD - 12pt */
.report-content h2 {
    font-size: 12pt;
    font-weight: bold !important;
    color: #000000;
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
    text-align: left;
    font-family: 'Inter', sans-serif;
    display: block !important;
    clear: both !important;
}

.report-content h3 {
    font-size: 12pt;
    font-weight: bold !important;
    color: #000000;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    text-align: left;
    font-family: 'Inter', sans-serif;
    display: block !important;
    clear: both !important;
}

/* Section Body - NOT BOLD - 11pt */
.report-content p {
    margin-bottom: 1rem;
    text-align: justify;
    text-indent: 1.5rem;
    line-height: 1.6;
    font-size: 11pt;
    font-weight: normal !important;
    color: #000000;
    font-family: 'Times New Roman', 'Georgia', serif;
}

/* First paragraph after heading should not be indented */
.report-content h1 + p,
.report-content h2 + p,
.report-content h3 + p {
    text-indent: 0;
}

/* Lists - NOT BOLD - 11pt */
.report-content ul,
.report-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
    text-align: left;
    font-weight: normal !important;
    font-size: 11pt;
    font-family: 'Times New Roman', 'Georgia', serif;
}

.report-content ul {
    list-style-type: disc;
}

.report-content ol {
    list-style-type: decimal;
}

.report-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    text-align: left;
    font-weight: normal !important;
    color: #000000;
    font-size: 11pt;
    font-family: 'Times New Roman', 'Georgia', serif;
}

/* Bold text - Only for specific emphasis */
.report-content strong {
    font-weight: bold !important;
    color: #000000;
}

/* Italic text - Normal weight */
.report-content em {
    font-style: italic;
    color: #000000;
    font-weight: normal !important;
}

/* Professional spacing */
.report-content > *:first-child {
    margin-top: 0;
}

.report-content > *:last-child {
    margin-bottom: 0;
}

/* Academic paper styling */
.report-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Error section */
.error-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.error-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.error-icon {
    flex-shrink: 0;
    color: #ef4444;
}

.error-icon svg {
    width: 24px;
    height: 24px;
}

.error-content {
    flex: 1;
}

.error-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.error-description {
    color: #6b7280;
    margin-bottom: 1rem;
}

.retry-button {
    padding: 0.5rem 1rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* Footer */
.footer {
    text-align: center;
    margin-top: 3rem;
    color: white;
    opacity: 0.8;
}

.footer-text {
    font-size: 0.9rem;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .input-section,
    .status-section,
    .results-section,
    .error-section {
        padding: 1.5rem;
    }
    
    .results-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .results-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
    }
    
    .input-field {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}
