/* Sidebar styles - only apply to non-dashboard pages */
body:not(.dashboard-page) .sidebar-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1050;
    background: #fff;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    cursor: pointer;
}

/* Sidebar overlay - covers screen when sidebar is active on mobile */
body:not(.dashboard-page) .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
    display: none;
    transition: opacity 0.3s ease-in-out;
}

body:not(.dashboard-page) .sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* Sidebar container */
body:not(.dashboard-page) .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 300px;
    background-color: #fff;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
    z-index: 1050;
    transform: translateX(-100%);
    /* Hide sidebar by default on small screens */
}

/* Show sidebar when toggled */
body:not(.dashboard-page) .sidebar.show {
    transform: translateX(0);
}

/* Content wrapper to give space for sidebar on desktop */
body:not(.dashboard-page) .content-wrapper {
    margin-left: 300px;
    transition: margin-left 0.3s ease-in-out;
    min-height: 100vh;
    padding: 1rem 2rem;
}

/* When sidebar is active on small screen, dim background */
body:not(.dashboard-page) .content-wrapper.active {
    pointer-events: none; /* prevent clicks on content when sidebar open */
    user-select: none;
}

/* Responsive adjustments: for smaller screens */
@media (max-width: 991.98px) {
    /* Sidebar is hidden by default on tablets and smaller */
    body:not(.dashboard-page) .sidebar {
        transform: translateX(-100%);
        width: 260px;
    }

    /* Content takes full width */
    body:not(.dashboard-page) .content-wrapper {
        margin-left: 0;
        padding: 1rem 1rem;
        pointer-events: auto;
        user-select: auto;
    }

    /* Sidebar toggle visible on mobile */
    body:not(.dashboard-page) .sidebar-toggle {
        display: block;
    }
}

/* Sidebar logo image responsive */
body:not(.dashboard-page) .sidebar-logo img {
    max-width: 100%;
    height: 50px; /* Fixed height to ensure consistency */
    display: block;
    margin: 1rem auto;
}

/* User profile section in sidebar */
body:not(.dashboard-page) .user-profile {
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 1rem;
    border-top: 1px solid #eee;
    transition: background-color 0.2s ease-in-out;
}

body:not(.dashboard-page) .user-profile:hover {
    background-color: #f8f9fa;
}

body:not(.dashboard-page) .user-profile img,
body:not(.dashboard-page) .user-profile .arrow-right-icon {
    flex-shrink: 0;
}

body:not(.dashboard-page) .user-profile-info {
    flex-grow: 1;
    margin-left: 0.75rem;
    overflow: hidden;
}

body:not(.dashboard-page) .user-profile-info .name,
body:not(.dashboard-page) .user-profile-info .email {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dashboard page specific styles */
body.dashboard-page .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background-color: #fff;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
    z-index: 1050;
    transform: translateX(0); /* Show sidebar by default on desktop */
}

body.dashboard-page .dashboard-content {
    margin-left: 280px;
    transition: margin-left 0.3s ease;
}

/* Mobile responsive for dashboard */
@media (max-width: 991px) {
    body.dashboard-page .sidebar {
        transform: translateX(-100%); /* Hide sidebar on mobile by default */
    }
    
    body.dashboard-page .sidebar.show {
        transform: translateX(0); /* Show sidebar when toggled on mobile */
    }
    
    body.dashboard-page .dashboard-content {
        margin-left: 0; /* No margin on mobile */
    }
    
    body.dashboard-page .sidebar-toggle {
        display: block; /* Show toggle button on mobile */
    }
}

/* Navbar brand logo */
.navbar-brand img {
    max-height: 88px; /* larger logo for wider navbar presence */
    width: auto;
}
@media (max-width: 576px) {
  .navbar-brand img {
    max-height: 64px; /* scale down on very small screens */
  }
}

