/*
 * HerkesMemnun Design System — Foundation
 * -----------------------------------
 * Bu dosya HerkesMemnun arayüzünün ortak tasarım sözleşmesidir.
 *
 * Geçiş prensibi:
 * - Yeni ortak UI kuralları burada tanımlanır.
 * - Sayfaya özel geçici yamalar yerine ef-* primitive/component sınıfları kullanılır.
 * - Eski sayfalar aşamalı olarak taşınır; bu dosya tek başına mevcut görünümü değiştirmez.
 */

:root {
    /* Approved HerkesMemnun brand — navy + orange */
    --ef-color-navy: #0F172A;
    --ef-color-navy-dark: #0B1220;
    --ef-color-blue: #FF6A3D;
    --ef-color-blue-dark: #E85A2F;
    --ef-color-turquoise: #FF6A3D;
    --ef-color-turquoise-dark: #E85A2F;

    /* Neutral */
    --ef-color-white: #ffffff;
    --ef-color-page: #F6F7F9;
    --ef-color-surface: #ffffff;
    --ef-color-surface-soft: #FAFAFB;
    --ef-color-text: #0F172A;
    --ef-color-text-soft: #334155;
    --ef-color-muted: #64748b;
    --ef-color-light: #94a3b8;
    --ef-color-border: #E2E8F0;

    /* Semantic */
    --ef-color-success: #169b78;
    --ef-color-danger: #dc3545;
    --ef-color-warning: #d99a00;
    --ef-color-info-soft: #FFF4EF;
    --ef-color-success-soft: #e9fbf8;
    --ef-color-danger-soft: #fff1f2;
    --ef-color-warning-soft: #fff8df;

    /* Typography */
    --ef-font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --ef-font-size-xs: 12px;
    --ef-font-size-sm: 13px;
    --ef-font-size-md: 15px;
    --ef-font-size-lg: 18px;
    --ef-font-size-xl: 22px;
    --ef-font-size-2xl: 28px;
    --ef-font-size-3xl: 36px;
    --ef-line-height-tight: 1.2;
    --ef-line-height-normal: 1.5;
    --ef-line-height-relaxed: 1.65;

    /* Spacing — 4px base scale */
    --ef-space-0: 0;
    --ef-space-1: 4px;
    --ef-space-2: 8px;
    --ef-space-3: 12px;
    --ef-space-4: 16px;
    --ef-space-5: 24px;
    --ef-space-6: 32px;
    --ef-space-7: 40px;
    --ef-space-8: 48px;

    /* Shape */
    --ef-radius-sm: 8px;
    --ef-radius-md: 12px;
    --ef-radius-lg: 16px;
    --ef-radius-pill: 999px;

    /* Elevation */
    --ef-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --ef-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --ef-shadow-lg: 0 18px 45px rgba(15, 23, 42, 0.12);

    /* Layout */
    --ef-container-max: 1200px;
    --ef-page-gutter: 24px;
    --ef-control-height: 44px;

    /* Motion */
    --ef-transition-fast: 150ms ease;
    --ef-transition-normal: 220ms ease;
}

.ef-ui,
.ef-ui *,
.ef-ui *::before,
.ef-ui *::after {
    box-sizing: border-box;
}

.ef-ui {
    color: var(--ef-color-text);
    font-family: var(--ef-font-sans);
    font-size: var(--ef-font-size-md);
    line-height: var(--ef-line-height-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.ef-container {
    width: min(100%, var(--ef-container-max));
    margin-inline: auto;
    padding-inline: var(--ef-page-gutter);
}

.ef-stack {
    display: flex;
    flex-direction: column;
    gap: var(--ef-stack-gap, var(--ef-space-4));
}

.ef-cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--ef-cluster-gap, var(--ef-space-3));
}

.ef-grid {
    display: grid;
    grid-template-columns: repeat(var(--ef-grid-columns, 12), minmax(0, 1fr));
    gap: var(--ef-grid-gap, var(--ef-space-5));
}

.ef-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--ef-space-5);
    margin-bottom: var(--ef-space-5);
}

.ef-page-header__main {
    min-width: 0;
}

.ef-page-header__actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--ef-space-2);
}

.ef-page-title {
    margin: 0;
    color: var(--ef-color-navy);
    font-family: var(--ef-font-sans);
    font-size: clamp(24px, 3vw, var(--ef-font-size-3xl));
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.025em;
    overflow-wrap: anywhere;
}

