/**
 * Professional Financial Report Styles
 * Clean, trustworthy, readable
 */

/* ========================================
   GLOBAL
   ======================================== */

.financial-report-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #111827;
    background: #ffffff;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ========================================
   REPORT HEADER
   ======================================== */

.report-header {
    background: #ffffff;
    padding: 2rem;
    margin-bottom: 0;
    border-bottom: 3px solid #2563eb;
}

.report-ticker {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
}

.report-company-name {
    font-size: 1.125rem;
    font-weight: 500;
    color: #6b7280;
    margin: 0 0 1.5rem 0;
}

.report-metadata {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.metadata-item {

}

.metadata-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    display: block;
}

.metadata-value {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    display: block;
}

/* ========================================
   NAVIGATION TABS
   ======================================== */

.report-nav {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
    margin: 0;
    padding: 0;
}

.report-nav .flex {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    margin: 0;
    padding: 0;
}

.tab-button {
    padding: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.tab-button:hover {
    color: #111827;
    background: #ffffff;
}

.tab-button.active {
    color: #2563eb;
    background: #ffffff;
    border-bottom-color: #2563eb;
}

/* ========================================
   CONTENT SECTIONS
   ======================================== */

.tab-content {
    padding: 2rem;
    min-height: 600px;
    width: 100%;
}

/* ========================================
   CARDS
   ======================================== */

.card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}

.subsection-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin: 2rem 0 1rem 0;
}

/* ========================================
   KPI CARDS
   ======================================== */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.metric-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
}

.metric-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.metric-trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-trend-badge svg {
    width: 12px;
    height: 12px;
}

.metric-trend-badge.up {
    background: #d1fae5;
    color: #065f46;
}

.metric-trend-badge.down {
    background: #fee2e2;
    color: #991b1b;
}

.metric-trend-badge.neutral {
    background: #f3f4f6;
    color: #6b7280;
}

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0.75rem 0;
    letter-spacing: -0.02em;
}

