/* Nav Dropdown */
.header .nav-dropdown {
    position: relative;
    overflow: visible;
}

.header .header__nav ul li:has(.nav-dropdown),
.header .header__nav ul:has(.nav-dropdown) {
    overflow: visible;
}

.header .nav-dropdown__menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: absolute;
    left: -5px;
    top: calc(100% + 5px);
    width: 220px;
    min-height: fit-content;
    height: fit-content;
    padding: 10px 18px;
    box-sizing: border-box;
    background: rgba(var(--bg-a), 1);
    border: solid 1px var(--br-b);
    border-radius: 8px;
    z-index: 100;
}

.header .nav-dropdown__menu[hidden] {
    display: none !important;
}

.header .nav-dropdown__menu > div {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: fit-content;
    height: auto;
    flex-shrink: 0;
    box-sizing: border-box;
}

.header .nav-dropdown__menu a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    min-height: 36px;
    height: auto;
    padding: 4px 8px;
    box-sizing: border-box;
    font-family: var(--font-family);
    font-size: clamp(13px, 1.28vw, 15px);
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
    /* legacy alias, older browser support */
    color: rgba(var(--cl-b), 1);
    transition: color 0.3s ease;
    font-size: 16px;
}

.header .nav-dropdown__menu a:hover,
.header .nav-dropdown__menu a.active {
    color: rgba(var(--cl-c), 1);
}

@media (max-width: 1024px) {
    .header .mobile {
        overflow: visible;
    }

    .header .nav-dropdown__menu {
        padding: 12px 16px;
        border-color: rgba(62, 62, 77, 0.6);
    }

    .header .nav-dropdown__menu a {
        font-size: 16px;
    }
}

/* User select (logged in) — link to dashboard, link görünüşü olmasın */
.user-select--link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 7px 0;
    min-width: fit-content;
    min-height: 46px;
    text-decoration: none !important;
    color: rgba(var(--cl-b), 1) !important;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.3s;
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 400;
}

.user-select--link-name {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.user-select--link:hover {
    color: rgba(var(--cl-c), 1) !important;
    text-decoration: none !important;
}

.user-select--link:focus,
.user-select--link:active {
    outline: none;
    text-decoration: none !important;
}

.user-select--link .select__name {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: rgba(var(--bg-c), 1);
    font-weight: 600;
    flex-shrink: 0;
    font-size: 16px;
}

/* User select (logged in) — logout form button */
.user-select .user-logout-form {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
}

.user-select .user-logout-form button {
    display: block;
    width: 100%;
    padding: inherit;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.user-select .user-logout-form button:hover {
    color: rgba(var(--cl-c), 1);
}

/* ——— Login / Register Modal: 50% Poster | 50% Form (keçid) ——— */
.overlay.active {
    z-index: 99999 !important;
}

.overlay .login-modal {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 900px;
    height: auto;
    min-height: 420px;
    max-height: 90vh;
    margin: 0;
    background: rgba(var(--bg-a), 1);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--br-b, rgba(255, 255, 255, 0.1));
    z-index: 100000;
    display: none;
    overflow-y: auto;
}

.overlay.active .login-modal.active {
    display: block;
}

.login-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: inherit;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    z-index: 100001;
}

.login-modal__close:hover {
    background: rgba(255, 255, 255, 0.08);
}

.login-modal__inner {
    display: flex;
    flex-direction: row;
    width: 100%;
    min-height: 420px;
}

/* Sol yarı — Poster */
.login-modal__poster {
    width: 50%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
    overflow: hidden;
    border-right: 1px solid var(--br-b, rgba(255, 255, 255, 0.1));
}

.login-modal__poster-link {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
    gap: 8px;
    width: 100%;
    min-height: 100%;
    padding: 32px 24px;
}

.login-modal__poster-img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    overflow: hidden;
    z-index: 0;
}

.login-modal__poster-link::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1;
}

.login-modal__poster-link .login-modal__poster-title,
.login-modal__poster-link .login-modal__poster-desc {
    position: relative;
    z-index: 2;
}

.login-modal__poster-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.login-modal__poster-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.login-modal__poster-link:hover .login-modal__poster-title {
    text-decoration: underline;
}

/* Sağ yarı — Form (Login / Register keçid) */
.login-modal__form-side {
    width: 50%;
    min-width: 0;
    padding: 24px 28px 28px;
    overflow-y: auto;
}

