/* General Reset and Base Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: #222;
    margin-bottom: 0.5em;
}

/* Links */
a {
    color: #0073aa;
    transition: color 0.3s ease;
}
/* Animation for elements to fade in smoothly */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

@keyframes modal-fade-in { /* For modal backdrop */
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modal-slide-down { /* For modal content */
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === MODAL STYLES === */
.quantfos-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    /* --- FIX: Add flexbox for centering --- */
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modal-fade-in 0.3s ease-out;
}

.quantfos-modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 20px; /* Use a simple margin, flexbox will handle centering */
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #ddd;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: modal-slide-down 0.4s ease-out;
    border-top: 5px solid #0073aa;
}

.quantfos-modal-close {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.quantfos-modal-close:hover,
.quantfos-modal-close:focus {
    color: #000;
    text-decoration: none;
}

.quantfos-news-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.quantfos-news-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive grid with a minimum card width of 300px */
    gap: 20px;
    padding: 0;
    list-style: none;
    margin-top: 20px;
}

.quantfos-news-list-item {
    background-color: #fff;
}

.quantfos-news-filters {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.quantfos-news-filters a {
    margin-right: 15px;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    color: #0073aa;
}

.quantfos-news-filters a.active,
.quantfos-news-filters a:hover {
    background-color: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.quantfos-news-list-item .entry-title a {
    text-decoration: none;
    color: #333;
}

.quantfos-news-list-item .entry-title a:hover {
    color: #0073aa;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    animation: fadeIn 0.3s ease-out forwards; /* Apply fade-in animation to each card */
    opacity: 0;
}

.quantfos-news-list-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.quantfos-news-list-item img {
    width: 100%;
    height: 200px; /* Fixed height for images */
    object-fit: cover; /* Ensure images cover the area without distortion */
    border-bottom: 1px solid #eee;
}

.quantfos-news-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.quantfos-news-content .entry-title {
    font-size: 1.2rem;
    margin: 0 0 0.5em 0;
    line-height: 1.3;
}

.quantfos-news-content .entry-title a {
    text-decoration: none;
    color: #333;
    transition: color 0.2s ease;
}

.quantfos-news-content .entry-title a:hover {
    color: #0073aa;
}

.quantfos-news-content .entry-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.quantfos-news-content .entry-summary {
    flex-grow: 1;
}

.quantfos-news-content .entry-summary p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
}

.quantfos-news-footer {
    padding: 10px 20px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
    text-align: right;
}

.quantfos-news-footer .read-more-link {
    display: inline-block;
    padding: 8px 15px;
    background-color: #0073aa;
    color: #fff !important;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.quantfos-news-list-item .entry-summary p {
    margin: 0;
}

/* Pagination Styles */
.quantfos-news-pagination {
    margin-top: 30px;
    text-align: center;
}

.quantfos-news-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #0073aa;
    transition: background-color 0.2s, color 0.2s;
}

.quantfos-news-pagination .page-numbers:hover {
    background-color: #f0f0f0;
}

.quantfos-news-pagination .page-numbers.current {
    background-color: #0073aa;
    color: #fff;
    border-color: #0073aa;
    cursor: default;
}

.quantfos-news-pagination .page-numbers.dots {
    border: none;
    background: none;
    padding: 8px 0;
}

/* Read More Button Style */
.quantfos-read-more-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0073aa;
    color: #fff !important; /* Use !important to override theme link colors */
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.2s;
}

.quantfos-read-more-button:hover {
    background-color: #005a87;
    color: #fff !important;
}

/* General table styles that can be applied throughout the plugin */
.quantfos-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    border: 1px solid #ddd; /* Subtle border for the whole table */
}

.quantfos-table th,
.quantfos-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee; /* Lighter row separation */
}

.quantfos-table thead {
    background-color: #0073aa; /* Fallback color */
    border-bottom: 2px solid #ddd;
}

.quantfos-table th {
    font-weight: bold;
}


.quantfos-table tbody tr:nth-child(even) {
    background-color: #f9f9f9; /* Zebra striping for rows */
}

.quantfos-table tbody tr:hover {
    background-color: #f5f5f5; /* Hover effect */
    transition: background-color 0.2s ease-in-out;
}

/* Recommendations Table Enhancements */
.quantfos-recommendations-table {
    width: 100%;
    border-collapse: separate; /* Use separate instead of collapse */
    border-spacing: 0 10px; /* Add vertical spacing between rows */
    margin-bottom: 20px;
}

.quantfos-recommendations-table thead th {
    background-color: #0073aa; /* Fallback color */
    padding: 12px 15px;
    text-align: left;
    border-bottom: 2px solid #ddd;
    font-weight: bold;
}

.quantfos-recommendations-table tbody tr {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    overflow: hidden; /* Ensures box-shadow and background are contained */
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.quantfos-recommendations-table tbody tr:hover {
    background-color: #fafafa;
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.12);
}

.quantfos-recommendations-table tbody td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.quantfos-recommendations-table tbody tr:last-child td {
    border-bottom: none; /* Remove bottom border from the last row for visual cleanliness */
}

.quantfos-recommendations-table .action-buy {
    color: #28a745; /* Bootstrap success color */
}

