body {
    font-family: Arial, sans-serif;
    background: #f9f9f9;
    color: #333;
    margin: 0;
    padding: 5px;
    display: flex;
	flex-direction: column;
    justify-content: center;   /* центрира хоризонтално */
}

.container {
    text-align: center;
    width: 100%;
}

h2 {
    color: #003366;
    margin-bottom: 10px;
    font-size: 22px;
}
h3 {
    color: #8b1010;
    margin-bottom: 5px;
    font-size: 14px;
}
.groups-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;   /* центрира кутийките */
}

.group-box {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 15px;
    width: 100%;
    max-width: 320px;          /* максимум 300px */
    box-sizing: border-box;
    text-align: center;

    display: flex;             /* flex контейнер */
    flex-direction: column;    /* вертикално подреждане */
    justify-content: space-between; /* съдържание + чекбокс най-долу */
}

.group-content {
    flex-grow: 1;              /* съдържанието заема наличното място */
}

.group-box img {
    max-width: 100%;
    height: auto;
    max-height: 100px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin: 5px 0;
}

.subject {
    font-size: 13px;
    margin-bottom: 8px;
}

.vote-section {
    margin-top: auto;          /* избутва чекбокса най-долу */
    font-size: 14px;
    padding: 10px;
    color: #fff;               /* бял текст */
    background: #172e55;       /* бордо фон */
    border-radius: 6px;        /* заоблени ъгли */
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.vote-section:hover {
    background: #1660db;       /* по‑светъл бордо при hover */
    transform: scale(1.05);    /* леко уголемяване */
}

.vote-section input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);     /* по‑голям чекбокс */
    vertical-align: middle;
}


.vote-btn {
    background: #003366;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
}

.vote-btn:hover {
    background: #990000;
}

a {
    color: #003366;
    text-decoration: none;
    font-weight: bold;
}

a:hover {
    color: #990000;
}

.error {
    color: #990000;
    font-size: 18px;
    margin-bottom: 15px;
}
/* Лайтбокс стилове */
.lightbox {
    display: none;              /* скрито по подразбиране */
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border: 4px solid #fff;
    border-radius: 8px;
}

.lightbox:target {
    display: flex;              /* показва при активиране */
}
.group-box .subject {
    font-size: 14px;
    margin-bottom: 10px;
    color: #003366;
}

.group-box p {
    margin: 5px 0;
    font-size: 14px;
}
.progress-bar {
    width: 100%;
    background: #eee;
    border-radius: 6px;
    overflow: hidden;
    height: 18px;
    margin: 8px 0;
    border: 1px solid #ccc;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #003366, #990000);
    transition: width 0.5s ease;
}

nav.menu {
    width: 70%;
    margin: 1px auto;
    display: flex;
    background-color: #f9f9f9;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #6c8da0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    font-size: 14px;
}

nav.menu a {
  flex: 1;
  display: flex;                    /* ← Това е ключът за центриране */
  justify-content: center;         /* Хоризонтално центриране */
  align-items: center;             /* Вертикално центриране */
  text-align: center;
  padding: 5px 3px 5px 3px;
  color: #2a4d7f;
  text-decoration: none;
  border-right: 1px solid #6c8da0;
  transition: background-color 0.3s ease;
  font-size: 14px;

  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); /* ← усилена сянка */
}

nav.menu a:last-child {
  border-right: none;
}

nav.menu a:hover {
  background-color: #4db748;
}
.site-header {
	display: block;
    align-items: center;
    justify-content: left;
    gap: 20px;
    padding: 1px;
}

/* Основно правило за мобилни устройства */
@media (max-width: 768px) {
body { font-family: Arial, sans-serif; background: #f9f9f9; color: #333; margin: 0; padding: 5px; display: block; /* изключва flex на мобилно */ /* махни flex */ }

    .site-header {
        display: flex;
        flex-direction: column;   /* лого и заглавие едно под друго */
        align-items: center;
        text-align: center;
    }

    .site-header img.logo {
        max-width: 150px;         /* по-малко лого */
        height: auto;
        margin-bottom: 10px;
    }

    .site-header h1 {
        font-size: 18px;
    }

    nav.menu {
        flex-direction: column;   /* линковете един под друг */
        width: 100%;
        margin: 10px 0;
        font-size: 16px;
    }

    nav.menu a {
        display: block;
        padding: 10px;
        border-bottom: 1px solid #ccc;
    }

    nav.menu a:last-child {
        border-bottom: none;
    }

    .groups-grid {
        flex-direction: column;   /* кутийките една под друга */
        align-items: center;
    }

    .group-box {
        max-width: 95%;           /* почти цялата ширина на екрана */
    }

    .group-box img {
        max-height: 150px;        /* малко по-големи снимки на мобилно */
    }

    h2 {
        font-size: 18px;
    }

    h3 {
        font-size: 12px;
    }

    .vote-section {
        font-size: 13px;
        padding: 8px;
    }

    .vote-btn {
        width: 100%;              /* бутонът заема цялата ширина */
        font-size: 18px;
        padding: 12px;
    }
}

/* Допълнителна оптимизация за много малки екрани (телефони под 480px) */
@media (max-width: 480px) {
    .site-header h1 {
        font-size: 16px;
    }

    nav.menu {
        font-size: 14px;
    }

    .group-box img {
        max-height: 120px;
    }
}

/* Хамбургер бутон */
.hamburger {
    display: none;              /* скрито по подразбиране */
    font-size: 26px;
    background: none;
    border: none;
    cursor: pointer;
    color: #003366;
}

/* Показва се само на мобилна версия */
@media (max-width: 768px) {
    .hamburger {
        display: block;
        position: absolute;
        right: 15px;
        top: 15px;
    }

    nav.menu {
        display: none;          /* скрито меню по подразбиране */
        flex-direction: column;
        width: 100%;
        margin-top: 10px;
    }

    nav.menu.show {
        display: flex;          /* показва менюто при клик */
    }
}