.ef-page-description {
    max-width: 760px;
    margin: var(--ef-space-2) 0 0;
    color: var(--ef-color-muted);
    font-size: var(--ef-font-size-md);
    line-height: var(--ef-line-height-relaxed);
}

.ef-card {
    min-width: 0;
    background: var(--ef-color-surface);
    border: 1px solid var(--ef-color-border);
    border-radius: var(--ef-radius-md);
    box-shadow: var(--ef-shadow-sm);
}

.ef-card__header,
.ef-card__body,
.ef-card__footer {
    padding: var(--ef-space-4);
}

.ef-card__header {
    border-bottom: 1px solid var(--ef-color-border);
}

.ef-card__footer {
    border-top: 1px solid var(--ef-color-border);
}

.ef-card__title {
    margin: 0;
    color: var(--ef-color-text);
    font-size: var(--ef-font-size-lg);
    font-weight: 750;
    line-height: 1.3;
}

.ef-btn {
    display: inline-flex;
    min-height: var(--ef-control-height);
    align-items: center;
    justify-content: center;
    gap: var(--ef-space-2);
    padding: 0 16px;
    appearance: none;
    border: 1px solid transparent;
    border-radius: var(--ef-radius-sm);
    cursor: pointer;
    font-family: var(--ef-font-sans);
    font-size: var(--ef-font-size-sm);
    font-weight: 750;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    transition:
        background-color var(--ef-transition-fast),
        border-color var(--ef-transition-fast),
        color var(--ef-transition-fast),
        box-shadow var(--ef-transition-fast),
        transform var(--ef-transition-fast);
}

.ef-btn:hover { text-decoration: none; }
.ef-btn:active { transform: translateY(1px); }

.ef-btn:disabled,
.ef-btn[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.55;
    pointer-events: none;
}

.ef-btn--primary,
.ef-btn--accent {
    color: var(--ef-color-white);
    background: var(--ef-color-turquoise);
    border-color: var(--ef-color-turquoise);
}

.ef-btn--primary:hover,
.ef-btn--accent:hover {
    color: var(--ef-color-white);
    background: var(--ef-color-turquoise-dark);
    border-color: var(--ef-color-turquoise-dark);
}

.ef-btn--secondary {
    color: var(--ef-color-navy);
    background: var(--ef-color-white);
    border-color: var(--ef-color-border);
}

.ef-btn--secondary:hover {
    color: var(--ef-color-navy-dark);
    background: var(--ef-color-surface-soft);
    border-color: #cbd5e1;
}

.ef-btn--ghost {
    color: var(--ef-color-navy);
    background: transparent;
    border-color: transparent;
}

.ef-btn--ghost:hover {
    color: var(--ef-color-navy-dark);
    background: var(--ef-color-surface-soft);
}

.ef-btn--danger {
    color: var(--ef-color-white);
    background: var(--ef-color-danger);
    border-color: var(--ef-color-danger);
}

.ef-btn--sm { min-height: 36px; padding-inline: 12px; font-size: var(--ef-font-size-xs); }
.ef-btn--lg { min-height: 50px; padding-inline: 20px; font-size: var(--ef-font-size-md); }
.ef-btn--block { width: 100%; }

.ef-form-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: var(--ef-space-2);
}

.ef-label {
    margin: 0;
    color: var(--ef-color-text-soft);
    font-size: var(--ef-font-size-sm);
    font-weight: 700;
    line-height: 1.35;
}

.ef-help {
    margin: 0;
    color: var(--ef-color-muted);
    font-size: var(--ef-font-size-xs);
    line-height: 1.5;
}

.ef-error {
    margin: 0;
    color: var(--ef-color-danger);
    font-size: var(--ef-font-size-xs);
    font-weight: 650;
    line-height: 1.45;
}

.ef-input,
.ef-select,
.ef-textarea {
    width: 100%;
    min-width: 0;
    color: var(--ef-color-text);
    background: var(--ef-color-white);
    border: 1px solid #cbd5e1;
    border-radius: var(--ef-radius-sm);
    font-family: var(--ef-font-sans);
    font-size: 14px;
    line-height: 1.4;
    transition:
        border-color var(--ef-transition-fast),
        box-shadow var(--ef-transition-fast),
        background-color var(--ef-transition-fast);
}

.ef-input,
.ef-select { min-height: var(--ef-control-height); padding: 0 12px; }
.ef-textarea { min-height: 120px; padding: 11px 12px; resize: vertical; }
.ef-input::placeholder,
.ef-textarea::placeholder { color: var(--ef-color-light); }

