/* Main Container: Grid System */
.cht-fe-container {
    display: grid;
    grid-template-columns: repeat(var(--cht-grid-cols, 3), 1fr);
    gap: 20px;
    margin: 20px 0;
}

/* Card Design */
.cht-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.cht-card:hover {
    transform: translateY(-2px);
}

.cht-card-header {
    background-color: var(--cht-primary, #2EBE38);
    color: #fff;
    padding: 15px;
    text-align: center;
}

.cht-card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

.cht-source-label {
    display: inline-block;
    margin-top: 5px;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.cht-card-body {
    padding: 0;
}

.cht-fe-table {
    width: 100%;
    border-collapse: collapse;
}

.cht-fe-table th,
.cht-fe-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.cht-fe-table th {
    background-color: var(--cht-accent, #020617);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.cht-fe-table td {
    font-size: 0.95rem;
    color: #333;
}

.cht-fe-table tr:last-child td {
    border-bottom: none;
}

.cht-fe-table tr:nth-child(even) {
    background-color: #f8fafc;
}

.cht-card-footer {
    padding: 10px 15px;
    background-color: #f1f5f9;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    font-size: 0.8rem;
    color: #64748b;
}

.cht-disclaimer-global {
    margin-top: 10px;
    font-style: italic;
    text-align: center;
    color: #64748b;
    font-size: 0.8rem;
}

/* Trend Indicators */
.cht-trend {
    font-size: 0.8em;
    margin-left: 8px;
    font-weight: 600;
}

.cht-trend-up {
    color: #16a34a;
    /* Green */
}

.cht-trend-down {
    color: #dc2626;
    /* Red */
}

.cht-trend-flat {
    color: #94a3b8;
}

/* Ticker Styles */
.cht-ticker-wrap {
    width: 100%;
    background: #020617;
    background: var(--cht-accent);
    color: #fff;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    display: flex;
    align-items: center;
    height: 40px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border-radius: 4px;
}

.cht-ticker-heading {
    background: #000000;
    padding: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 0.9em;
    z-index: 10;
    flex-shrink: 0;
    /* Prevent shrinking */
}

.cht-ticker {
    display: flex;
    /* Use flexbox for items */
    width: fit-content;
    /* Allow width to grow based on content */
    animation: cht-ticker 60s linear infinite;
    /* Increased duration for smoothness */
    padding-left: 0;
    /* Remove padding */
}

.cht-ticker-item {
    flex-shrink: 0;
    /* Don't squash items */
    padding: 0 20px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.cht-ticker-item strong {
    color: #cbd5e1;
}

.cht-tick-up {
    color: #86efac;
}

.cht-tick-down {
    color: #fca5a5;
}

@keyframes cht-ticker {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Archive Search */
.cht-archive-search {
    margin-bottom: 20px;
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.cht-archive-form {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 600px;
    gap: 10px;
    margin: 0px auto;
}

.cht-archive-form label {
    font-size: 14px;
}

.cht-archive-form input {
    min-width: 0px;
    padding: 0px 10px;
    border-width: 1px;
    border-style: solid;
    border-color: rgb(203, 213, 225);
    border-image: initial;
    border-radius: 4px;
    flex: 1 1 0%;
}

.cht-archive-form button {
    cursor: pointer;
    flex-shrink: 0;
    color: rgb(255, 255, 255) !important;
    background: var(--cht-primary, #2EBE38);
    border-width: initial;
    border-style: none;
    border-color: initial;
    border-image: initial;
    padding: 9px 18px !important;
    border-radius: 4px !important;
}

.cht-archive-form button:hover {
    opacity: 0.9;
}

.cht-clear-filter {
    color: #ef4444;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
}

/* Action Buttons */
.cht-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #cbd5e1;
}

.cht-btn-pdf,
.cht-btn-wa {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.cht-btn-pdf {
    background-color: #ef4444;
    color: #fff;
}

.cht-btn-pdf:hover {
    background-color: #dc2626;
}

.cht-btn-wa {
    background-color: #25D366;
    color: #fff;
}

.cht-btn-wa:hover {
    background-color: #128c7e;
    color: #ffffff;
}

@media (max-width: 600px) {
    .cht-ticker-heading {
        display: none;
    }

    .cht-archive-search {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Currency Module */
.cht-currency-wrapper {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cht-currency-header {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--cht-accent, #020617);
    border-bottom: 2px solid var(--cht-primary, #2EBE38);
    padding-bottom: 5px;
}

.cht-currency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.cht-currency-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    transition: transform 0.2s;
    height: 100%;
}

.cht-currency-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.cht-curr-code {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--cht-primary, #2EBE38);
}

.cht-curr-name {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cht-curr-rates {
    font-size: 0.9rem;
}

.cht-rate-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.cht-currency-footer {
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: right;
    margin-top: 10px;
    font-style: italic;
}