/* HC Galeri · Sabit footer ve gezinme geçmişi v2 */

:root {
    --hc-fixed-footer-height: 54px;
}

body {
    padding-bottom: var(--hc-fixed-footer-height) !important;
}

.site-footer {
    position: fixed !important;
    z-index: 205 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    padding: 5px 0 !important;
    border-top: 1px solid color-mix(in srgb, var(--border) 86%, transparent) !important;
    background: color-mix(in srgb, var(--surface) 92%, transparent) !important;
    box-shadow: 0 -8px 28px color-mix(in srgb, #000 8%, transparent);
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
    overflow: visible !important;
}

.site-footer .footer-inner {
    min-height: 43px !important;
}

html.is-lightbox-open .site-footer {
    display: none !important;
}

.footer-copy-history {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    min-width: max-content;
}

.footer-history-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.footer-history-menu > summary {
    list-style: none;
}

.footer-history-menu > summary::-webkit-details-marker {
    display: none;
}

.footer-history-trigger {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--muted);
    background: var(--surface);
    cursor: pointer;
    transition: color .16s ease, border-color .16s ease, background .16s ease;
}

.footer-history-trigger svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.footer-history-menu[open] > .footer-history-trigger,
.footer-history-trigger:hover,
.footer-history-trigger:focus-visible {
    color: var(--primary);
    border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
    background: var(--primary-soft);
    outline: none;
}

.footer-history-menu::before {
    content: "";
    position: absolute;
    right: 0;
    bottom: 100%;
    width: 100%;
    height: 12px;
    pointer-events: auto;
}

.footer-history-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    z-index: 220;
    display: grid;
    width: min(430px, calc(100vw - 20px));
    max-height: min(500px, calc(100dvh - var(--header-height) - var(--hc-fixed-footer-height) - 28px));
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

.footer-history-ranges {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 8px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.footer-history-ranges button,
.footer-history-ranges a {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 32px;
    padding: 5px 4px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--muted);
    background: transparent;
    font-size: 10px;
    font-weight: 780;
    text-align: center;
}

.footer-history-ranges button:hover,
.footer-history-ranges button.is-active,
.footer-history-ranges a:hover,
.footer-history-ranges a:focus-visible {
    color: var(--primary);
    border-color: color-mix(in srgb, var(--primary) 25%, var(--border));
    background: var(--primary-soft);
    outline: none;
}

.footer-history-list {
    display: grid;
    max-height: 410px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.footer-history-state {
    display: grid;
    place-items: center;
    min-height: 160px;
    padding: 20px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.footer-history-item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-width: 0;
    min-height: 54px;
    padding: 9px 11px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    background: var(--surface);
}

.footer-history-item:last-child {
    border-bottom: 0;
}

.footer-history-item:hover {
    color: var(--primary);
    background: var(--surface-2);
}

.footer-history-thumb,
.history-card-thumb {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    background: var(--surface-2);
}

.footer-history-thumb img,
.history-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.footer-history-thumb .icon,
.history-card-thumb .icon {
    width: 15px;
    height: 15px;
}

.footer-history-copy,
.history-card-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.footer-history-copy strong,
.footer-history-copy small,
.history-card-copy strong,
.history-card-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.footer-history-copy strong {
    font-size: 11px;
}

.footer-history-copy small {
    color: var(--muted);
    font-size: 9px;
}

.footer-history-time {
    color: var(--muted);
    font-size: 9px;
    white-space: nowrap;
}

.history-page-hero {
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(circle at 10% 0%, color-mix(in srgb, var(--primary) 11%, transparent), transparent 38%),
        var(--surface);
}

.history-page-hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    min-height: 148px;
    padding-top: 24px;
    padding-bottom: 24px;
}

.history-page-hero h1 {
    margin: 3px 0 5px;
    font-size: clamp(27px, 3.2vw, 42px);
    line-height: 1.08;
    letter-spacing: -.9px;
}

.history-page-hero p {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
}

.history-total-card {
    display: grid;
    min-width: 118px;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    text-align: center;
}

.history-total-card strong {
    color: var(--primary);
    font-size: 21px;
}

.history-total-card small {
    color: var(--muted);
    font-size: 10px;
}

.history-filter-card {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.history-minute-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.history-minute-tabs a {
    display: grid;
    place-items: center;
    min-height: 36px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--muted);
    background: var(--surface-2);
    font-size: 11px;
    font-weight: 760;
}

.history-minute-tabs a:hover,
.history-minute-tabs a.is-active {
    color: var(--primary);
    border-color: color-mix(in srgb, var(--primary) 36%, var(--border));
    background: var(--primary-soft);
}

.history-date-filter {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) 92px auto auto;
    align-items: end;
    gap: 9px;
}

.history-date-filter label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 760;
}

.history-list {
    display: grid;
    gap: 7px;
}

.history-card {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease;
}

.history-card:hover {
    color: var(--primary);
    border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
    background: var(--surface-2);
    transform: translateY(-1px);
}

.history-card.is-unavailable {
    opacity: .58;
    cursor: not-allowed;
}

.history-card-copy strong {
    font-size: 12px;
}

.history-card-copy small {
    color: var(--muted);
    font-size: 10px;
}

.history-card-time {
    display: grid;
    justify-items: end;
    gap: 2px;
    white-space: nowrap;
}

.history-card-time strong {
    color: var(--muted);
    font-size: 10px;
}

.history-card-time small {
    color: var(--muted);
    font-size: 9px;
}

@media (min-width: 901px) {
    .footer-history-menu:hover {
        z-index: 225;
    }
}

@media (max-width: 820px) {
    .history-date-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .history-per-page-field {
        grid-column: auto;
    }

    .history-date-filter .button {
        width: 100%;
    }
}

@media (max-width: 620px) {
    :root {
        --hc-fixed-footer-height: 50px;
    }

    .site-footer {
        padding: 3px 0 !important;
    }

    .site-footer .brand-footer,
    .site-footer .footer-inner > div:first-child {
        display: none !important;
    }

    .site-footer .footer-inner {
        display: flex !important;
        justify-content: flex-end;
        min-height: 43px !important;
    }

    .site-footer .footer-inner nav {
        display: none !important;
    }

    .footer-history-panel {
        position: fixed;
        right: 8px;
        bottom: calc(var(--hc-fixed-footer-height) + 8px);
        left: 8px;
        width: auto;
        max-height: min(500px, calc(100dvh - var(--header-height) - var(--hc-fixed-footer-height) - 24px));
    }

    .history-page-hero-inner {
        align-items: stretch;
        flex-direction: column;
        min-height: 0;
    }

    .history-total-card {
        width: 100%;
    }

    .history-minute-tabs {
        grid-template-columns: repeat(5, minmax(54px, 1fr));
        overflow-x: auto;
    }

    .history-date-filter {
        grid-template-columns: minmax(0, 1fr);
    }

    .history-card,
    .footer-history-item {
        grid-template-columns: 32px minmax(0, 1fr);
    }

    .history-card-time,
    .footer-history-time {
        display: none;
    }
}
