/* --- Statistics Modal Enhancements --- */
.stats-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #334155;
    padding-bottom: 0.5rem;
}

.stats-tabs button {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 0.5rem;
    transition: 0.3s;
}

.stats-tabs button.active {
    color: #fff;
    background: #1e293b;
    font-weight: bold;
}

.stats-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stats-section {
    background: #1e293b;
    border-radius: 0.75rem;
    padding: 1.25rem;
    border: 1px solid #334155;
}

.stats-section h5 {
    color: #94a3b8;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inf-summary-box {
    text-align: center;
    padding: 1rem;
}

.inf-item-tag {
    font-size: 1.5rem;
    color: #f59e0b;
    font-weight: bold;
    margin-bottom: 0.5rem;
    display: block;
}

.inf-price-val {
    font-size: 1.1rem;
    color: #fff;
}

/* User Panel */
.user-panel {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-login {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #06C755;
    /* LINE Green */
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: transform 0.2s;
}

.btn-login:hover {
    transform: scale(1.05);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.25rem 0.75rem 0.25rem 0.25rem;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-info img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid white;
}

.user-info span {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-logout {
    background: transparent;
    border: 1px solid #aaa;
    color: #e2e8f0;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    cursor: pointer;
    margin-left: 0.5rem;
}

/* CTA Card Wrapper (Glassmorphism) */
.cta-card {
    background: rgba(30, 41, 59, 0.7);
    /* Darker Glass */
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Add a subtle shine effect */
.cta-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.12), transparent);
    /* Increased opacity */
    transform: skewX(-25deg) translateX(-150%);
    animation: shimmer 4s infinite cubic-bezier(0.4, 0, 0.2, 1);
    /* Dynamic movement */
    pointer-events: none;
}

@keyframes shimmer {
    0% {
        transform: skewX(-25deg) translateX(-150%);
    }

    20% {
        transform: skewX(-25deg) translateX(150%);
    }

    100% {
        transform: skewX(-25deg) translateX(150%);
    }
}

/* Enhanced LINE Login CTA (Green Version of View Stats) */
.btn-line-cta {
    background: linear-gradient(135deg, #06C755 0%, #22c55e 100%);
    /* LINE Green */
    color: white;
    border: none;
    font-weight: bold;
    font-size: 1rem;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(6, 199, 85, 0.4);
    animation: pulse-green 2s infinite;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-block;
}

.btn-line-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 199, 85, 0.6);
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(6, 199, 85, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(6, 199, 85, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(6, 199, 85, 0);
    }
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    /* Removed margin since card handles padding */
}

.btn-secondary {
    background: #3b82f6;
    color: white;
}

/* Enhanced View Stats Button (High Visibility) */
#btn-view-stats {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    /* Indigo to Purple */
    color: white;
    border: none;
    font-weight: bold;
    font-size: 1.25rem;
    padding: 1rem 3rem;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    animation: pulse-glow 2s infinite;
}

#btn-view-stats:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.6);
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(168, 85, 247, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(168, 85, 247, 0);
    }
}

/* Enhanced Education CTA (Blue Version of View Stats) */
.btn-blue-cta {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    background: linear-gradient(135.47deg, #007AFF 0%, #00C7BE 100%);
    /* Blue to Teal */
    border: none;
    text-decoration: none;
    color: white;
    font-weight: 600;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
    animation: pulse-blue 2s infinite;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-blue-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.5);
    color: white;
    /* Ensure visible on hover */
}

@keyframes pulse-blue {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 122, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 122, 255, 0);
    }
}

/* Global Modal & Responsive Enhancements (V3.5) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(8px);
    padding: 1rem;
    /* Avoid touching edges */
}

.modal-content {
    background: #1e293b;
    padding: 2rem;
    border-radius: 20px;
    width: 100%;
    max-width: 950px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.stats-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .modal-content {
        padding: 1.5rem 1rem 1.5rem 1rem;
        border-radius: 16px;
    }

    .stats-tabs {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }

    .stats-tabs button {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .stats-section {
        padding: 1rem;
    }

    .stats-section h5 {
        font-size: 1rem;
        justify-content: center;
    }

    .inf-item-tag {
        font-size: 1.25rem;
    }
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.5rem;
    cursor: pointer;
}

.stats-content h3 {
    margin-bottom: 0.5rem;
}

.stats-summary {
    color: #94a3b8;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.table-container {
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 0.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

th,
td {
    padding: 0.75rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th {
    color: #94a3b8;
    font-weight: 500;
}

td {
    color: #e2e8f0;
}

tr:last-child td {
    border-bottom: none;
}

td:first-child {
    text-align: left;
    font-weight: bold;
    color: #3b82f6;
    min-width: 120px;
}

/* Inflation Feed V2 */
.inf-feed-container {
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-right: 0.5rem;
    margin-top: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.inf-item-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s;
}

.inf-item-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
}

.inf-item-info {
    text-align: left;
}

.inf-item-name {
    display: block;
    font-weight: bold;
    color: #accfff;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.inf-item-prices {
    font-size: 0.8rem;
    color: #94a3b8;
}

.inf-item-rate {
    text-align: right;
}

.inf-rate-val {
    display: block;
    color: #ff6b6b;
    font-weight: bold;
    font-size: 1.1rem;
}

.inf-rate-label {
    font-size: 0.7rem;
    color: #64748b;
}

.inf-empty {
    padding: 2rem;
    color: #64748b;
    font-size: 0.9rem;
    font-style: italic;
}

.hidden {
    display: none !important;
}

/* --- Site Footer (Integrated Compact) --- */
.site-footer {
    text-align: center;
    padding: 1rem 1rem 3rem;
    /* Much tighter padding */
    margin-top: 1rem;
    color: #cbd5e1;
    /* Slate-300 to match page text */
    font-size: 0.8rem;
    opacity: 0.9;
    border: none;
    background: transparent;
    position: relative;
    z-index: 10;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.footer-content p {
    margin: 0;
}

.site-footer a {
    color: inherit;
    /* Match text color */
    text-decoration: underline;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.site-footer a:hover {
    color: #fff;
    opacity: 1;
}

.privacy-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
}