/**
 * GVJ Master Sidebar — front-end styles.
 *
 * The sidebar reuses the theme's own widget classes (jc-widget,
 * jc-widget__title, jc-link-list). This file only covers what the
 * theme does not: the login form, the count badge, tool icons and
 * the ad slots. Green matches the site's accent (#15803d).
 */

.gvj-ms-sidebar {
    box-sizing: border-box;
}

.gvj-ms-sidebar * {
    box-sizing: border-box;
}

/* Login form ------------------------------------------------------- */

.gvj-ms-field-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px;
}

.gvj-ms-mobile-row {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.gvj-ms-dial {
    flex: 0 0 86px;
    max-width: 86px;
    padding: 8px 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
}

.gvj-ms-mobile {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.gvj-ms-password {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 12px;
}

.gvj-ms-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 14px;
    margin-bottom: 8px;
    border: 1px solid #15803d;
    border-radius: 4px;
    background: #15803d;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    text-decoration: none;
}

.gvj-ms-btn:hover,
.gvj-ms-btn:focus {
    background: #166534;
    border-color: #166534;
    color: #fff;
    text-decoration: none;
}

.gvj-ms-btn-secondary {
    background: #fff;
    color: #15803d;
}

.gvj-ms-btn-secondary:hover,
.gvj-ms-btn-secondary:focus {
    background: #f0fdf4;
    color: #166534;
}

.gvj-ms-errors {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 12px;
}

.gvj-ms-errors p {
    margin: 0;
    color: #991b1b;
    font-size: 14px;
}

.gvj-ms-welcome {
    font-weight: 600;
    margin: 0 0 10px;
}

/* Count badge ------------------------------------------------------ */

.gvj-ms-sidebar .jc-link-list a {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gvj-ms-count {
    margin-left: auto;
    flex: 0 0 auto;
    background: #dcfce7;
    color: #15803d;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.gvj-ms-sidebar .jc-link-list a .jc-link-arrow {
    flex: 0 0 auto;
}

.gvj-ms-plain {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
}

/* Tools ------------------------------------------------------------ */

.gvj-ms-tool-icon {
    color: #15803d;
    font-size: 18px;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.gvj-ms-tool-list a .gvj-ms-tool-icon {
    margin-right: 2px;
}

/* Ads -------------------------------------------------------------- */

.gvj-ms-ad {
    margin-bottom: 20px;
    text-align: center;
    overflow: hidden;
}

.gvj-ms-ad:last-child {
    margin-bottom: 0;
}

/* Small screens ---------------------------------------------------- */

@media (max-width: 480px) {
    .gvj-ms-dial {
        flex-basis: 78px;
        max-width: 78px;
    }

    .gvj-ms-btn {
        font-size: 15px;
    }
}

/* Country-code dropdown with real flag images (sidebar login).
 * The native <select> stays in the form (visually hidden) so the
 * value is still submitted; the front-end script builds this custom
 * dropdown from it. The button shows flag + code; the list shows
 * flag + code + country name. */
/* The !important flags beat the theme's `select { width: 100% }`
 * rule, which would otherwise stretch this 1px element to full
 * width and cause horizontal overflow on mobile. */
.gvj-ms-dial.gvj-ms-dial-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap;
    border: 0 !important;
}

.gvj-ms-dial-dropdown {
    position: relative;
    flex: 0 0 auto;
    min-width: 0;
}

.gvj-ms-dial-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    padding: 8px 6px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.2;
    color: #222;
    cursor: pointer;
    white-space: nowrap;
}

.gvj-ms-dial-btn:focus {
    outline: 2px solid #15803d;
    outline-offset: 0;
    border-color: #15803d;
}

.gvj-ms-dial-btn img {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
    flex: 0 0 auto;
}

.gvj-ms-dial-btn .gvj-ms-dial-caret {
    color: #666;
    font-size: 11px;
    margin-left: 1px;
}

.gvj-ms-dial-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 60;
    min-width: 230px;
    max-width: 78vw;
    max-height: 240px;
    overflow-y: auto;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.gvj-ms-dial-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.3;
    color: #222;
    cursor: pointer;
}

.gvj-ms-dial-item:hover,
.gvj-ms-dial-item:focus {
    background: #f0fdf4;
}

.gvj-ms-dial-item[aria-selected="true"] {
    background: #dcfce7;
    font-weight: 600;
}

.gvj-ms-dial-item img {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
    flex: 0 0 auto;
}

/* Server-side flag picture next to the country-code select.
 * Rendered by PHP so a real flag shows even when the custom
 * dropdown script never runs; the script hides it when the
 * dropdown builds. */
.gvj-ms-dial-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
    min-width: 0;
}

.gvj-ms-dial-flag {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
    flex: 0 0 auto;
}
