/* ========================================
   ZŠ JUNGMANNOVY SADY - UNIQUE DESIGN
   Different from Kasparek: solid colors, two-row header, split hero
   
   Color Palette:
   - Primary: #c41e24 (red - toned down)
   - Secondary: #271e61 (dark blue)
   - Accent: #3B5998 (lighter blue for links)
   - Background: #ffffff, #f8f9fa
   - Text: #1a1a1a, #666
   ======================================== */

/* ========================================
   BASE
   ======================================== */

html {
    scroll-behavior: smooth;
}

body:not(.admin-layout) {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1a1a1a;
}

body:not(.admin-layout) .content1 {
    flex: 1 0 auto;
}

/* ========================================
   UTILITY BAR (top row - white/light)
   Front-end only
   ======================================== */

body:not(.admin-layout) .utility-bar {
    background-color: #f8f9fa;
    padding: 1rem 0;
}

body:not(.admin-layout) .utility-link {
    display: inline-block;
    padding: 0.25rem 1rem;
    color: #271e61;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
}

body:not(.admin-layout) .utility-link:hover {
    color: #c41e24;
    text-decoration: none;
}

/* ========================================
   MAIN NAVIGATION (second row - solid red)
   Front-end only
   ======================================== */

body:not(.admin-layout) .main-nav {
    background-color: #f8f9fa;
    padding: 0;
}

body:not(.admin-layout) .main-nav .navbar-toggler {
    border-color: #271e61;
    padding: 0.5rem 0.75rem;
    margin: 0.5rem;
}

body:not(.admin-layout) .main-nav .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23271e61' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

body:not(.admin-layout) .main-nav .nav-item {
    position: relative;
    flex-grow: 1;
    text-align: center;
}

body:not(.admin-layout) .main-nav .nav-link {
    color: white !important;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    padding: 1rem 1.5rem;
    transition: background-color 0.2s ease;
    text-transform: uppercase;
    background-color: #c41e24;
}

body:not(.admin-layout) .main-nav .nav-link:hover,
body:not(.admin-layout) .main-nav .nav-link:focus {
    background-color: #271e61;
}

body:not(.admin-layout) .main-nav .nav-link.active {
    background-color: #271e61;
}

body:not(.admin-layout) .main-nav .nav-link i {
    font-size: 1.1rem;
}

body:not(.admin-layout) .main-nav .dropdown-toggle::after {
    margin-left: 0.5rem;
}

body:not(.admin-layout) .main-nav .dropdown-menu {
    background-color: #271e61;
    border: none;
    border-radius: 0;
    margin-top: 0;
    padding: 0;
    min-width: 300px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

body:not(.admin-layout) .main-nav .dropdown-item {
    color: rgba(255, 255, 255, 0.9);
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body:not(.admin-layout) .main-nav .dropdown-item:last-child {
    border-bottom: none;
}

body:not(.admin-layout) .main-nav .dropdown-item:hover,
body:not(.admin-layout) .main-nav .dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.12);
    color: white;
}

body:not(.admin-layout) .main-nav .dropdown-item.active {
    background-color: #c41e24;
    color: white;
}

@media (hover: hover) {
    body:not(.admin-layout) .main-nav .dropdown:hover .dropdown-menu {
        display: block;
    }

    body:not(.admin-layout) .main-nav .dropdown:hover > .nav-link {
        background-color: #271e61;
    }
}

body:not(.admin-layout) .main-nav .dropdown.show > .nav-link {
    background-color: #271e61;
}

body:not(.admin-layout) .main-nav .navbar-collapse {
    background-color: #f8f9fa;
}