.ef-input[aria-invalid="true"],
.ef-select[aria-invalid="true"],
.ef-textarea[aria-invalid="true"] { border-color: var(--ef-color-danger); }

.ef-badge {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 4px 8px;
    color: var(--ef-color-text-soft);
    background: var(--ef-color-surface-soft);
    border: 1px solid var(--ef-color-border);
    border-radius: var(--ef-radius-pill);
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.ef-badge--info {
    color: #B9381E;
    background: var(--ef-color-info-soft);
    border-color: #FFD8CA;
}

.ef-badge--success { color: #08715a; background: var(--ef-color-success-soft); border-color: #bcebe2; }
.ef-badge--warning { color: #7a4d00; background: var(--ef-color-warning-soft); border-color: #efd27a; }
.ef-badge--danger { color: #9f1239; background: var(--ef-color-danger-soft); border-color: #fecdd3; }

.ef-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--ef-space-3);
    min-height: 220px;
    padding: var(--ef-space-6);
    color: var(--ef-color-muted);
    background: var(--ef-color-surface);
    border: 1px dashed #cbd5e1;
    border-radius: var(--ef-radius-md);
    text-align: center;
}

.ef-empty-state__title {
    margin: 0;
    color: var(--ef-color-text);
    font-size: var(--ef-font-size-lg);
    font-weight: 750;
}

.ef-empty-state__text { max-width: 560px; margin: 0; line-height: var(--ef-line-height-relaxed); }

.ef-table-wrap {
    width: 100%;
    overflow-x: auto;
    background: var(--ef-color-white);
    border: 1px solid var(--ef-color-border);
    border-radius: var(--ef-radius-md);
}

.ef-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--ef-color-text-soft);
    font-family: var(--ef-font-sans);
    font-size: var(--ef-font-size-sm);
}

.ef-table th,
.ef-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--ef-color-border);
    text-align: left;
    vertical-align: middle;
}

.ef-table th {
    color: var(--ef-color-navy);
    background: var(--ef-color-surface-soft);
    font-size: var(--ef-font-size-xs);
    font-weight: 800;
    letter-spacing: 0.02em;
}

.ef-table tr:last-child td { border-bottom: 0; }

.ef-btn:focus-visible,
.ef-input:focus-visible,
.ef-select:focus-visible,
.ef-textarea:focus-visible,
.ef-ui a:focus-visible {
    outline: 3px solid rgba(255, 106, 61, 0.28);
    outline-offset: 2px;
}

.ef-input:focus,
.ef-select:focus,
.ef-textarea:focus {
    border-color: var(--ef-color-turquoise);
    box-shadow: 0 0 0 3px rgba(255, 106, 61, 0.14);
    outline: 0;
}

.ef-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 767.98px) {
    :root { --ef-page-gutter: 16px; --ef-control-height: 44px; }
    .ef-page-header { flex-direction: column; gap: var(--ef-space-3); margin-bottom: var(--ef-space-4); }
    .ef-page-header__actions { width: 100%; justify-content: flex-start; }
    .ef-page-title { font-size: 24px; line-height: 1.18; }
    .ef-card__header,
    .ef-card__body,
    .ef-card__footer { padding: var(--ef-space-3); }
    .ef-grid { grid-template-columns: 1fr; gap: var(--ef-space-4); }
}