.login-modal__box {
    width: 100%;
}

/* Login / Register — sözlərin altında sayt rəngi xətt, 50% / 50%, mərkəzdə */
.login-modal__switch {
    display: flex;
    width: 100%;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--br-b, rgba(255, 255, 255, 0.12));
}

.login-modal__switch-btn {
    width: 50%;
    padding: 0 0 12px 0;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: rgba(var(--cl-b), 0.6);
    font-family: var(--font-family);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.login-modal__switch-btn:hover:not(.active) {
    color: rgba(var(--cl-b), 0.9);
}

.login-modal__switch-btn.active {
    color: rgba(var(--cl-c), 1);
    border-bottom-color: rgba(var(--cl-c), 1);
}

.login-modal__switch-btn:focus-visible {
    outline: 2px solid rgba(var(--cl-c), 0.5);
    outline-offset: 2px;
}

.login-modal__panels {
    position: relative;
}

.login-modal__panel {
    display: none;
}

.login-modal__panel.active {
    display: block;
}

/* ——— Modal form: login-register.blade.php ilə eyni (main-form, registration-section) ——— */
.login-modal .registration-section__inner {
    width: 100%;
}

.login-modal .registration-section__title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: rgba(var(--cl-b), 0.95);
}

/* Success / Error mesaj — modal daxilində (login-register ilə eyni) */
.login-modal__message {
    position: relative;
    margin-bottom: 16px;
    padding: 12px 44px 12px 16px;
    border-radius: 8px;
    min-height: 48px;
    display: flex;
    align-items: center;
    background: #2e2c2c;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.login-modal__message.error {
    background: rgba(199, 18, 18, 0.15);
    border: 1px solid rgba(199, 18, 18, 0.5);
}
.login-modal__message p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: rgba(var(--cl-a), 1);
}
.login-modal__message.error p {
    color: #c71212;
}
.login-modal__message-close {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: inherit;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Banner / intro mətn — Login və Register üçün */
.login-modal__intro {
    margin: 0 0 20px 0;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(var(--cl-b), 0.8);
    font-family: var(--font-family);
    background: rgba(var(--cl-c), 0.08);
    border-left: 3px solid rgba(var(--cl-c), 0.6);
    border-radius: 0 8px 8px 0;
    box-sizing: border-box;
}

.login-modal .main-form.pass {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    gap: 16px;
    max-width: 100%;
}

.login-modal .main-form__label {
    display: flex;
    flex-direction: column;
    position: relative;
    max-width: 100%;
}

.login-modal .main-form__input {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.login-modal .main-form__label:has(.main-form__icon) .main-form__input {
    padding-right: 44px;
}

.login-modal .main-form__icon {
    position: absolute;
    right: 12px;
    top: 11px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.login-modal .main-form .main-btn {
    max-width: 100%;
    width: 100%;
    margin-top: 4px;
}

.login-modal .main-form__link {
    margin-top: 4px;
}

/* Alt sətir: "Artıq hesabınız var? Daxil ol" */
.login-modal__footer {
    margin: 16px 0 0 0;
    font-size: 14px;
    font-weight: 400;
    color: rgba(var(--cl-b), 0.75);
    font-family: var(--font-family);
}

.login-modal__footer .login-modal__link {
    background: none;
    border: none;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    color: rgba(var(--cl-c), 1);
    cursor: pointer;
    font-family: var(--font-family);
    text-decoration: underline;
}

.login-modal__footer .login-modal__link:hover {
    opacity: 0.9;
}

.login-modal .valid-tip {
    font-size: 12px;
    color: #c71212;
    margin-top: 4px;
}

@media (max-width: 940px) {
    .overlay .login-modal {
        width: calc(100% - 32px);
        max-width: 900px;
        height: auto;
        max-height: 90vh;
    }
}

@media (max-width: 640px) {
    .overlay .login-modal {
        width: calc(100% - 24px);
        height: auto;
        max-height: 90vh;
    }

    .login-modal__inner {
        flex-direction: column;
        min-height: auto;
    }

    .login-modal__poster {
        width: 100%;
        min-height: 120px;
        border-right: none;
        border-bottom: 1px solid var(--br-b, rgba(255, 255, 255, 0.1));
    }

    .login-modal__form-side {
        width: 100%;
    }
}