/* Mobile navigation */
@media (max-width: 991px) {
    body:not(.admin-layout) .main-nav {
        background-color: transparent;
    }

    body:not(.admin-layout) .main-nav .navbar-collapse {
        background-color: #c41e24;
        padding: 0;
    }

    body:not(.admin-layout) .main-nav .nav-link {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    body:not(.admin-layout) .main-nav .dropdown-menu {
        position: static;
        background-color: rgba(0, 0, 0, 0.1);
        box-shadow: none;
        padding-left: 1rem;
    }

    body:not(.admin-layout) .main-nav .mobile-external-links {
        background-color: white;
        text-align: center;
        padding: 0.5rem 0;
    }

    body:not(.admin-layout) .main-nav .mobile-external-links .nav-link {
        color: #271e61 !important;
        background-color: white;
        border-bottom: none;
    }
}

/* ========================================
   SPLIT HERO (text left, photo right - 50/50)
   Front-end only
   ======================================== */

body:not(.admin-layout) .hero-split {
    display: flex;
    flex-wrap: wrap;
    min-height: 500px;
    background-color: white;
}

@media (min-width: 992px) {
    body:not(.admin-layout) .hero-split {
        padding-right: 1.5rem;
    }
}

body:not(.admin-layout) .hero-text {
    background-color: white;
    color: #1a1a1a;
    padding: 3rem 2rem 3rem 5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

body:not(.admin-layout) .hero-title {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

body:not(.admin-layout) .hero-subtitle {
    font-size: 1rem;
    color: #666;
    font-weight: 300;
    margin-bottom: 0;
}

body:not(.admin-layout) .hero-image {
    background-size: cover;
    background-position: center;
    min-height: 500px;
    background-color: white;
}

@media (max-width: 991px) {
    body:not(.admin-layout) .hero-split {
        min-height: auto;
        padding: 0.5rem;
    }

    body:not(.admin-layout) .hero-text {
        padding: 2rem 1.5rem;
        text-align: center;
    }

    body:not(.admin-layout) .hero-title {
        font-size: 1.75rem;
    }

    body:not(.admin-layout) .hero-image {
        min-height: 250px;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }
}

/* ========================================
   SECTION TITLES
   ======================================== */

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background-color: #c41e24;
    margin: 0.75rem auto 0;
}

/* ========================================
   NEWS ITEMS (different from Kasparek)
   Border-left accent, clean lines, stronger shadows
   ======================================== */

.news-item {
    background: white;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid transparent;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.25s ease;
    position: relative;
}

.news-item:hover {
    border-left-color: #c41e24;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: translateX(4px);
}

.news-item__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.news-item__title a {
    color: inherit;
    text-decoration: none;
}

.news-item__title a:hover {
    color: #c41e24;
}

.news-item__text {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.news-item__date {
    font-size: 0.85rem;
    color: #999;
    text-align: right;
}

/* Legacy support - news-container with stronger shadows */
.news-container {
    background: white;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid transparent;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.25s ease;
    position: relative;
    border-radius: 0;
}

.news-container:hover {
    border-left-color: #c41e24;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: translateX(4px);
}

.news-container a {
    text-decoration: none;
    color: #1a1a1a;
}

.news-container:hover a {
    color: #c41e24;
    text-decoration: underline;
}

/* ========================================
   CALENDAR / PROGRAM (unique circular badges)
   Toned down red, less prominent
   ======================================== */

.program-container {
    background-color: #c41e24;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(196, 30, 36, 0.25);
    transition: transform 0.2s ease;
}

.program-container:hover {
    transform: scale(1.05);
}

.p-day {
    font-size: 1.4rem;
    line-height: 1.2;
}

.p-month {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.p-year {
    font-size: 0.55rem;
    opacity: 0.8;
}

/* ========================================
   BUTTONS
   ======================================== */

body:not(.admin-layout) .btn-primary {
    background-color: #271e61;
    border-color: #271e61;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

body:not(.admin-layout) .btn-primary:hover {
    background-color: #1a1548;
    border-color: #1a1548;
    transform: translateY(-1px);
}

.btn-red {
    background-color: #c41e24;
    border-color: #c41e24;
    color: white;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-red:hover {
    background-color: #a5191e;
    border-color: #a5191e;
    color: white;
}

.btn-green {
    background-color: #1e8c4e;
    border-color: #1e8c4e;
    color: white;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-green:hover {
    background-color: #186e3e;
    border-color: #186e3e;
    color: white;
    transform: translateY(-1px);
}

.btn-green:active,
.btn-green:active:hover {
    background-color: #145c34 !important;
    border-color: #145c34 !important;
    color: white !important;
    transform: none;
}

.btn-green:disabled,
.btn-green.disabled {
    background-color: #1e8c4e;
    border-color: #1e8c4e;
    opacity: 0.55;
    transform: none;
    cursor: not-allowed;
    color: white;
    pointer-events: auto;
}

.btn-green:disabled:hover,
.btn-green.disabled:hover {
    background-color: #1e8c4e;
    border-color: #1e8c4e;
    transform: none;
    color: white;
}

/* ========================================
   FOOTER (two blocks, toned down red)
   Front-end only
   ======================================== */

body:not(.admin-layout) footer {
    flex-shrink: 0;
}

body:not(.admin-layout) .footer-main {
    background-color: #c41e24;
    color: white;
    padding: 2.5rem 0;
}

body:not(.admin-layout) .footer-main a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.2s;
}

body:not(.admin-layout) .footer-main a:hover {
    color: white;
    text-decoration: underline;
}

body:not(.admin-layout) .footer-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body:not(.admin-layout) .footer-main ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

body:not(.admin-layout) .footer-main ul li {
    padding: 0.25rem 0;
}

body:not(.admin-layout) .footer-main hr {
    border-color: rgba(255, 255, 255, 0.2);
    margin: 1rem 0;
}

body:not(.admin-layout) .footer-logo {
    background-color: white;
    border-radius: 50%;
    padding: 10px;
    display: inline-block;
}

body:not(.admin-layout) .footer-logo img {
    height: 80px;
    width: 80px;
}

body:not(.admin-layout) .footer-copyright {
    background-color: #333;
    color: rgba(255, 255, 255, 0.8);
    padding: 1rem 0;
    font-size: 0.9rem;
}

body:not(.admin-layout) .footer-copyright a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

body:not(.admin-layout) .footer-copyright a:hover {
    text-decoration: underline;
}

/* ========================================
   CONTENT PAGES
   ======================================== */

.page-header {
    background-color: #271e61;
    color: white;
    padding: 2rem 1rem;
    text-align: center;
}

.page-header__title {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
}

.content-section {
    background-color: #f8f9fa;
    padding: 2.5rem 0;
    flex: 1;
}

.content-card {
    background: white;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}

.content-card__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #271e61;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f0f0f0;
}

/* ========================================
   CONTACT PAGE
   ======================================== */

.contact-a {
    display: block;
    padding: 12px 20px;
    background-color: #271e61;
    color: white;
    text-decoration: none;
    transition: all 0.2s;
}

.contact-a:hover {
    background-color: #1a1548;
    color: white;
}

.contact-mr {
    position: absolute;
    right: 25px;
    font-size: 20px;
}

.contact-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: #1a1a1a;
}

.contact-function {
    color: #666;
    font-size: 0.9rem;
}

.contact-email,
.contact-tel {
    color: #666;
    font-size: 0.9rem;
}

.contact-email a {
    color: #3B5998;
    text-decoration: none;
}

.contact-email a:hover {
    text-decoration: underline;
}

.contact-image {
    width: 70px;
    border-radius: 50%;
}

/* ========================================
   PAGINATION
   ======================================== */

.news-all-paginator .page-link {
    color: #271e61;
    border: 1px solid #dee2e6;
    margin: 0 2px;
    border-radius: 4px;
    padding: 0.5rem 0.85rem;
}

.news-all-paginator .page-link:hover {
    background-color: #271e61;
    border-color: #271e61;
    color: white;
}

.news-all-paginator .page-item.active .page-link {
    background-color: #c41e24;
    border-color: #c41e24;
    color: white;
}

.news-all-paginator .page-item.disabled .page-link {
    color: #999;
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

/* ========================================
   FORMS
   ======================================== */

.login-box {
    max-width: 400px;
}

.login-logo {
    height: 60px;
}

.input-group {
    flex-wrap: wrap;
}

.input-group .form-control {
    order: 1;
}

.input-group .input-group-text {
    order: 2;
}

.input-group .help-block {
    order: 3;
    flex: 0 0 100%;
}

.form-control:focus {
    border-color: #c41e24;
    box-shadow: 0 0 0 3px rgba(196, 30, 36, 0.15);
}

/* ========================================
   ALERTS
   ======================================== */

.alert {
    border-radius: 0;
    border: none;
}

.alert-success {
    background-color: #28a745;
    color: white;
}

.alert-danger {
    background-color: #c41e24;
    color: white;
}

.alert-warning {
    background-color: #ffc107;
    color: #1a1a1a;
}

.alert-info {
    background-color: #271e61;
    color: white;
}

/* Toast notifikace (flash messages) */
.toast {
    min-width: 300px;
    border-radius: 8px;
}

.toast.alert-success {
    background-color: #28a745;
    color: white;
}

.toast.alert-danger {
    background-color: #c41e24;
    color: white;
}

.toast.alert-warning {
    background-color: #ffc107;
    color: #1a1a1a;
}

.toast.alert-warning .btn-close {
    filter: none;
}

.toast.alert-info {
    background-color: #271e61;
    color: white;
}

/* ========================================
   EDITOR CONTENT
   ======================================== */

.editor-image img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   ADMIN
   ======================================== */

.admins .dropdown-menu {
    background-color: #666 !important;
}

.btn:disabled,
.btn.disabled {
    cursor: not-allowed;
    pointer-events: auto;
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

@media only screen and (max-width: 576px) {
    .g-recaptcha {
        transform: scale(0.85);
        transform-origin: 0 0;
    }

    /* Fix mobile content width - vice padding */
    body:not(.admin-layout) .col-12.px-4 {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }

    body:not(.admin-layout) #aktuality {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    body:not(.admin-layout) .news-item {
        padding: 1rem 1rem;
    }

    body:not(.admin-layout) .section-title {
        font-size: 1.25rem;
    }

    body:not(.admin-layout) .program-container {
        width: 55px;
        height: 55px;
    }

    body:not(.admin-layout) .p-day {
        font-size: 1.2rem;
    }
}

@media only screen and (max-width: 768px) {
    /* Constrain content sections on tablets */
    body:not(.admin-layout) .col-12.col-lg-6.px-4 {
        max-width: 100%;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* ========================================
   TRUST FORM (Schránka důvěry)
   ======================================== */

.trust-form {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.trust-form-header {
    background-color: #271e61;
    padding: 1.75rem 2rem;
    text-align: center;
}

.trust-form-header::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: #c41e24;
    margin: 0.75rem auto 0;
}

.trust-form-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.02em;
}

.trust-form-body {
    padding: 2rem;
}

.trust-form-field {
    margin-bottom: 1.25rem;
}

.trust-form-label {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    color: #1a1a1a;
    margin-bottom: 0.4rem;
}

.trust-form-input {
    border-radius: 6px;
    border-color: #dee2e6;
    padding: 0.6rem 0.85rem;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}


.trust-form-captcha {
    margin-bottom: 1.5rem;
}

.trust-form-submit {
    text-align: center;
}

.trust-form-btn {
    padding: 0.65rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

@media (max-width: 576px) {
    .trust-form-body {
        padding: 1.25rem;
    }

    .trust-form-header {
        padding: 1.25rem 1rem;
    }
}

/* ========================================
   REGISTRATION FORM (Přihlašování na projekty)
   ======================================== */

.reg-form {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-width: 780px;
    margin: 0 auto;
}

.reg-form-header {
    background-color: #271e61;
    padding: 1.75rem 2rem;
    text-align: center;
}

.reg-form-header::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: #c41e24;
    margin: 0.75rem auto 0;
}

.reg-form-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.02em;
}

.reg-form-info {
    background-color: #f8f9fa;
    border-left: 4px solid #271e61;
    border-radius: 0 6px 6px 0;
    padding: 1rem 1.25rem;
    margin-bottom: 1.75rem;
    font-size: 0.925rem;
    line-height: 1.7;
}

.reg-form-body {
    padding: 2rem;
}

.reg-form-field {
    margin-bottom: 1.5rem;
}

.reg-form-label {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.reg-form-input {
    border-radius: 6px;
    border-color: #dee2e6;
    padding: 0.6rem 0.85rem;
    font-size: 0.95rem;
    max-width: 380px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.reg-form-input:disabled,
.form-control:disabled {
    cursor: not-allowed;
}

.reg-projects-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.reg-project-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    user-select: none;
}

.reg-project-item:hover:not(.is-full) {
    border-color: #1e8c4e;
    background-color: rgba(30, 140, 78, 0.04);
}

.reg-project-item:has(input:checked) {
    border-color: #1e8c4e;
    background-color: rgba(30, 140, 78, 0.06);
}

.reg-project-item.is-full,
.reg-project-item:has(input:disabled) {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f8f9fa;
}

.reg-project-radio {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    accent-color: #1e8c4e;
    cursor: pointer;
}

.reg-project-name {
    flex: 1;
    font-size: 0.925rem;
    color: #1a1a1a;
}

.reg-capacity-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: #c41e24;
    background-color: rgba(196, 30, 36, 0.08);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.reg-form-submit {
    text-align: center;
    padding-top: 0.5rem;
}

.reg-form-btn {
    padding: 0.65rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

@media (max-width: 576px) {
    .reg-form-body {
        padding: 1.25rem;
    }

    .reg-form-header {
        padding: 1.25rem 1rem;
    }

    .reg-form-input {
        max-width: 100%;
    }
}

/* Homepage specific */
.hp-h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    margin-bottom: 1.5rem;
}
