/* ================= IMPROVED HEADER STYLES ================= */

/* Single-row header layout */
.header-main-menu {
    padding: 12px 0;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.header-sticky.is-sticky {
    padding: 8px 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Logo styling */
.site-logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 42px;
    width: auto;
    transition: all 0.3s ease;
}

/* Mobile logo optimized size */
@media (max-width: 991px) {
    .logo-img {
        height: 42px;
    }
}

@media (max-width: 576px) {
    .logo-img {
        height: 40px;
    }
}

/* Sticky header logo adjustment */
.header-sticky.is-sticky .logo-img {
    height: 38px;
}

@media (max-width: 576px) {
    .header-sticky.is-sticky .logo-img {
        height: 36px;
    }
}

/* Navigation improvements */
.main-navigation {
    display: flex;
    justify-content: center;
}

.site-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 10px;
    flex-wrap: nowrap;
}

.site-menu > li > a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.site-menu > li > a:hover {
    color: #FF4D5A;
    background: rgba(255, 77, 90, 0.1);
}

/* Special styling for login/logout menu items */
.site-menu > li.login-menu-item > a {
    background: linear-gradient(135deg, #FF4D5A 0%, #ff6b7a 100%);
    color: white;
    font-weight: 600;
    border-radius: 16px;
    margin-left: 8px;
}

.site-menu > li.login-menu-item > a:hover {
    background: linear-gradient(135deg, #e6434f 0%, #f55a6b 100%);
    color: white;
    transform: translateY(-1px);
}

.site-menu > li.logout-menu-item > a {
    background: linear-gradient(135deg, #dc3545 0%, #e85663 100%);
    color: white;
    font-weight: 600;
    border-radius: 16px;
    margin-left: 4px;
}

.site-menu > li.logout-menu-item > a:hover {
    background: linear-gradient(135deg, #c82333 0%, #d93e4a 100%);
    color: white;
    transform: translateY(-1px);
}

/* Action buttons styling */
.nav-actions {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 6px;
}

.nav-actions .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-actions .profile-link:hover {
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
}

.nav-actions .logout-link:hover {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.login-btn {
    background: linear-gradient(135deg, #FF4D5A 0%, #ff6b7a 100%);
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 77, 90, 0.3);
}

.login-btn:hover {
    background: linear-gradient(135deg, #e6434f 0%, #f55a6b 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(255, 77, 90, 0.4);
    color: white;
    text-decoration: none;
}

.plans-btn {
    background: linear-gradient(135deg, #ffc107 0%, #ffcd39 100%);
    color: #333;
    border: none;
    padding: 6px 10px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.plans-btn:hover {
    background: linear-gradient(135deg, #e0a800 0%, #f0b90b 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.4);
    color: #333;
    text-decoration: none;
}

/* Beautiful Mobile Action Buttons - Restored */
.mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-plans-btn,
.mobile-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 16px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}

.mobile-plans-btn {
    background: linear-gradient(135deg, #ffc107 0%, #ffcd39 100%);
    color: #333;
}

.mobile-login-btn {
    background: linear-gradient(135deg, #FF4D5A 0%, #ff6b7a 100%);
    color: white;
}

.mobile-plans-btn:hover,
.mobile-login-btn:hover {
    transform: translateY(-2px);
    text-decoration: none;
    box-shadow: 0 5px 12px rgba(0,0,0,0.2);
}

.mobile-plans-btn:hover {
    color: #333;
}

.mobile-login-btn:hover {
    color: white;
}

/* Mobile menu toggle - simplified */

/* Mobile menu toggle - clean and simple */
.mobile-menu-toggle {
    background: none;
    border: none;
    padding: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-left: 8px;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 77, 90, 0.1);
}

.hamburger-line {
    width: 24px;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover .hamburger-line {
    background: #FF4D5A;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Responsive adjustments */
@media (max-width: 1199px) {
    .site-menu {
        gap: 20px;
    }
    
    .site-menu > li > a {
        font-size: 14px;
        padding: 6px 8px;
    }
}

/* Enhanced mobile responsiveness - Optimized Size */
@media (max-width: 991px) {
    .header-main-menu {
        padding: 12px 0;
        min-height: 65px;
    }
    
    .header-sticky.is-sticky {
        padding: 10px 0;
        min-height: 60px;
    }
}

@media (max-width: 768px) {
    .header-main-menu {
        padding: 14px 0;
        min-height: 70px;
    }
    
    .header-sticky.is-sticky {
        padding: 12px 0;
        min-height: 65px;
    }
    
    .mobile-header-actions {
        gap: 8px;
    }
    
    .mobile-plans-btn,
    .mobile-login-btn {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }
    
    .mobile-menu-toggle {
        padding: 10px;
        margin-left: 6px;
    }
    
    .hamburger-line {
        width: 22px;
        height: 3px;
    }
}

@media (max-width: 576px) {
    .header-main-menu {
        padding: 16px 0;
        min-height: 72px;
    }
    
    .header-sticky.is-sticky {
        padding: 14px 0;
        min-height: 68px;
    }
    
    .mobile-header-actions {
        gap: 8px;
    }
    
    .mobile-plans-btn,
    .mobile-login-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    }
    
    .mobile-menu-toggle {
        padding: 10px;
        margin-left: 4px;
    }
    
    .hamburger-line {
        width: 20px;
        height: 2px;
    }
}

/* Enhanced sticky behavior */
.header-sticky.is-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Remove the old header-bottom section completely */
.header-bottom {
    display: none !important;
}

/* Menu improvements for better spacing */
.site-menu > li {
    position: relative;
}

.site-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #FF4D5A;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.site-menu > li > a:hover::after,
.site-menu > li.current-menu-item > a::after {
    width: 100%;
}

/* Ensure no line breaks in navigation */
.main-navigation {
    white-space: nowrap;
}

.site-menu {
    flex-wrap: nowrap;
}

/* Compact desktop header for smaller screens */
@media (max-width: 1200px) {
    .logo-img {
        height: 38px;
    }
    
    .site-menu {
        gap: 8px;
    }
    
    .site-menu > li > a {
        font-size: 12px;
        padding: 3px 6px;
    }
    
    .login-btn,
    .plans-btn {
        padding: 5px 8px;
        font-size: 11px;
        gap: 3px;
    }
    
    .nav-actions {
        gap: 4px;
    }
}

@media (max-width: 1100px) {
    .logo-img {
        height: 36px;
    }
    
    .site-menu {
        gap: 6px;
    }
    
    .site-menu > li > a {
        font-size: 11px;
        padding: 2px 5px;
    }
    
    .login-btn,
    .plans-btn {
        padding: 4px 6px;
        font-size: 10px;
    }
}

/* Content Spacing Fix - Prevent Header Overlap */
.pages_content_holder {
    padding-top: 80px; /* Space for sticky header */
}

/* Additional spacing for pages with inner banners */
.inner-page-banner {
    margin-top: 20px;
}

/* Extra spacing for first elements on pages */
.pages_content_holder > section:first-child,
.pages_content_holder > .container:first-child,
.pages_content_holder > div:first-child {
    padding-top: 20px;
}

/* Specific spacing for homepage slider */
.ranna-slider-area {
    padding-top: 30px;
}

/* Specific spacing for category and other pages */
.all-recipes-page-wrap,
.recipe-page-wrap,
.contact-page-wrap,
.login-page-wrap {
    padding-top: 100px !important;
}

/* Recipe single page spacing */
.single-recipe-wrap {
    padding-top: 100px !important;
}

/* Plans page spacing */
.plans-wrap {
    padding-top: 100px !important;
}

/* Additional spacing for page titles and headings */
.page-title,
.item-heading-big,
.section-heading h1,
.section-heading h2,
.section-heading h3 {
    margin-top: 20px !important;
}

/* Inner page banner adjustments */
.inner-page-banner .page-banner-content {
    padding-top: 40px;
    padding-bottom: 40px;
}

/* Legal pages specific spacing */
.terms-content,
.privacy-content,
.imprint-content {
    padding-top: 30px;
}

/* Responsive adjustments for mobile */
@media (max-width: 991px) {
    .pages_content_holder {
        padding-top: 85px; /* Adjust for mobile header height */
    }
    
    .all-recipes-page-wrap,
    .recipe-page-wrap,
    .contact-page-wrap,
    .login-page-wrap,
    .single-recipe-wrap,
    .plans-wrap {
        padding-top: 90px !important;
    }
}

@media (max-width: 768px) {
    .pages_content_holder {
        padding-top: 90px; /* Adjust for mobile header height */
    }
    
    .ranna-slider-area {
        padding-top: 20px;
    }
    
    .all-recipes-page-wrap,
    .recipe-page-wrap,
    .contact-page-wrap,
    .login-page-wrap,
    .single-recipe-wrap,
    .plans-wrap {
        padding-top: 80px !important;
    }
}

/* Global mobile improvements */
@media (max-width: 768px) {
    /* Increase base font sizes for better mobile readability */
    body {
        font-size: 16px;
        line-height: 1.6;
    }
    
    h1 { font-size: 32px; }
    h2 { font-size: 28px; }
    h3 { font-size: 24px; }
    h4 { font-size: 20px; }
    h5 { font-size: 18px; }
    h6 { font-size: 16px; }
    
    /* Improve button sizes */
    .btn {
        padding: 12px 24px;
        font-size: 16px;
        min-height: 48px;
    }
    
    .btn-sm {
        padding: 10px 20px;
        font-size: 15px;
        min-height: 44px;
    }
    
    /* Improve form elements */
    .form-control {
        padding: 12px 16px;
        font-size: 16px;
        min-height: 48px;
    }
    
    /* Improve card elements */
    .card, .panel {
        padding: 24px;
        margin-bottom: 24px;
    }
}

@media (max-width: 576px) {
    /* Even larger for small phones */
    body {
        font-size: 17px;
    }
    
    h1 { font-size: 28px; }
    h2 { font-size: 26px; }
    h3 { font-size: 22px; }
    
    .btn {
        padding: 14px 28px;
        font-size: 17px;
        min-height: 52px;
    }
    
    .form-control {
        padding: 14px 18px;
        font-size: 17px;
        min-height: 52px;
    }
}

/* Critical Mobile Viewport Fixes - Prevent Horizontal Scrolling */
* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.container,
.container-fluid {
    max-width: 100%;
    overflow-x: hidden;
}

/* Prevent any element from causing horizontal scroll */
.row {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
}

.col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, 
.col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
.col-auto, .col-sm, .col-sm-1, .col-sm-2, .col-sm-3, 
.col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, 
.col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-auto,
.col-md, .col-md-1, .col-md-2, .col-md-3, .col-md-4, 
.col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, 
.col-md-10, .col-md-11, .col-md-12, .col-md-auto,
.col-lg, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, 
.col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, 
.col-lg-10, .col-lg-11, .col-lg-12, .col-lg-auto,
.col-xl, .col-xl-1, .col-xl-2, .col-xl-3, .col-xl-4, 
.col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, 
.col-xl-10, .col-xl-11, .col-xl-12, .col-xl-auto {
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100%;
}

/* Mobile-specific container fixes */
@media (max-width: 767px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
        width: 100%;
        max-width: 100%;
    }
    
    .row {
        margin-left: -15px;
        margin-right: -15px;
    }
}

/* Fix any images or content that might overflow */
img {
    max-width: 100%;
    height: auto;
}

/* Ensure no fixed widths break mobile */
table {
    max-width: 100%;
    overflow-x: auto;
}

pre, code {
    max-width: 100%;
    overflow-x: auto;
}

/* Mobile menu width adjustment for smaller screens */
@media (max-width: 480px) {
    .main-navigation.mobile-nav {
        width: 280px;
    }
}

@media (max-width: 360px) {
    .main-navigation.mobile-nav {
        width: 260px;
    }
}

/* Mobile Menu - Complete Redesign for Better UX */
@media (max-width: 991px) {
    .main-navigation.mobile-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 320px;
        height: 100vh;
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
        z-index: 9999;
        padding: 0;
        box-shadow: 3px 0 20px rgba(0,0,0,0.15);
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        overflow-y: auto;
        border-right: 1px solid #e9ecef;
    }
    
    .main-navigation.mobile-nav.mobile-menu-open {
        left: 0;
    }
    
    /* Mobile menu header */
    .main-navigation.mobile-nav::before {
        content: '';
        display: block;
        height: 80px;
        background: linear-gradient(135deg, #FF4D5A 0%, #ff6b7a 100%);
        position: relative;
    }
    
    .main-navigation.mobile-nav::after {
        content: 'Recipe AI Menu';
        position: absolute;
        top: 25px;
        left: 30px;
        color: white;
        font-size: 18px;
        font-weight: 600;
        letter-spacing: 0.5px;
    }
    
    .site-nav {
        padding: 20px 0;
    }
    
    .site-nav .site-menu {
        flex-direction: column;
        gap: 0;
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .site-nav .site-menu > li {
        border-bottom: 1px solid #e9ecef;
        width: 100%;
        margin: 0;
    }
    
    .site-nav .site-menu > li:last-child {
        border-bottom: none;
    }
    
    .site-nav .site-menu > li > a {
        display: flex;
        align-items: center;
        padding: 18px 30px;
        color: #2c3e50 !important;
        font-size: 16px;
        font-weight: 500;
        text-decoration: none;
        transition: all 0.3s ease;
        position: relative;
        background: transparent;
    }
    
    /* Add icons to menu items */
    .site-nav .site-menu > li:nth-child(1) > a::before { content: '🏠'; margin-right: 12px; }
    .site-nav .site-menu > li:nth-child(2) > a::before { content: '📂'; margin-right: 12px; }
    .site-nav .site-menu > li:nth-child(3) > a::before { content: '💎'; margin-right: 12px; }
    .site-nav .site-menu > li:nth-child(4) > a::before { content: '📞'; margin-right: 12px; }
    .site-nav .site-menu > li:nth-child(5) > a::before { content: '📧'; margin-right: 12px; }
    .site-nav .site-menu > li:nth-child(6) > a::before { content: '☎️'; margin-right: 12px; }
    .site-nav .site-menu > li:nth-child(7) > a::before { content: '📋'; margin-right: 12px; }
    .site-nav .site-menu > li:nth-child(8) > a::before { content: '🔒'; margin-right: 12px; }
    .site-nav .site-menu > li:nth-child(9) > a::before { content: 'ℹ️'; margin-right: 12px; }
    
    .site-nav .site-menu > li > a:hover,
    .site-nav .site-menu > li > a:focus {
        color: #FF4D5A !important;
        background: rgba(255, 77, 90, 0.05);
        padding-left: 40px;
        transform: translateX(5px);
    }
    
    .site-nav .site-menu > li > a::after {
        content: '›';
        position: absolute;
        right: 25px;
        color: #adb5bd;
        font-size: 18px;
        transition: all 0.3s ease;
    }
    
    .site-nav .site-menu > li > a:hover::after {
        color: #FF4D5A;
        transform: translateX(5px);
    }
    
    /* Mobile menu overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.6);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s ease;
        backdrop-filter: blur(2px);
    }
    
    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Body scroll lock when mobile menu is open */
    body.mobile-menu-active {
        overflow: hidden;
    }
    
    /* Mobile menu close button */
    .mobile-menu-close {
        position: absolute;
        top: 20px;
        right: 20px;
        background: rgba(255,255,255,0.2);
        border: none;
        color: white;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-close:hover {
        background: rgba(255,255,255,0.3);
        transform: rotate(90deg);
    }
}
