/**
 * Developer IR Toolkit - Frontend Styles
 */

/* ==========================================================================
   Base Styles
   ========================================================================== */

.ir-error {
    padding: 15px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    margin: 10px 0;
}

.ir-no-data {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.ir-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   Stock Price Header Widget
   ========================================================================== */

.ir-stock-header {
    padding: 30px 40px;
    background-color: #003366;
    color: #ffffff;
}

.ir-stock-header.ir-layout-horizontal .ir-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.ir-stock-header.ir-layout-stacked .ir-header-content {
    text-align: center;
}

.ir-stock-header.ir-layout-stacked .ir-price-info {
    margin-top: 20px;
}

.ir-company-name {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 5px 0;
    line-height: 1.3;
}

.ir-exchange-ticker {
    font-size: 16px;
    font-weight: 400;
    opacity: 0.8;
    margin-left: 10px;
}

.ir-timestamp {
    font-size: 14px;
    opacity: 0.7;
}

.ir-price-info {
    text-align: right;
}

.ir-stock-header.ir-layout-stacked .ir-price-info {
    text-align: center;
}

.ir-price-row {
    display: flex;
    align-items: baseline;
    gap: 15px;
    justify-content: flex-end;
}

.ir-stock-header.ir-layout-stacked .ir-price-row {
    justify-content: center;
}

.ir-price {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
}

.ir-change {
    font-size: 18px;
    font-weight: 500;
}

.ir-change.ir-positive {
    color: #00c853;
}

.ir-change.ir-negative {
    color: #ff5252;
}

.ir-change.ir-neutral {
    color: rgba(255, 255, 255, 0.8);
}

.ir-volume {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 5px;
}

.ir-delay-notice {
    font-size: 12px;
    opacity: 0.6;
    margin-top: 5px;
    font-style: italic;
}

/* ==========================================================================
   Stock Quote Card Widget
   ========================================================================== */

.ir-quote-card {
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.ir-quote-card.ir-layout-inline {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ir-quote-card.ir-layout-minimal {
    padding: 10px;
    box-shadow: none;
    border: 1px solid #e0e0e0;
}

.ir-quote-card.ir-layout-ticker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background-color: #1a1a2e;
    color: #ffffff;
    border-radius: 4px;
}

.ir-quote-symbol {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.ir-quote-card.ir-layout-ticker .ir-quote-symbol {
    color: #ffffff;
}

.ir-quote-price {
    font-size: 32px;
    font-weight: 700;
    color: #333;
}

.ir-quote-card.ir-layout-inline .ir-quote-price,
.ir-quote-card.ir-layout-ticker .ir-quote-price {
    font-size: 24px;
}

.ir-quote-card.ir-layout-ticker .ir-quote-price {
    color: #ffffff;
}

.ir-quote-change {
    font-size: 16px;
    font-weight: 500;
    margin-top: 5px;
}

.ir-quote-card.ir-layout-inline .ir-quote-change,
.ir-quote-card.ir-layout-ticker .ir-quote-change {
    margin-top: 0;
}

.ir-quote-volume {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* ==========================================================================
   Stock Chart Widget
   ========================================================================== */

.ir-stock-chart-wrapper {
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
}

.ir-chart-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #333;
}

.ir-period-selector {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.ir-period-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #666;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.ir-period-btn:hover {
    border-color: #0066cc;
    color: #0066cc;
}

.ir-period-btn.active {
    background-color: #0066cc;
    border-color: #0066cc;
    color: #ffffff;
}

.ir-chart-container {
    position: relative;
    height: 400px;
}

/* ==========================================================================
   Dividend Table Widget
   ========================================================================== */

.ir-dividend-table-wrapper {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}

.ir-dividend-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    padding: 20px 20px 0;
    color: #333;
}

.ir-dividend-filters {
    padding: 0 20px 15px;
}

.ir-year-filter {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

.ir-dividend-table {
    width: 100%;
    border-collapse: collapse;
}

.ir-dividend-table thead th {
    background-color: #003366;
    color: #ffffff;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.ir-dividend-table thead th.sortable {
    cursor: pointer;
}

.ir-dividend-table thead th .ir-sort-icon {
    margin-left: 5px;
    opacity: 0.5;
}

.ir-dividend-table tbody td {
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.ir-dividend-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.ir-dividend-table tbody tr:hover {
    background-color: #e8f4fc;
}

.ir-dividend-table .ir-amount {
    color: #00a651;
    font-weight: 600;
}

.ir-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-top: 1px solid #e0e0e0;
}

.ir-page-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.ir-page-btn:hover:not(:disabled) {
    border-color: #0066cc;
    color: #0066cc;
}

.ir-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ir-page-info {
    font-size: 14px;
    color: #666;
}

/* ==========================================================================
   Dividend Chart Widget
   ========================================================================== */

.ir-dividend-chart-wrapper {
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
}

.ir-dividend-chart-container {
    position: relative;
    height: 300px;
}

/* ==========================================================================
   Company Profile Widget
   ========================================================================== */

.ir-company-profile {
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
}

.ir-company-profile.ir-layout-card .ir-profile-item {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.ir-company-profile.ir-layout-card .ir-profile-item:last-child {
    border-bottom: none;
}

.ir-company-profile.ir-layout-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.ir-company-profile.ir-layout-inline .ir-profile-item {
    flex: 1 1 200px;
}

.ir-profile-label {
    font-size: 13px;
    color: #666;
    display: block;
    margin-bottom: 3px;
}

.ir-profile-value {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.ir-profile-value a {
    color: #0066cc;
    text-decoration: none;
}

.ir-profile-value a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   SEC Filings Widget
   ========================================================================== */

.ir-sec-filings-wrapper {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}

.ir-filings-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    padding: 20px 20px 15px;
    color: #333;
}

.ir-filings-filters {
    padding: 0 20px 15px;
}

.ir-type-filter {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

.ir-filings-table {
    width: 100%;
    border-collapse: collapse;
}

.ir-filings-table thead th {
    background-color: #003366;
    color: #ffffff;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.ir-filings-table tbody td {
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.ir-filings-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.ir-filings-table tbody tr:hover {
    background-color: #e8f4fc;
}

.ir-filing-type {
    display: inline-block;
    padding: 3px 8px;
    background-color: #e8f4fc;
    color: #0066cc;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.ir-filing-link {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
}

.ir-filing-link:hover {
    text-decoration: underline;
}

/* SEC Filings Cards Layout */
.ir-filings-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 0 20px 20px;
}

.ir-filing-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.ir-filing-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.ir-filing-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.ir-filing-card-body {
    padding: 15px;
}

.ir-filing-card-body p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.ir-filing-card-footer {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
}

.ir-filing-date {
    font-size: 13px;
    color: #666;
}

/* ==========================================================================
   Financial Highlights Widget
   ========================================================================== */

.ir-financial-highlights {
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
}

.ir-highlights-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #333;
}

.ir-highlights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.ir-highlight-item {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    text-align: center;
}

.ir-highlight-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ir-highlight-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

/* ==========================================================================
   Insider Trading Widget
   ========================================================================== */

.ir-insider-trading {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}

.ir-insider-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    padding: 20px 20px 15px;
    color: #333;
}

.ir-insider-table {
    width: 100%;
    border-collapse: collapse;
}

.ir-insider-table thead th {
    background-color: #003366;
    color: #ffffff;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.ir-insider-table tbody td {
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.ir-insider-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.ir-insider-table tbody tr:hover {
    background-color: #e8f4fc;
}

/* ==========================================================================
   News & Press Releases Widget
   ========================================================================== */

.ir-news-releases {
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
}

.ir-news-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #333;
}

.ir-news-list .ir-news-item {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.ir-news-list .ir-news-item:last-child {
    border-bottom: none;
}

.ir-news-date {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.ir-news-link {
    color: #0066cc;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
}

.ir-news-link:hover {
    text-decoration: underline;
}

/* News Cards Layout */
.ir-news-releases.ir-layout-cards .ir-news-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.ir-news-releases.ir-layout-cards .ir-news-item {
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: box-shadow 0.2s ease;
}

.ir-news-releases.ir-layout-cards .ir-news-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 768px) {
    .ir-stock-header {
        padding: 20px;
    }
    
    .ir-stock-header.ir-layout-horizontal .ir-header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .ir-stock-header.ir-layout-horizontal .ir-price-info {
        text-align: center;
    }
    
    .ir-stock-header.ir-layout-horizontal .ir-price-row {
        justify-content: center;
    }
    
    .ir-company-name {
        font-size: 20px;
    }
    
    .ir-exchange-ticker {
        display: block;
        margin-left: 0;
        margin-top: 5px;
    }
    
    .ir-price {
        font-size: 36px;
    }
    
    .ir-highlights-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ir-filings-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .ir-highlights-grid {
        grid-template-columns: 1fr;
    }
    
    .ir-period-selector {
        justify-content: center;
    }
    
    .ir-period-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.ir-loading {
    position: relative;
    min-height: 100px;
}

.ir-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #e0e0e0;
    border-top-color: #0066cc;
    border-radius: 50%;
    animation: ir-spin 0.8s linear infinite;
}

@keyframes ir-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .ir-stock-header {
        background-color: #003366 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .ir-period-selector,
    .ir-dividend-filters,
    .ir-filings-filters {
        display: none;
    }
}