/* Modal window for profile update */
.profile-update-modal {
    width: 100%;
    max-width: 500px;
    margin: auto;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* Responsive full width inputs and buttons in modal */
@media (max-width: 576px) {
    .profile-form .profile-input,
    .profile-form button.update-profile-button {
        width: 100%;
    }
}

/* Flex layout for first and last name inputs */
.name-fields {
    display: flex;
    gap: 0.5rem;
}

.name-fields .form-field {
    flex-grow: 1;
}

/* Alerts fade out styling */
.alert.fade {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

/* Camera button for profile image upload */
.camera-button {
    cursor: pointer;
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: #007bff;
    color: #fff;
    border-radius: 50%;
    padding: 8px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.camera-button:hover {
    background: #0056b3;
}

/* Profile photo wrapper relative to position camera button */
.profile-photo-wrapper {
    position: relative;
}

/* Profile photo */
.profile-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
}

/* Success modal styles */
.success-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.success-modal-overlay.show {
    display: flex;
}

.success-modal {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    max-width: 400px;
    width: 90%;
}

.success-icon-image {
    max-width: 80px;
    margin-bottom: 1rem;
}

.success-message {
    font-weight: 600;
    font-size: 1.2rem;
}

/* Footer modern styling */
.enhanced-footer {
    background: #0b2138;
    color: #e8f0f8;
    padding-top: 48px;
}

.footer-divider {
    height: 1px;
    background: linear-gradient(90deg, rgba(52,178,74,0), rgba(52,178,74,0.6), rgba(48,129,195,0.6), rgba(48,129,195,0));
    margin: 24px 0;
}

/* Footer social icons */
.footer-social .social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    color: #e8f0f8;
    font-size: 1.1rem;
    margin-right: 0.5rem;
    transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
    text-decoration: none;
}

.footer-social .social-btn:hover {
    background: #ffffff; /* requested white hover bg */
    color: #3081C3; /* brand blue icon on hover */
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(48,129,195,0.20);
}

/* ---- App download buttons ---- */
.app-download-buttons {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.app-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    border: 1px solid transparent;
}

.app-download-btn .download-text {
    line-height: 1.1;
    color: inherit;
}

/* Google Play (Android) specific: default black, hover white */
.app-download-btn.android-btn {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.app-download-btn.android-btn:hover {
    background: #ffffff; /* requested hover white */
    color: #000000;
    border-color: #000000;
    box-shadow: 0 8px 18px rgba(0,0,0,0.25);
}

.footer-links-title {
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 12px;
}

.footer-links ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.footer-links ul li a {
    display: inline-flex;
    align-items: center;
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

.footer-links ul li a:hover {
    color: #e9f2ff;
    transform: translateX(2px);
}

/* Footer contact icons: hover background to white (not icon color) */
.footer-contact .contact-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.footer-contact .contact-icon i {
    color: #ffffff; /* always white icons */
}

.footer-contact .contact-item:hover .contact-icon {
    background: #ffffff; /* requested white background on hover */
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}

/* blue on hover */
.footer-contact .contact-item:hover .contact-icon i {
    color: #2C75B6;
}

/* Footer Contact Link */
.footer-contact .contact-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.footer-contact .contact-link:hover {
    color: inherit;
    text-decoration: none;
    transform: translateX(3px);
}

.footer-contact .contact-link .contact-text {
    color: #c7d3e0;
}

.footer-contact .contact-link:hover .contact-text {
    color: #ffffff;
}

/* Footer layout responsive */
.footer-main {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-between;
}

.footer-logo-section,
.footer-links,
.footer-contact {
    flex: 1 1 250px;
    min-width: 250px;
}

/* Footer bottom section */
.footer-bottom {
    margin-top: 30px !important;
    padding-top: 0 !important;
}

.footer-bottom .newsletter-consent-section {
    margin-top: 0 !important;
}

.footer-main {
    margin-bottom: 0 !important;
}

/* Footer bottom links */
.footer-bottom-links a {
    margin-left: 1rem;
    color: #c7d3e0;
    text-decoration: none;
}

.footer-bottom-links a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* ===== Navbar Enhancements ===== */
/* Container */
.kaicure-navbar {
    background: rgba(255,255,255,0.86);
    backdrop-filter: saturate(120%) blur(6px);
    -webkit-backdrop-filter: saturate(120%) blur(6px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    font-family: 'Urbanist', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    padding-top: 12px;  /* add vertical breathing room */
    padding-bottom: 12px; /* add vertical breathing room */
}

/* Brand spacing & logo sizing (logo height already set above) */
.kaicure-navbar .navbar-brand {
    font-weight: 700;
    letter-spacing: 0.2px;
}

/* Links */
.kaicure-navbar .nav-link {
    color: #1a2433;
    font-weight: 600;
    font-size: 1.06rem; /* bigger tab text */
    padding: 0.75rem 1.0rem; /* slightly tighter for professional chip */
    border-radius: 10px; /* for hover/active chip */
    transition: color 0.18s ease, background-color 0.18s ease;
    position: relative; /* allow decorative pseudo-elements */
}

/* Active state */
.kaicure-navbar .nav-link.active {
    color: #0b5ed7;
    background-color: transparent; /* no background color on active */
    box-shadow: none; /* remove chip depth for clean active state */
}
.kaicure-navbar .nav-link.active.link-hover::after {
    transform: scaleX(1);
    background: linear-gradient(90deg, rgba(13,110,253,0.0), rgba(13,110,253,0.95), rgba(13,110,253,0.0));
}

.kaicure-navbar .nav-link.small {
    font-size: 0.95rem;
}

.kaicure-navbar .nav-link:hover,
.kaicure-navbar .nav-link:focus {
    color: #0b5ed7;
    background-color: #f7fbff; /* very light hover/focus */
}

/* Subtle underline on hover */
.kaicure-navbar .link-hover {
    position: relative;
}

/* Remove underline animation per request */
.kaicure-navbar .link-hover::after { display: none !important; }

/* Animated gradient border for active tab (no outside gap) */
.kaicure-navbar .nav-link.active::before {
    content: "";
    position: absolute;
    inset: 0; /* align with chip edges to remove outer gap */
    border-radius: 10px;
    padding: 2px; /* thicker animated border */
    background: linear-gradient(90deg, #34B24A 0%, #3081C3 50%, #34B24A 100%);
    background-size: 600% 100%; /* more motion range */
    -webkit-mask:
      linear-gradient(#000 0 0) content-box,
      linear-gradient(#000 0 0);
    mask:
      linear-gradient(#000 0 0) content-box,
      linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    animation: nav-active-gradient 1.8s ease-in-out infinite alternate; /* faster, livelier */
    pointer-events: none;
}

@keyframes nav-active-gradient {
    0% { background-position: 0% 0%; }
    50% { background-position: 50% 0%; }
    100% { background-position: 100% 0%; }
}

@media (prefers-reduced-motion: reduce) {
  .kaicure-navbar .nav-link.active::before {
    animation: none;
  }
}

/* CTA Button */
.kaicure-navbar .btn-cta {
    border-radius: 10px; /* rectangular */
    padding: 0.6rem 1.05rem;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(13,110,253,0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.kaicure-navbar .btn-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(13,110,253,0.28);
}

/* Outlined Login button */
.kaicure-navbar .btn-login {
    border-radius: 10px; /* rectangular */
    font-weight: 700;
    padding: 0.6rem 1.05rem;
    border-width: 2px;
    line-height: 1.25;
    border-color: #1f2937; /* dark outline */
    color: #ffffff; /* white text */
    background-color: #1f2937; /* dark background */
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.kaicure-navbar .btn-login:hover,
.kaicure-navbar .btn-login:focus {
    background-color: #111827; /* darker on hover */
    border-color: #111827;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(0,0,0,0.25);
}

/* Keep clear gaps between tabs/links */
.kaicure-navbar .navbar-nav .nav-item {
    margin: 0 0.15rem;
}

/* Visual separation between main links and auth actions */
.kaicure-navbar .navbar-nav .nav-auth-gap {
    position: relative;
    margin-left: 0.5rem;
}

@media (min-width: 992px) {
  .kaicure-navbar .navbar-nav .nav-auth-gap {
      margin-left: 1.25rem;
  }
  .kaicure-navbar .navbar-nav .nav-auth-gap::before {
      content: "";
      position: absolute;
      left: -0.625rem;
      top: 50%;
      transform: translateY(-50%);
      height: 22px;
      width: 1px;
      background: rgba(0,0,0,0.18); /* darker divider */
  }
}

/* Slightly larger icons inside nav links */
.kaicure-navbar .nav-link i {
    font-size: 1.05rem;
    vertical-align: -1px;
}

/* Better focus styles for accessibility */
.kaicure-navbar .nav-link:focus-visible,
.kaicure-navbar .btn-cta:focus-visible,
.kaicure-navbar .navbar-toggler:focus-visible {
    outline: 3px solid rgba(13,110,253,0.35);
    outline-offset: 2px;
    border-radius: 8px;
}

/* Toggler icon visibility and hit-area */
.kaicure-navbar .navbar-toggler {
    border: none;
    box-shadow: none !important;
    padding: 0.35rem 0.5rem;
}

.kaicure-navbar.navbar-light .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='rgba(0, 0, 0, 0.6)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Collapse background on mobile */
@media (max-width: 991.98px) {
    .kaicure-navbar .navbar-collapse {
        background: #ffffff;
        border-top: 1px solid rgba(0,0,0,0.06);
        padding: 0.5rem 0.25rem;
        margin-top: 0.5rem;
    }
    .kaicure-navbar .nav-item + .nav-item { 
        border-top: 1px dashed rgba(0,0,0,0.06);
    }
    .kaicure-navbar .nav-link { 
        padding: 1rem 0.85rem; 
    }
}

/* Footer Mobile Responsiveness */
@media (max-width: 768px) {
    .enhanced-footer {
        padding-top: 30px;
    }
    
    .footer-main {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    /* Row 1: Both logos */
    .footer-logo-section {
        order: 1;
        min-width: auto;
        flex: none;
    }
    
    .footer-logos {
        justify-content: center;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .footer-main-logo {
        height: 32px;
    }
    
    .footer-logos .footer-compliance-logo {
        height: 60px !important;
    }
    
    /* Row 2: Social media icons */
    .footer-social {
        order: 2;
        margin-bottom: 1rem;
        justify-content: center;
        gap: 0.8rem;
    }
    
    .footer-social .social-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    /* Row 3: App download buttons (smaller, same row, centered) */
    .app-download-buttons {
        order: 3 !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 1rem !important;
        justify-content: center !important;
        align-items: center !important;
        margin-bottom: 1.5rem !important;
        margin-top: 0 !important;
    }
    
    .app-download-btn {
        padding: 4px 8px;
        gap: 4px;
        font-size: 0.65rem;
        border-radius: 6px;
        min-width: 120px;
        max-width: 140px;
    }
    
    .app-download-btn i {
        font-size: 1rem;
    }
    
    .app-download-btn .download-text {
        line-height: 1;
        font-size: 0.6rem;
    }
    
    /* Row 4: Quick Links all in same row */
    .footer-links {
        order: 4;
        min-width: auto;
        flex: none;
        margin-bottom: 1rem;
    }
    
    .footer-links-title {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
        border-left: none !important;
        padding-left: 0 !important;
        position: relative;
    }
    
    .footer-links-title::before,
    .footer-links-title::after {
        display: none !important;
        content: none !important;
    }
    
    .footer-links ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem 1rem;
    }
    
    .footer-links ul li {
        margin: 0;
    }
    
    .footer-links ul li a {
        font-size: 0.85rem;
        padding: 0;
        white-space: nowrap;
    }
    
    .footer-links ul li a i {
        display: none; /* Hide chevron icons on mobile */
    }
    
    /* Row 5: Get in Touch all in same row, centered */
    .footer-contact {
        order: 5;
        min-width: auto;
        flex: none;
        margin-bottom: 1.5rem;
        border-left: none !important;
        padding-left: 0 !important;
    }
    
    .footer-contact .footer-links-title {
        border-left: none !important;
        padding-left: 0 !important;
    }
    
    .footer-contact .footer-links-title::before,
    .footer-contact .footer-links-title::after {
        display: none !important;
        content: none !important;
    }
    
    .contact-info {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 1.5rem !important;
    }
    
    .contact-item {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.3rem !important;
        font-size: 0.7rem !important;
        text-align: center !important;
        min-width: 90px !important;
        margin: 0 !important;
    }
    
    .contact-icon {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.8rem;
        margin-bottom: 0.2rem;
    }
    
    .contact-text {
        text-align: center;
    }
    
    .contact-text strong {
        display: block;
        font-size: 0.65rem;
        margin-bottom: 1px;
        font-weight: 600;
    }
    
    /* Row 6: Footer bottom */
    .footer-bottom {
        order: 6;
        margin-top: 20px !important;
        text-align: center;
    }
    
    .footer-bottom-links a {
        font-size: 0.8rem;
        margin: 0 0.5rem;
    }
    
    .newsletter-consent-section {
        font-size: 0.8rem;
        margin-bottom: 1rem;
    }
    
    .newsletter-consent-section p {
        margin-bottom: 0.5rem !important;
    }
}

