/* 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: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    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 {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-bottom: 2rem;
}

/* Input Section - Front and Center */
.input-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.input-card {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.input-card h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: #2d3748;
}

.input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.main-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 3px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1.1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #f8fafc;
}

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

.main-input::placeholder {
    color: #a0aec0;
}

/* Analysis Results - 3 Columns */
.analysis-results {
    margin-top: 2rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.result-column {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-column:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.result-column {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.column-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.column-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.column-header p {
    font-size: 0.9rem;
    color: #718096;
    margin: 0;
}

/* Column header colors */
.neutral-header {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
}

.positive-header {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
}

.negative-header {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
}

.result-content {
    padding: 1.5rem;
    min-height: 200px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #2d3748;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 0 0 16px 16px;
}

.result-content.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #718096;
}

/* Result Header Info */
.result-header-info {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #667eea;
}

.company-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.analysis-type {
    font-size: 0.85rem;
    color: #718096;
    font-weight: 500;
}

/* Formatted Content */
.formatted-content {
    line-height: 1.7;
    color: #2d3748;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.formatted-content::-webkit-scrollbar {
    width: 6px;
}

.formatted-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.formatted-content::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.formatted-content::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.formatted-content p {
    margin-bottom: 1.2rem;
    text-align: justify;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.formatted-content p:hover {
    background-color: rgba(102, 126, 234, 0.05);
    padding: 0.5rem 0.8rem;
    margin: 0.5rem -0.8rem;
}

.formatted-content p:last-child {
    margin-bottom: 0;
}

.formatted-content strong {
    color: #1a202c;
    font-weight: 700;
    background: linear-gradient(120deg, #a8edea 0%, #fed6e3 100%);
    background-repeat: no-repeat;
    background-size: 100% 0.2em;
    background-position: 0 88%;
    transition: background-size 0.25s ease-in;
    padding: 0.1em 0.2em;
    border-radius: 3px;
}

.formatted-content strong:hover {
    background-size: 100% 100%;
}

.formatted-content ul {
    margin: 1.2rem 0;
    padding-left: 1.8rem;
    list-style: none;
}

.formatted-content li {
    margin-bottom: 0.8rem;
    line-height: 1.6;
    position: relative;
    padding-left: 0.5rem;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.formatted-content li:hover {
    background-color: rgba(102, 126, 234, 0.08);
}

.formatted-content li:before {
    content: "▸";
    color: #667eea;
    font-weight: bold;
    position: absolute;
    left: -1.2rem;
    font-size: 1em;
    transition: transform 0.2s ease;
}

.formatted-content li:hover:before {
    transform: translateX(2px);
    color: #764ba2;
}

.formatted-content li:last-child {
    margin-bottom: 0;
}

/* Section headers */
.formatted-content .section-header {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 1.5rem 0 1rem 0;
    padding: 0.8rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.formatted-content .section-header: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;
}

.formatted-content .section-header:hover:before {
    left: 100%;
}

/* Special styling for section headers */
.formatted-content p strong:first-child {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    padding: 0.5rem 0.8rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Error Display */
.error-display {
    text-align: center;
    padding: 2rem 1rem;
    color: #e53e3e;
}

.error-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.error-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.error-message {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #c53030;
}

/* Additional Sections */
.additional-sections {
    margin-top: 2rem;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #2d3748;
}

/* Status indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: #f7fafc;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cbd5e0;
    transition: background-color 0.3s ease;
}

.status-dot.online {
    background: #48bb78;
}

.status-dot.offline {
    background: #f56565;
}

.status-dot.loading {
    background: #f6ad55;
    animation: pulse 1.5s ease-in-out infinite;
}

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

.status-text {
    font-weight: 500;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

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

/* Form elements */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #4a5568;
}

.input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.input:focus {
    outline: none;
    border-color: #667eea;
}

/* Response areas */
.response-area, .data-display {
    margin-top: 1rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    min-height: 60px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.response-area:empty, .data-display:empty {
    display: none;
}

/* Company results */
.company-results {
    margin-top: 1rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    min-height: 60px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.company-results:empty {
    display: none;
}

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

.footer .build-time {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.6;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Responsive design */
@media (max-width: 1200px) {
    .results-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .title {
        font-size: 2rem;
    }

    .input-card {
        padding: 2rem 1.5rem;
    }

    .input-card h2 {
        font-size: 1.5rem;
    }

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

    .main-input {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }

    .section-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .card {
        padding: 1.5rem;
    }

    .result-content {
        padding: 1rem;
    }

    .formatted-content p {
        text-align: left;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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