/* ===== Navbar ===== */

.navbar {
    background-color: var(--primary-color);
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    padding: 10px 20px;
    width: 100%;
    position: fixed;
    right: 0;
    z-index: 1500;
    box-sizing: border-box;
}

/* Sections */
.nav-left {
    justify-self: start;
    display: flex;
    align-items: center;
}

.nav-center {
    justify-self: center;
}

.nav-right {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Logo */
.logo img {
    height: 50px;
    width: auto;
}

/* Active farm (clickable text/button) */
.active-farm {
    background: transparent;
    border: none;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 6px;
    color: white;
    font-weight: 900;
    max-width: 220px;
}

.active-farm:hover {
    background-color: rgba(255, 255, 255, 0.12);
}

.active-farm__name {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    color: #ffffff;
    font-size: 1rem;
}

/* Vertical divider */
.nav-divider {
    width: 1px;
    height: 28px;
    background-color: rgba(255, 255, 255, 0.45);
}

/* User icon */
.user-logo {
    display: flex;
    align-items: center;
}

.user-logo img {
    height: 30px;
    width: auto;
}

/* Language selector */
.nav-language {
    display: flex;
    align-items: center;
}

.nav-language__select {
    background-color: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    border-radius: 6px;
    padding: 6px 10px;
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
}

.nav-language__select:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 2px;
}

.nav-language__select option {
    color: #000;
}

@media (max-width: 1100px) {
    .navbar {
        grid-template-columns: 1fr;
        gap: 10px;
        justify-items: center;
    }

    .nav-left, .nav-center, .nav-right {
        justify-self: center;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

.survey-logos {
    display: flex;
    margin-right: 30px;
}

.survey-logos img {
    width: 40px;
    height: 40px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 5px;
    background-color: var(--button-secondary-color);
    display: inline-block;
}

.nav-links a:hover {
    background-color: var(--button-secondary-color-hover);
}

.nav-links li.active a {
    background-color: var(--primary-color);
    color: white;
    border: 2px solid var(--button-secondary-color-hover);
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* Tutorials icon in navbar */
.tutorials-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #fff;
    color: #fff;
    text-decoration: none;
}

.tutorials-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
}


/* ===== Farm modal ===== */

.farm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    box-sizing: border-box;
}

.farm-modal-overlay[hidden] {
    display: none !important;
}

.farm-modal {
    width: min(900px, 95vw);
    max-height: 85vh;
    background: var(--background-color);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.farm-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: white;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.farm-modal__title {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
}

.farm-modal__close {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 6px 10px;
    border-radius: 8px;
}

.farm-modal__close:hover {
    background: rgba(0,0,0,0.06);
}

.farm-modal__body {
    padding: 24px;
    overflow: auto;
}

.farm-modal__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

@media (max-width: 700px) {
    .farm-modal__grid {
        grid-template-columns: 1fr;
    }
}

.farm-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border-radius: 14px;
    cursor: pointer;
    border: 2px solid rgba(0,0,0,0.06);
    background: white;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.farm-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    border-color: rgba(0,0,0,0.12);
}

.farm-card--accent {
    background: rgba(83, 129, 54, 0.10);
    border-color: rgba(83, 129, 54, 0.25);
}

.farm-card__name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-color);
}

.farm-card__meta {
    font-size: 0.9rem;
    opacity: 0.8;
}

.farm-card.is-selected {
    border-color: var(--primary-color);
    box-shadow: 0 10px 25px rgba(83, 129, 54, 0.18);
}


/* ===== Footer ===== */

footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    margin: 0;
    left: 0;
    padding: 10px 0;
    position: fixed;
    width: 100%;
    bottom: 0;
    z-index: 1000;
}

.login-footer {
    background-color: var(--background-color);
    color: var(--primary-color);
    text-align: center;
    margin: 0;
    left: 0;
    padding: 10px 0;
    position: fixed;
    width: 100%;
    bottom: 0;
    z-index: 1000;
}


/* ===== Main layout ===== */

main {
    padding-top: 60px;
    padding-bottom: 60px;
    min-height: calc(100vh - 120px);
}

/* ===== Global input focus ===== */

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(83, 129, 54, 0.15);
}