:root {
    --primary-color: #0b56a9;
    --secondary-color: #5c90f0;
    --background-color: #ffffff;
    --text-color: #1D1E20;
    --border-color: #599ee8;
}

body {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background-color: var(--background-color);
    color: var(--text-color);
    overflow-x: hidden;
}

/* Prevent layout shift when modal opens */
body.modal-open {
    padding-right: 0 !important;
}

html {
    scrollbar-gutter: stable;
    max-width: 100vw;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* Target specific elements that might cause horizontal overflow */
main, .container-fluid, .logo-banner {
    max-width: 100%;
}

.appointments-full-width {
    overflow: visible;
}

a {
    text-decoration: none;
    color: var(--text-color);
    outline: none;
}

header {
    min-height: 108px;
    padding: 1.5rem 0 1rem 0;
    border-bottom: 10px solid var(--border-color);
}

header .logo {
    float: left;
}

.navbar a {
    color: var(--text-color);
    padding: 0 0.6rem;
    font-size: 1.2rem;
    transition: 0.30s;
}

.navbar a:hover {
    color: var(--secondary-color);
}

header .contact-info {
    border-top: 1px solid grey;
    padding-top: 0.75rem;
    margin-top: 0.25rem
}

/* Contact info styling - leveraging Bootstrap for responsiveness */
header .contact-info {
    border-top: 1px solid grey;
    padding-top: 0.75rem;
    margin-top: 0.25rem;
}

/* Contact item spacing */
.contact-item {
    padding: 0.25rem 0;
}

.footer-background {
    background-color: #6e85a6;
}

.footer-container {
    padding: 50px 12px;
    color: #FFFFFF;
    line-height: 1.8;
    font-size: 14px;
}

.footer-header {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
}

.footer-container a {
    color: #FFFFFF;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: 0.30s;
}

.footer-container a:hover {
    border-bottom: 1px solid #FFFFFF;
}

.footer-menu li {
    list-style: url("../assets/gui/ul_white.png");
}

/* Main Page */ 
main {
    background-image: url("../assets/gui/background_hearts.png");
    background-size: 100vw auto;
    background-repeat: repeat-y;
    background-position: center top;
}

/* Banner */
.banner-full-width {
    background-color: rbba(256, 256, 256, 0.4);
}

.banner-full-width h2 {
    text-align: center;
    padding: 1rem 0;
    margin: 0;
}


.logo-banner {
    width: 100%;
    max-width: 100%;
    display: block;
    position: relative;
    /* Move the logo up by 20% of the logo-banner's height */
    margin-bottom: calc(-0.25 * var(--logo-banner-height, 0px));
    margin-top: calc(-0.2 * var(--logo-banner-height, 0px));
}

/* Quick Links */
.quicklinks-full-width {
    background-color: rgba(214, 223, 234, 0.4);
    padding: 3rem 0;
}

.banner-nav-item {
    background-color: #FFF;
    box-shadow: 0 0 10px 2px rgb(0 0 0 / .5);
    border: 2px solid #7c7d7d;
    margin: 0;
    padding-left: 0.3rem;
    padding-right: 0.3rem;
    padding-top: 0.5rem;
    padding-bottom: 0;
}

.banner-nav-item-title {
    font-size: 2.5rem;
    text-align: center;
    padding: 1rem;
    width: 100%;
    margin-top: -2rem;
}

@media screen and (max-width: 992px) {
    .banner-nav-item-title {
        padding-top: 2rem;
        font-size: 1.5rem;
    }
}

@media screen and (max-width: 576px) {
    .quicklinks-full-width {
        display: none;
    }
}

/* Appointments */
.appointments-full-width {
    background-color: rgba(239, 243, 247, 0.4);
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 0.5rem 0 3rem 0;
    max-width: none !important;
}

.appointments-header {
    padding: 1rem 1rem 1.5rem 1rem;
    text-align: center;
    color: var(--primary-color);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.02em;
}

/* Doctor Card */
.doctor-card {
    background-color: #FFF;
    margin: 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 10px 2px rgb(0 0 0 / .5);
}

.doctor-card-photo img {
    width: 100%;
    object-fit: cover;
}

.doctor-card-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.doctor-card-name-info {
    height: 5rem;
}

.doctor-card-title {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.2rem;
}

.doctor-card-name {
    margin-top: 0;
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

.doctor-card-location {
    border-top: 1px solid #CCC;
    border-bottom: 1px solid #CCC;
    padding: 0.3rem 0;
}

/* Doctor Card Schedule Styling */
.doctor-card-schedule {
    margin-top: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.schedule-header, .unavailable-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.schedule-header h4, .unavailable-header h4 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
    flex: 1;
}

/* Schedule Toggle Button (Mobile Only) */
.schedule-toggle-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.1rem;
    padding: 0.25rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.schedule-toggle-btn:hover {
    color: var(--secondary-color);
}

.schedule-toggle-btn.expanded {
    transform: rotate(180deg);
}

.schedule-icon, .unavailable-icon {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.unavailable-icon {
    color: #856404;
}

/* Schedule Grid */
.schedule-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: max-height 0.3s ease;
    overflow: hidden;
}

/* Mobile Schedule Collapse Behavior */
@media (max-width: 767.98px) {
    .schedule-grid:not(.expanded) {
        max-height: 80px; /* Approximate height for one schedule item */
    }
    
    .schedule-grid:not(.expanded) .schedule-item:not(.current-day) {
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        padding-bottom: 0;
        padding-top: 0;
        transform: translateY(-0.5rem);
    }
    
    .schedule-grid.expanded {
        max-height: 1000px;
    }
    
    .schedule-grid.expanded .schedule-item {
        max-height: 100px;
        display: flex !important;
        opacity: 1;
        transform: translateY(0);
    }
}

.schedule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.schedule-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Current Day Highlighting */
.schedule-item.current-day {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 3px 6px rgba(11, 86, 169, 0.2);
}

.schedule-item.current-day .schedule-day {
    color: var(--primary-color);
    font-weight: 700;
}

.schedule-item.current-day .schedule-time {
    background-color: var(--primary-color);
    color: white;
}

.schedule-day {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.schedule-day-short {
    display: none;
}

@media (min-width: 1200px) and (max-width: 1400px) {
    .schedule-day-full {
        display: none;
    }

    .schedule-day-short {
        display: inline;
    }
}

.schedule-time {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.9rem;
    background-color: rgba(11, 86, 169, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Unavailable Notice */
.doctor-unavailable-notice {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

.unavailable-message {
    margin-top: 0.5rem;
}

.unavailable-message p {
    margin: 0;
    color: #856404;
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Info Cards */
.info-full-width {
    background-color: rgba(214, 223, 234, 0.4);
}

.info-card {
    background-color: #FFF;
    box-shadow: 0 0 10px 2px rgb(0 0 0 / .5);
    margin: 2rem;
    padding: 1rem;
}

.info-card h2 {
    text-transform: uppercase;
    text-align: center;
    border-bottom: 1px solid #CCC;
}

.photo-carousel {
    margin-top: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.photo-carousel .carousel-item img {
    height: 260px;
    object-fit: cover;
}

.photo-carousel .carousel-caption {
    background-color: rgb(0 0 0 / .5);
    border-radius: 0.25rem;
}

.about-us-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto;
    border-radius: 0.5rem;
}


/* News page styles */
.news-container {
    padding: 2rem 0;
}

.news-item {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid #CCC;
    border-radius: 8px;
    background-color: var(--background-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.news-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.news-header {
    margin-bottom: 1rem;
}

.news-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.news-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
}

.news-date,
.news-author {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.news-content {
    line-height: 1.6;
}

.news-content img {
    max-width: 100%;
    max-height: 320px;
    height: auto;
    display: block;
    margin: 1rem 0;
    border-radius: 0.5rem;
    cursor: zoom-in;
    transition: max-height 300ms ease-in-out;
}

.news-content img.is-enlarged {
    width: 100%;
    max-height: calc(100vh - 12rem);
    object-fit: contain;
    object-position: left center;
    cursor: zoom-out;
}

.news-content img:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .news-content img {
        transition: none;
    }
}

/* Services Section */
.services-full-width {
    background-color: rgba(248, 249, 250, 0.4);
}

.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    border-radius: 12px;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.service-card .card-body {
    padding: 2rem;
}

.service-icon {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.service-card .card-title {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    line-height: 1.3;
}

.service-card .card-text {
    font-size: 0.9rem;
    line-height: 1.4;
}

.news-content p {
    font-size: 1rem;
    margin-bottom: 0;
}

@media (max-width: 767.98px) {
    .latest-news .news-item > p {
        display: none;
    }
}

.news-attachments__title {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.news-attachments__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.news-attachments__link {
    align-items: center;
    color: var(--text-color);
    display: flex;
    gap: 0.5rem;
    padding: 0.4rem 0;
    text-decoration: none;
}

.news-attachments__link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.news-attachments__link span:first-of-type {
    flex: 1;
}

.pagination-nav {
    margin-top: 3rem;
}

.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-item {
    margin: 0 0.25rem;
}

.page-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--primary-color);
    text-decoration: none;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.page-link:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
    border-color: #dee2e6;
}

/* Downloads Page */
.downloads-tabs .nav-link {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    padding: 0.6rem 1.2rem;
}

.downloads-tabs .nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Declaration Cards */
.declaration-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.declaration-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.declaration-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.declaration-card--doctor .declaration-icon {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.declaration-card--nurse .declaration-icon {
    background-color: #dcfce7;
    color: #15803d;
}

.declaration-card--midwife .declaration-icon {
    background-color: #fae8ff;
    color: #9333ea;
}

.declaration-btn {
    min-width: 80px;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Downloads List (Inne tab) */
.downloads-list {
    width: 100%;
}

.downloads-list__item {
    border-bottom: 1px solid #e5e7eb;
}

.downloads-list__item:first-child {
    border-top: 1px solid #e5e7eb;
}

.downloads-list__link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.15s ease;
    border-radius: 6px;
}

.downloads-list__link:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

.downloads-list__icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    width: 2rem;
    text-align: center;
}

.downloads-list__info {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.4;
}

.downloads-list__name {
    font-weight: 500;
}

.downloads-list__arrow {
    color: #9ca3af;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Emergency Modal Styles */
.emergency-intro {
    background-color: #fdf3f3;
    border-left: 4px solid #dc3545;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
}

.emergency-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.emergency-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.emergency-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.emergency-address a:hover {
    text-decoration: underline !important;
}

.emergency-phone-btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.emergency-phone-btn:hover {
    background-color: #198754;
    border-color: #198754;
    color: white;
    transform: translateY(-1px);
}

.emergency-address-btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: normal;
    text-align: left;
    line-height: 1.3;
    width: 100%;
    display: inline-block;
}

.emergency-address-btn:hover {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
    transform: translateY(-1px);
}

.emergency-zones .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.3;
    text-align: left;
    max-width: 100%;
}

.emergency-zones .d-flex {
    gap: 0.375rem !important;
    align-items: flex-start;
}

/* Blood Points Modal Styles */
.blood-points-list .list-group-item {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    padding: 1rem;
    border-left: 4px solid #dc3545;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.blood-points-list .list-group-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

#blood-points-map {
    height: 100%;
}

.blood-points-map .map-container {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.blood-points-map iframe {
    min-height: 400px;
}

/* Doctor Carousel Styles */
.doctor-carousel-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.doctor-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.doctor-carousel {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: transparent;
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease-in-out;
    width: 100%;
}

.carousel-slide {
    flex: 0 0 100%;
    display: flex;
    justify-content: center;
    padding: 1rem;
}

.carousel-slide .doctor-card {
    width: 100%;
    max-width: 400px;
    margin: 0;
    position: relative;
}

/* Carousel Navigation Buttons */
.carousel-nav-btn {
    background: var(--primary-color);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
    flex-shrink: 0;
}

.carousel-nav-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

.carousel-nav-btn:active {
    transform: scale(0.95);
}

.carousel-nav-btn:disabled,
.carousel-nav-btn[style*="opacity: 0.5"] {
    cursor: not-allowed;
    opacity: 0.5;
}

.carousel-nav-btn:disabled:hover {
    background: var(--primary-color);
    transform: none;
}

/* Carousel Indicators */
.carousel-indicators {
    position: static;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0 0;
    padding: 0;
}

.carousel-indicators .indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-indicators .indicator:hover {
    background: var(--secondary-color);
    transform: scale(1.2);
}

.carousel-indicators .indicator.active {
    background: var(--primary-color);
    transform: scale(1.3);
}

/* Responsive Design for Carousel */
@media (max-width: 768px) {
    .doctor-carousel-container {
        padding: 0 1rem;
    }
    
    .doctor-carousel-wrapper {
        gap: 0.5rem;
    }
    
    .carousel-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .carousel-slide {
        padding: 1rem 0.5rem;
    }
    
    .carousel-slide .doctor-card {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .doctor-carousel-container {
        padding: 0 0.5rem;
    }
    
    .carousel-nav-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .carousel-indicators {
        margin-top: 1.5rem;
    }
    
    .carousel-indicators .indicator {
        width: 10px;
        height: 10px;
    }
}

/* Touch/Swipe Enhancement */
.doctor-carousel {
    touch-action: pan-y pinch-zoom;
    user-select: none;
}

/* Accessibility improvements */
.carousel-nav-btn:focus {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}

.carousel-indicators .indicator:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Animation for smoother transitions */
@media (prefers-reduced-motion: reduce) {
    .carousel-track {
        transition: none;
    }
    
    .carousel-nav-btn {
        transition: none;
    }
    
    .carousel-indicators .indicator {
        transition: none;
    }
}

/* Responsive Doctor Display System */
.doctors-grid,
.doctors-carousel {
    transition: opacity 0.3s ease-in-out;
}

/* Ensure proper spacing in grid mode */
.doctors-grid .doctor-card {
    height: 100%;
}

/* Optimize carousel for mobile */
@media (max-width: 1199.98px) {
    .doctors-carousel {
        display: block !important;
    }
    
    .doctors-grid {
        display: none !important;
    }
}

/* Optimize grid for desktop */
@media (min-width: 1200px) {
    .doctors-grid {
        display: block !important;
    }
    
    .doctors-carousel {
        display: none !important;
    }
}