.metric-subvalue {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.metric-change {
    font-size: 0.75rem;
    line-height: 1.5;
    color: #6b7280;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

/* KPI card color accents based on trend */
.metric-card.up {
    border-color: #10b981;
    background: linear-gradient(to bottom, #ffffff 0%, #f0fdf4 100%);
}

.metric-card.up .metric-value {
    color: #059669;
}

.metric-card.down {
    border-color: #ef4444;
    background: linear-gradient(to bottom, #ffffff 0%, #fef2f2 100%);
}

.metric-card.down .metric-value {
    color: #dc2626;
}

.metric-card.neutral {
    border-color: #e5e7eb;
}

.metric-card.neutral .metric-value {
    color: #111827;
}

/* ========================================
   TABLES
   ======================================== */

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.data-table thead {
    background: #f9fafb;
}

.data-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.8125rem;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #d1d5db;
}

.data-table th:last-child {
    text-align: right;
}

.data-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    color: #111827;
}

.data-table td:last-child {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

.data-table tbody tr.highlight {
    background: #eff6ff;
}

.data-table tbody tr.highlight td {
    color: #1e40af;
    font-weight: 700;
}

.value-positive {
    color: #059669;
}

.value-negative {
    color: #dc2626;
}

/* ========================================
   PEER TABLE
   ======================================== */

.peer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.peer-table thead {
    background: #1f2937;
    color: #ffffff;
}

.peer-table th {
    padding: 1rem;
    font-weight: 700;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
}

.peer-table th:not(:first-child) {
    text-align: right;
}

.peer-table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    color: #111827;
}

.peer-table td:not(:first-child) {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.peer-table tbody tr:hover {
    background: #f9fafb;
}

.peer-table tbody tr.main-company {
    background: #dbeafe;
}

.peer-table tbody tr.main-company td {
    color: #1e40af;
    font-weight: 700;
}

.company-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.focus-badge {
    background: #2563eb;
    color: #ffffff;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    text-transform: uppercase;
}

/* ========================================
   CHARTS
   ======================================== */

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ========================================
   SWOT
   ======================================== */

.swot-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.swot-card {
    border-radius: 8px;
    padding: 1.5rem;
    border: 2px solid;
    background: #ffffff;
}

.swot-strengths {
    border-color: #10b981;
}

.swot-strengths .swot-title {
    color: #065f46;
}

.swot-weaknesses {
    border-color: #ef4444;
}

.swot-weaknesses .swot-title {
    color: #991b1b;
}

.swot-opportunities {
    border-color: #3b82f6;
}

.swot-opportunities .swot-title {
    color: #1e40af;
}

.swot-threats {
    border-color: #f59e0b;
}

.swot-threats .swot-title {
    color: #92400e;
}

.swot-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.swot-title svg {
    width: 20px;
    height: 20px;
}

.swot-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.swot-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #111827;
}

.swot-list li::before {
    content: '•';
    font-weight: bold;
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
}

.swot-strengths .swot-list li::before {
    color: #10b981;
}

.swot-weaknesses .swot-list li::before {
    color: #ef4444;
}

.swot-opportunities .swot-list li::before {
    color: #3b82f6;
}

.swot-threats .swot-list li::before {
    color: #f59e0b;
}

/* ========================================
   QUOTES
   ======================================== */

.quote-card {
    border-left: 4px solid;
    border-radius: 4px;
    padding: 1.25rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    margin-bottom: 1rem;
}

.quote-primary {
    border-left-color: #2563eb;
}

.quote-secondary {
    border-left-color: #10b981;
}

.quote-text {
    font-size: 0.9375rem;
    color: #111827;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    font-style: italic;
}

.quote-attribution {
    font-size: 0.875rem;
    font-weight: 600;
    font-style: normal;
    color: #6b7280;
}

.quote-attribution::before {
    content: '— ';
}

/* ========================================
   FACTORS
   ======================================== */

.factor-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.factor-card {
    background: #ffffff;
    border: 2px solid;
    border-radius: 8px;
    padding: 1.25rem;
}

.factor-growth {
    border-color: #10b981;
}

.factor-risk {
    border-color: #f59e0b;
}

.factor-financial {
    border-color: #3b82f6;
}

.factor-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.factor-icon {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ffffff;
}

.factor-growth .factor-icon {
    background: #10b981;
}

.factor-risk .factor-icon {
    background: #f59e0b;
}

.factor-financial .factor-icon {
    background: #3b82f6;
}

.factor-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

.factor-content {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #4b5563;
}

/* ========================================
   PROSE
   ======================================== */

.prose {
    color: #111827;
    line-height: 1.7;
}

.prose p {
    margin-bottom: 1rem;
}

.prose strong {
    font-weight: 700;
}

.prose em {
    font-style: italic;
}

.prose ul {
    list-style: disc;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.prose ul li {
    margin-bottom: 0.5rem;
}

/* ========================================
   TRUST BADGES
   ======================================== */

.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
}

.trust-badge svg {
    width: 14px;
    height: 14px;
    color: #2563eb;
}

.data-source {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.5;
}

/* ========================================
   RATIO CARDS
   ======================================== */

.ratio-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.ratio-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ratio-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
}

.ratio-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.ratio-badge {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ratio-badge.excellent,
.ratio-badge.good {
    background: #d1fae5;
    color: #065f46;
}

.ratio-badge.fair {
    background: #fef3c7;
    color: #92400e;
}

.ratio-badge.poor,
.ratio-badge.neutral {
    background: #f3f4f6;
    color: #6b7280;
}

.ratio-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0.75rem 0;
    letter-spacing: -0.02em;
}

.ratio-analysis {
    font-size: 0.75rem;
    line-height: 1.5;
    color: #6b7280;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
    font-style: italic;
}

/* Ratio card color accents */
.ratio-card.excellent {
    border-color: #10b981;
    background: linear-gradient(to bottom, #ffffff 0%, #f0fdf4 100%);
}

.ratio-card.good {
    border-color: #3b82f6;
    background: linear-gradient(to bottom, #ffffff 0%, #eff6ff 100%);
}

.ratio-card.fair {
    border-color: #f59e0b;
    background: linear-gradient(to bottom, #ffffff 0%, #fffbeb 100%);
}

.ratio-card.poor {
    border-color: #ef4444;
    background: linear-gradient(to bottom, #ffffff 0%, #fef2f2 100%);
}

/* ========================================
   LOGIN PROMPT FOR RESTRICTED CONTENT
   ======================================== */

.login-required-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 3rem 2rem;
    text-align: center;
}

.login-required-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.login-required-icon svg {
    width: 40px;
    height: 40px;
    color: #ffffff;
}

.login-required-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.75rem;
}

.login-required-description {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 2rem;
    max-width: 500px;
    line-height: 1.6;
}

.login-required-benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
    width: 100%;
}

.login-benefit {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    text-align: left;
}

.login-benefit-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: #10b981;
    margin-top: 2px;
}

.login-benefit-text {
    flex: 1;
}

.login-benefit-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.login-benefit-desc {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.4;
}

.login-required-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.login-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.login-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.login-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.login-btn-secondary {
    background: #ffffff;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.login-btn-secondary:hover {
    border-color: #3b82f6;
    color: #2563eb;
    transform: translateY(-2px);
}

.login-trust-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.login-trust-badges {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.login-trust-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #6b7280;
    font-weight: 500;
}

.login-trust-badge svg {
    width: 16px;
    height: 16px;
    color: #10b981;
}

/* ========================================
   UTILITIES
   ======================================== */

.hidden {
    display: none !important;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .report-metadata {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .financial-report-container {
        padding: 0;
    }

    .report-header {
        padding: 1.5rem;
    }

    .tab-content {
        padding: 1.5rem;
    }

    .report-ticker {
        font-size: 2rem;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .report-nav .flex {
        grid-template-columns: 1fr;
    }

    .tab-button {
        padding: 0.875rem;
        font-size: 0.8125rem;
    }

    .swot-grid {
        grid-template-columns: 1fr;
    }

    .factor-grid {
        grid-template-columns: 1fr;
    }

    .report-metadata {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.3s ease backwards;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

/* ========================================
   PRINT
   ======================================== */

@media print {
    .no-print {
        display: none !important;
    }

    .tab-content {
        display: block !important;
        page-break-after: always;
    }
}