@media (prefers-reduced-motion: reduce) {
    .ef-ui *,
    .ef-ui *::before,
    .ef-ui *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

html body .other-lists .hm-list-detail-shell {
    display: grid !important;
    grid-template-columns: 170px minmax(0, 1fr) !important;
    column-gap: 16px !important;
    row-gap: 0 !important;
    align-items: start !important;
}

html body .other-lists .hm-list-detail-shell > .hm-detail-header { grid-column: 1 / -1 !important; }

html body .other-lists .hm-list-detail-shell > .hm-detail-cover-wrap {
    grid-column: 1 !important;
    width: 170px !important;
    min-width: 170px !important;
    max-width: 170px !important;
    height: 128px !important;
    min-height: 128px !important;
    max-height: 128px !important;
    margin: 14px 0 0 !important;
    overflow: hidden !important;
    border: 1px solid var(--ef-color-border) !important;
    border-radius: 12px !important;
    background: var(--ef-color-surface-soft) !important;
}

html body .other-lists .hm-list-detail-shell > .hm-detail-cover-wrap > .hm-detail-cover-image {
    display: block !important;
    width: 170px !important;
    min-width: 170px !important;
    max-width: 170px !important;
    height: 128px !important;
    min-height: 128px !important;
    max-height: 128px !important;
    aspect-ratio: auto !important;
    object-fit: cover !important;
    object-position: center !important;
}

html body .other-lists .hm-list-detail-shell > .hm-detail-intro {
    grid-column: 2 !important;
    min-width: 0 !important;
    margin: 14px 0 0 !important;
    align-self: start !important;
}

html body .other-lists .hm-list-detail-shell > .hm-detail-intro .hm-detail-description { margin-top: 0 !important; }
html body .other-lists .hm-list-detail-shell > :not(.hm-detail-header):not(.hm-detail-cover-wrap):not(.hm-detail-intro) { grid-column: 1 / -1 !important; }

@media (max-width: 767.98px) {
    html body .other-lists .hm-list-detail-shell { grid-template-columns: 108px minmax(0, 1fr) !important; column-gap: 12px !important; }
    html body .other-lists .hm-list-detail-shell > .hm-detail-cover-wrap {
        width: 108px !important; min-width: 108px !important; max-width: 108px !important;
        height: 86px !important; min-height: 86px !important; max-height: 86px !important;
        margin-top: 12px !important; border-radius: 10px !important;
    }
    html body .other-lists .hm-list-detail-shell > .hm-detail-cover-wrap > .hm-detail-cover-image {
        width: 108px !important; min-width: 108px !important; max-width: 108px !important;
        height: 86px !important; min-height: 86px !important; max-height: 86px !important;
    }
    html body .other-lists .hm-list-detail-shell > .hm-detail-intro { margin-top: 12px !important; }
}

@media (max-width: 389.98px) {
    html body .other-lists .hm-list-detail-shell { grid-template-columns: 96px minmax(0, 1fr) !important; column-gap: 10px !important; }
    html body .other-lists .hm-list-detail-shell > .hm-detail-cover-wrap,
    html body .other-lists .hm-list-detail-shell > .hm-detail-cover-wrap > .hm-detail-cover-image {
        width: 96px !important; min-width: 96px !important; max-width: 96px !important;
        height: 76px !important; min-height: 76px !important; max-height: 76px !important;
    }
}

@media (min-width: 768px) {
    html body .hm-list-page-stage .other-lists .votes .vote-container.hm-item-card {
        grid-template-columns: 140px minmax(0, 1fr) !important;
        gap: 14px !important;
    }
    html body .hm-list-page-stage .other-lists .votes .vote-container.hm-item-card > .col-md-3 {
        display: flex !important; align-items: flex-start !important; justify-content: flex-start !important;
        width: 140px !important; min-width: 140px !important; max-width: 140px !important;
    }
    html body .hm-list-page-stage .other-lists .votes .vote-container.hm-item-card .hm-item-image-wrap {
        width: 140px !important; min-width: 140px !important; max-width: 140px !important;
        height: 140px !important; min-height: 140px !important; max-height: 140px !important;
        aspect-ratio: 1 / 1 !important; margin: 0 !important; border-radius: 10px !important;
    }
    html body .hm-list-page-stage .other-lists .votes .vote-container.hm-item-card .hm-item-rank-badge {
        top: 7px !important; left: 7px !important; width: 27px !important; min-width: 27px !important;
        height: 27px !important; min-height: 27px !important; font-size: 11px !important;
    }
}

@media (max-width: 767.98px) {
    html body .hm-list-page-stage .other-lists .votes .vote-container.hm-item-card > .col-md-3 {
        display: flex !important; align-items: flex-start !important; justify-content: flex-start !important;
    }
    html body .hm-list-page-stage .other-lists .votes .vote-container.hm-item-card .hm-item-image-wrap {
        width: 96px !important; min-width: 96px !important; max-width: 96px !important;
        height: 96px !important; min-height: 96px !important; max-height: 96px !important;
        aspect-ratio: 1 / 1 !important; margin: 0 !important; border-radius: 9px !important;
    }
    html body .hm-list-page-stage .other-lists .votes .vote-container.hm-item-card .hm-item-rank-badge {
        top: 6px !important; left: 6px !important; width: 24px !important; min-width: 24px !important;
        height: 24px !important; min-height: 24px !important; font-size: 10px !important;
    }
}
