* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #0f0f23 100%);
    min-height: 100vh;
    padding: 20px;
    color: #ffffff;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Export Dropdown Styles */
.export-dropdown {
    position: relative;
    display: inline-block;
}

.export-dropdown-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: #1e1e3f;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    min-width: 200px;
    margin-bottom: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.export-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.export-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.export-option:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(34, 197, 94, 0.2));
    color: #3b82f6;
}

.export-option:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.export-option:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.export-icon {
    font-size: 1.2rem;
}

.export-icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
}

/* Header */
.report-header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    position: relative;
}

.back-button {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(-5px);
}

.report-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #3b82f6, #22c55e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Loading State */
.loading-container {
    text-align: center;
    padding: 80px 20px;
    color: white;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.loading-subtext {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Error State */
.error-container {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.error-container h2 {
    color: #ef4444;
    margin-bottom: 15px;
}

.error-container p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
}

.retry-button {
    background: linear-gradient(135deg, #3b82f6 0%, #22c55e 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.retry-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.4);
}

/* Report Sections */
.report-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 35px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.6s ease-out;
    backdrop-filter: blur(10px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* AI Report Box */
.ai-report-box {
    max-width: 1000px;
    margin: 0 auto 30px;
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 25px;
}

.ai-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3b82f6 0%, #22c55e 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.4);
}

.ai-info h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #ffffff;
    font-weight: 600;
}

.ai-status {
    margin: 5px 0 0 0;
    color: #22c55e;
    font-size: 0.9rem;
    font-weight: 600;
}

.ai-text-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 25px;
    min-height: 200px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.3px;
}

/* Markdown Formatting Styles */
.ai-text .report-heading {
    color: #3b82f6;
    font-weight: 700;
    margin: 15px 0 8px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ai-text h1.report-heading {
    font-size: 1.5rem;
    background: linear-gradient(135deg, #3b82f6, #22c55e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-text h2.report-heading {
    font-size: 1.3rem;
    color: #22c55e;
}

.ai-text h3.report-heading {
    font-size: 1.1rem;
    color: #3b82f6;
}

.ai-text .report-bold {
    color: #22c55e;
    font-weight: 700;
}

.ai-text .report-italic {
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

.ai-text .report-list {
    margin: 10px 0;
    padding-left: 25px;
}

.ai-text .report-bullet,
.ai-text .report-numbered {
    color: rgba(255, 255, 255, 0.85);
    margin: 5px 0;
    line-height: 1.5;
}

.ai-text ul.report-list {
    list-style-type: disc;
}

.ai-text ol.report-list {
    list-style-type: decimal;
}

.ai-text strong {
    color: #22c55e;
    font-weight: 700;
}

.ai-text em {
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

.ai-text br {
    display: block;
    content: "";
    margin: 8px 0;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 10px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 40px;
}

.action-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.print-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #22c55e 100%);
    color: white;
    border: 1px solid transparent;
}

.print-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.4);
}

.back-btn {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .report-header {
        color: #2c3e50;
    }
    
    .back-button,
    .action-buttons {
        display: none !important;
    }
    
    .report-section {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .ai-text {
        color: #2c3e50;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .report-header h1 {
        font-size: 2rem;
    }
    
    .back-button {
        position: static;
        margin-bottom: 20px;
        justify-content: center;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .report-section {
        padding: 20px;
    }
    
    .ai-text-container {
        padding: 15px;
    }
    
    .ai-text {
        font-size: 0.95rem;
    }
}
