/* CONTAINER */
.travelgate-comments {
    --tg-font-sans: Arial, Helvetica, sans-serif;
    --tg-color-text: #333333;
    --tg-color-muted: #666666;
    --tg-primary: #1e3a8a;
    --tg-accent: #e63946;
    --tg-border: #eeeeee;
    --tg-bg-muted: #f5f5f5;
    font-family: var(--tg-font-sans);
    max-width: 1000px;
    margin: 0 auto;
    color: var(--tg-color-text);
    box-sizing: border-box;
    padding: 0.75em;
}

/* HEADER */
.travelgate-comments .tg-comments-header {
    display: flex;
    justify-content: center;
    gap: 2.5em;
    border-bottom: 1px solid var(--tg-border);
    padding-bottom: 1.25em;
    margin-bottom: 1.25em;
    flex-wrap: wrap;
    align-items: start;
}

/* LEFT: SCORE */
.travelgate-comments .tg-rating {
    max-width: 320px;
    min-width: 200px;
}

.travelgate-comments .tg-score {
    font-size: 2em;
    font-weight: 700;
    display: flex;
    align-items: baseline;
    gap: 0.5em;
}

.travelgate-comments .tg-slash {
    font-size: 0.95em;
    color: #777777;
}

.travelgate-comments .tg-stars-big {
    color: var(--tg-primary);
    margin: 0.3em 0;
    font-size: 1.15em;
    line-height: 1;

    display: block;
    margin: 0.45em 0 0.6em 0;
    letter-spacing: 10px;
    font-size: 1.25em;
}

.travelgate-comments .tg-sub {
    font-size: 0.9em;
    color: var(--tg-color-muted);
    margin-bottom: 0.4em;
}

.travelgate-comments .tg-link {
    font-size: 0.9em;
    color: var(--tg-primary);
    text-decoration: none;
}

.travelgate-comments .tg-link:focus,
.travelgate-comments .tg-link:hover {
    text-decoration: underline;
    outline: none;
}

/* RIGHT: BREAKDOWN */
.travelgate-comments .tg-breakdown {
    flex: 1 1 420px;
    max-width: 320px;
}

.travelgate-comments .tg-breakdown-title {
    font-weight: 700;
    margin-bottom: 0.75em;
    font-size: 0.95em;
}

.travelgate-comments .tg-bar-row {
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-size: 0.9em;
    margin-bottom: 0.5em;
}

.travelgate-comments .tg-bar-row span:first-child {
    width: 36px;
    flex: 0 0 36px;
    text-align: left;
}

.travelgate-comments .tg-bar-row span:last-child {
    width: 44px;
    flex: 0 0 44px;
    text-align: right;
}

.travelgate-comments .tg-bar {
    flex: 1 1 auto;
    height: 8px;
    background: var(--tg-border);
    border-radius: 6px;
    overflow: hidden;
}

.travelgate-comments .tg-fill {
    height: 100%;
    background: var(--tg-primary);
}

/* FILTERS */
.travelgate-comments .tg-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25em;
    gap: 1em;

    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.travelgate-comments .tg-filter-label {
    font-weight: 700;
    font-size: 0.95em;
}

.travelgate-comments .tg-filter-controls {
    display: flex;
    gap: 0.5em;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
}

.travelgate-comments .tg-select,
.travelgate-comments .tg-search {
    padding: 0.5em 0.6em;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95em;
    background: #ffffff;
    transition: box-shadow .15s ease, border-color .15s ease;
}

.travelgate-comments .tg-select:focus,
.travelgate-comments .tg-search:focus {
    outline: none;
    border-color: var(--tg-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.08);
}

.travelgate-comments .tg-search {
    min-width: 180px;
}

/* COMMENTS GRID */
.travelgate-comments .tg-comments-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1em;
}

/* CARD */
.travelgate-comments .tg-comment-card {
    border: 1px solid var(--tg-border);
    border-radius: 12px;
    padding: 1em;
    background: #ffffff;
    transition: transform .15s ease, box-shadow .15s ease;
    display: flex;
    flex-direction: column;
}

.travelgate-comments .tg-comment-card:hover,
.travelgate-comments .tg-comment-card:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(16, 24, 40, 0.06);
}

/* HEADER CARD */
.travelgate-comments .tg-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6em;
    gap: 0.5em;
}

.travelgate-comments .tg-title {
    font-size: 1em;
    font-weight: 700;
    margin: 0;
}

.travelgate-comments .tg-stars {
    color: var(--tg-accent);
    font-size: 0.95em;
}

/* TEXT */
.travelgate-comments .tg-comment-text {
    font-size: 0.95em;
    margin-bottom: 0.75em;
    line-height: 1.5;
    color: #222;
}

/* META */
.travelgate-comments .tg-comment-meta {
    font-size: 0.85em;
    color: #8a8a8a;
    margin-bottom: 0.5em;
}

/* RESPONSE */
.travelgate-comments .tg-response {
    background: var(--tg-bg-muted);
    padding: 0.65em;
    border-radius: 8px;
    font-size: 0.92em;
    color: #4b5563;
}

.travelgate-comments .tg-no-results,
.travelgate-comments .tg-loading {
    padding: 1em;
    border: 1px dashed var(--tg-border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--tg-color-muted);
    text-align: center;
}

/* Placeholder / loading shimmer for numeric/text values */
.travelgate-comments .tg-blurred {
    display: inline-block;
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    color: transparent;
    border-radius: 4px;
    min-width: 28px;
    height: 1em;
    line-height: 1em;
    vertical-align: middle;
    animation: tg-shimmer 1.2s linear infinite;
}

@keyframes tg-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .travelgate-comments {
        padding: 0.5em;
    }

    .travelgate-comments .tg-comments-header {
        flex-direction: column;
        align-items: stretch;
    }

    .travelgate-comments .tg-rating,
    .travelgate-comments .tg-breakdown {
        max-width: 100%;
        min-width: 0;
    }

    .travelgate-comments .tg-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5em;
    }

    .travelgate-comments .tg-filter-controls {
        justify-content: stretch;
    }

    .travelgate-comments .tg-select,
    .travelgate-comments .tg-search {
        width: 100%;
    }

    .travelgate-comments .tg-comments-list {
        grid-template-columns: 1fr;
    }
}

/* PAGINATION */
.travelgate-comments .tg-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1em;
    margin-top: 1.5em;
    padding-top: 1em;
    border-top: 1px solid var(--tg-border);
}

.travelgate-comments .tg-page-btn {
    padding: 0.5em 1em;
    border: 1px solid var(--tg-primary);
    background: #ffffff;
    color: var(--tg-primary);
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.travelgate-comments .tg-page-btn:hover:not(:disabled) {
    background: var(--tg-primary);
    color: #ffffff;
}

.travelgate-comments .tg-page-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.08);
}

.travelgate-comments .tg-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}