.quantfos-recommendations-table .action-hold,
.quantfos-recommendations-table .action-watchlist {
    color: #ffc107; /* Bootstrap warning color */
}

.quantfos-recommendations-table .action-reject,
.quantfos-recommendations-table .action-ignore {
    color: #dc3545; /* Bootstrap danger color */
}

/* Added for the page loader */
.loading-indicator {
    text-align: center;
    padding: 50px;
    font-size: 1.2em;
    color: #666;
}

/* === RESPONSIVE TABLE STYLES === */
@media screen and (max-width: 768px) {
    /* Hide table headers on mobile */
    .quantfos-table thead,
    .quantfos-recommendations-table thead,
    .quantfos-details-table thead,
    .wp-list-table thead {
        border: none;
        clip: rect(0 0 0 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
    }

    .quantfos-table, .quantfos-recommendations-table {
        border: 0;
        border-spacing: 0; /* Reset for recommendations table */
    }

    .quantfos-table tr,
    .quantfos-recommendations-table tr,
    .wp-list-table tbody tr {
        display: block;
        margin-bottom: 1em;
        border: 1px solid #ddd;
        border-radius: 5px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.08);
        background: #fff;
    }
    
    /* Reset hover effects for mobile */
    .quantfos-table tbody tr:hover,
    .quantfos-recommendations-table tbody tr:hover {
        background-color: #fff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    }

    .quantfos-table td,
    .quantfos-recommendations-table td,
    .wp-list-table tbody td {
        display: block;
        text-align: right;
        padding: 10px 15px;
        border-bottom: 1px solid #eee;
    }

    .quantfos-table td::before,
    .quantfos-recommendations-table td::before,
    .wp-list-table tbody td::before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        text-transform: capitalize;
        margin-right: 10px;
    }

    .quantfos-table td:last-child,
    .quantfos-recommendations-table td:last-child,
    .wp-list-table tbody td:last-child {
        border-bottom: 0;
    }

    /* Specific styles for 2-column key-value tables */
    .quantfos-details-table tr {
        border: none; box-shadow: none; border-radius: 0; margin-bottom: 0; padding: 10px 0; border-bottom: 1px solid #ddd;
    }
    .quantfos-details-table td {
        display: block; width: 100% !important; text-align: left; box-sizing: border-box; border: none; padding: 5px 0;
    }
    .quantfos-details-table td:first-child {
        background-color: transparent;
        font-weight: bold;
    }
    .quantfos-details-table td::before { content: ""; }
}

/* === Command Center Countdown Styles === */
.cc-countdown-timer {
    font-weight: bold;
    color: #e74c3c; /* Red for active timer */
    margin-left: 5px;
    padding: 2px 5px;
    border-radius: 3px;
}
.cc-countdown-timer.pulsing {
    animation: pulse-red 2s infinite;
}
.cc-incoming-details {
    font-weight: bold;
    color: #27ae60; /* Green for upcoming timer */
}
@keyframes pulse-red {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 10px 10px rgba(231, 76, 60, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

/* === Command Center Task List Styles === */
.command-center-details {
    padding: 15px;
    background-color: #fff;
}
.command-center-details ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.command-center-details .command-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 12px 5px;
    border-bottom: 1px solid #f0f0f0;
}
.command-center-details .command-item:last-child {
    border-bottom: none;
}
.command-center-details .command-item[data-url] {
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}
.command-center-details .command-item[data-url]:hover {
    background-color: #f8f9fa;
}
.command-center-details .command-item-status .dashicons {
    font-size: 20px;
    margin-top: 2px;
}
.command-item-details {
    flex-grow: 1;
}
.command-item[data-url]:hover .command-item-title {
    color: #7c471f;
}
.command-item.complete .command-item-title {
    text-decoration: line-through;
    color: #95a5a6;
}
.command-item-title {
    font-weight: 500;
}
.command-center-details .command-item-time {
    font-size: 0.9em;
    color: #777;
    font-weight: normal;
}
.command-item-description {
    font-size: 0.9em;
    color: #777;
    margin-top: 4px;
}
.command-center-details .command-item-action {
    margin-left: auto;
    display: flex;
    gap: 5px;
    align-items: center;
}
.command-item-action .button {
    background-color: #7c471f;
    border-color: #7c471f;
    color: #fff;
    padding: 2px 10px;
    font-size: 0.8em;
    line-height: 1.8;
}

/* === Market Status Indicator Styles === */
.market-status-display .status-indicator {
    padding: 2px 6px;
    border-radius: 3px;
    color: #fff;
    font-family: monospace;
    text-transform: uppercase;
    font-weight: bold;
}
.market-status-display .status-indicator.open, .market-status-display .status-indicator.regular { background-color: #2ecc71; }
.market-status-display .status-indicator.closed { background-color: #e74c3c; }
.market-status-display .status-indicator.pre, .market-status-display .status-indicator.post, .market-status-display .status-indicator.prepre, .market-status-display .status-indicator.postpost { background-color: #f39c12; }
.market-status-display .status-indicator.unknown, .market-status-display .status-indicator.not-configured { background-color: #95a5a6; }
