/**
 * Quarter Results - Modern Company Financial Reports Page
 *
 * Professional, clean layout for individual company earnings reports
 *
 * @version 2.0.0
 * @since 2025-01-05
 */

/* ==========================================
   LAYOUT & CONTAINER
   ========================================== */

.company-page {
    background: #f8f9fa;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ==========================================
   HERO BREADCRUMB SECTION
   ========================================== */

.company-hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

.breadcrumb {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
}

.breadcrumb-item:not(:last-child)::after {
    content: '›';
    margin-left: 0.5rem;
    opacity: 0.7;
}

.breadcrumb-item a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: white;
}

.breadcrumb-item.active {
    color: white;
    font-weight: 600;
}

/* ==========================================
   PAGE HEADER
   ========================================== */

.page-header {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 0.75rem 0;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 1.125rem;
    color: #6c757d;
    margin: 0;
    line-height: 1.5;
}

/* ==========================================
   COMPANY HEADER CARD
   ========================================== */

.company-header-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 2rem;
    align-items: center;
}

.company-logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-logo-section img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 8px;
}

.company-icon-placeholder {
    font-size: 4rem;
    color: #cbd5e1;
}

.company-info-section {
    flex: 1;
}

.company-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.company-ticker-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.ticker-symbol {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e3a8a;
    padding: 0.25rem 0.75rem;
    background: #eff6ff;
    border-radius: 6px;
}

.stock-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
}

.price-change {
    margin-left: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.price-change.positive {
    color: #10b981;
}

.price-change.negative {
    color: #ef4444;
}

.company-meta {
    font-size: 0.9375rem;
    color: #6c757d;
}

.company-meta strong {
    color: #2c3e50;
    font-weight: 600;
}

.period-info-section {
    text-align: right;
}

.quarter-badge {
    display: inline-block;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.report-date {
    font-size: 0.875rem;
    color: #6c757d;
}

/* ==========================================
   NAVIGATION TABS
   ========================================== */

.report-nav-tabs {
    background: white;
    border-radius: 12px;
    padding: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
}

.report-nav-tab {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.report-nav-tab:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

.report-nav-tab.active {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
}

/* ==========================================
   TAB CONTENT SECTIONS
   ========================================== */

.tab-content-section {
    display: none;
}

.tab-content-section.active {
    display: block;
}

/* ==========================================
   HIGHLIGHTS SECTION
   ========================================== */

.highlights-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.highlights-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.highlights-section h2 i {
    color: #3b82f6;
}

.highlights-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.highlights-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    gap: 1rem;
    align-items: start;
}

.highlights-list li:last-child {
    border-bottom: none;
}

.highlights-list i {
    color: #10b981;
    font-size: 1.125rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.highlights-list span {
    flex: 1;
    color: #475569;
    line-height: 1.6;
}

/* ==========================================
   FINANCIAL METRICS GRID
   ========================================== */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #3b82f6;
}

.metric-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.metric-change {
    font-size: 0.875rem;
    font-weight: 600;
}

.metric-change.positive {
    color: #10b981;
}

.metric-change.negative {
    color: #ef4444;
}

/* ==========================================
   FINANCIAL STATEMENTS TABLE
   ========================================== */

.statements-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.statements-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.statement-table {
    width: 100%;
    border-collapse: collapse;
}

.statement-table thead {
    background: #f8f9fa;
}

.statement-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.statement-table th:first-child {
    border-radius: 8px 0 0 0;
}

.statement-table th:last-child {
    border-radius: 0 8px 0 0;
    text-align: right;
}

.statement-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

.statement-table tbody tr:hover {
    background: #f8f9fa;
}

.statement-table td {
    padding: 1rem;
    font-size: 0.9375rem;
    color: #475569;
}

.statement-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: #2c3e50;
}

.statement-category {
    font-weight: 700;
    color: #2c3e50;
    background: #f8f9fa !important;
}

/* ==========================================
   HISTORICAL CHART
   ========================================== */

.chart-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chart-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 2rem;
}

/* ==========================================
   RELATED REPORTS
   ========================================== */

.related-section {
    margin-bottom: 2rem;
}

.related-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.related-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.related-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.related-card-logo img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 6px;
}

.related-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e3a8a;
    margin: 0;
}

.related-card-symbol {
    font-size: 0.875rem;
    color: #6c757d;
}

.related-card-period {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.related-card-excerpt {
    font-size: 0.875rem;
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
}

.related-card-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: #3b82f6;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}

.related-card-link:hover {
    color: #1e40af;
}

/* ==========================================
   PREVIOUS/NEXT NAVIGATION
   ========================================== */

.prev-next-nav {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.prev-next-nav a {
    flex: 1;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: #2c3e50;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prev-next-nav a:hover {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.2);
}

.prev-next-nav .next-nav {
    justify-content: flex-end;
}

/* ==========================================
   SHARE SECTION
   ========================================== */

.share-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.share-text {
    font-weight: 600;
    color: #2c3e50;
}

.share-icons {
    display: flex;
    gap: 1rem;
}

.share-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f8f9fa;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.2s ease;
}

.share-icons a:hover {
    background: #1e3a8a;
    color: white;
    transform: translateY(-2px);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 992px) {
    .company-header-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .period-info-section {
        text-align: center;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 1.5rem;
    }

    .company-name {
        font-size: 1.25rem;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .prev-next-nav {
        flex-direction: column;
    }

    .chart-container {
        height: 300px;
    }

    .share-section {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* ==========================================
   SEARCH SECTION (from index.php)
   ========================================== */

.search-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
}

.ticker-form {
    display: flex;
    gap: 0.5rem;
    position: relative;
}

.ticker-input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.ticker-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ticker-form button {
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ticker-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Ticker search results dropdown */
.ticker-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.ticker-results-table {
    width: 100%;
    border-collapse: collapse;
}

.ticker-results-table tr {
    cursor: pointer;
    transition: background 0.2s ease;
}

.ticker-results-table tr:hover {
    background: #f8f9fa;
}

.ticker-results-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.ticker-results-table tr:last-child td {
    border-bottom: none;
}

.loading,
.no-results {
    padding: 1.5rem;
    text-align: center;
    color: #6c757d;
}
