/*
 * M&L Suite Frontend Styles
 */
 body {
    margin: 0;
    font-family: Arial, sans-serif;
}

/* Navbar styles */
.navbar {
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: transparent;
    position: relative;
    z-index: 1000;
}

/* Navbar background color class */
.navbar-bg {
    background-color: #333;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.navbar-title {
    color: #333;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
}

.navbar-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.navbar-title a:hover {
    color: #007bff;
}

/* Site logo styles */
.navbar-title .site-logo {
    max-height: 40px;
    width: auto;
    display: block;
    transition: opacity 0.3s ease;
    vertical-align: middle;
}

/* When logo is present, adjust navbar title */
.navbar-title.has-logo {
    font-size: 0; /* Hide text when logo is present */
    line-height: 1;
}

.navbar-title .site-logo:hover {
    opacity: 0.8;
}

/* When navbar-bg class is applied, ensure logo is visible */
.navbar-bg .navbar-title .site-logo {
    filter: brightness(0) invert(1); /* Makes logo white */
}

/* When navbar-bg class is applied, change text colors */
.navbar-bg .navbar-title {
    color: white;
}

.menu-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.nav-menu li {
    margin-left: 1.5rem;
    position: relative;
}

.nav-menu li:first-child {
    margin-left: 0;
}

.nav-menu a {
    color: #333;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-menu a:hover {
    color: #007bff;
}

/* When navbar-bg class is applied, change menu colors */
.navbar-bg .nav-menu a {
    color: white;
}

.navbar-bg .nav-menu a:hover {
    color: #ddd;
}

/* Sub-menu styles for horizontal navigation */
.nav-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.nav-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu .sub-menu li {
    margin: 0;
    padding: 0;
}

.nav-menu .sub-menu a {
    color: #333;
    padding: 0.75rem 1rem;
    display: block;
    border-bottom: 1px solid #f8f9fa;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.nav-menu .sub-menu a:hover {
    background-color: #f8f9fa;
    color: #007bff;
    padding-left: 1.25rem;
}

.nav-menu .sub-menu li:last-child a {
    border-bottom: none;
}

/* Nested sub-menus (third level) */
.nav-menu .sub-menu .sub-menu {
    top: 0;
    left: 100%;
    margin-left: 1px;
}

/* Sub-menu indicator arrow */
.nav-menu .menu-item-has-children > a::after {
    content: '▼';
    font-size: 1.1rem;
    margin-left: 0.25rem;
    transition: transform 0.3s ease;
    line-height: 1;
}

.nav-menu .menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
}

/* CTA button styles */
.cta-button {
    background-color: #ff6b6b;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.cta-button:hover {
    background-color: rgba(255, 107, 107, 0.8);
    color: white;
}

/* Hamburger menu styles */
.menu-toggle {
    display: none;
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    position: relative;
    width: 30px;
    height: 20px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.menu-toggle:focus {
    outline: none;
}

.hamburger {
    width: 100%;
    height: 2px;
    background: #333;
    position: absolute;
    left: 0;
    transition: all 0.3s ease;
}

/* When navbar-bg class is applied, change hamburger colors */
.navbar-bg .hamburger {
    background: white;
}

.hamburger:nth-child(1) {
    top: 0;
}

.hamburger:nth-child(2) {
    top: 9px;
}

.hamburger:nth-child(3) {
    top: 18px;
}

/* Off-canvas menu styles */
.off-canvas {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100dvh;
    background-color: #333;
    transition: left 0.3s ease-in-out;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.off-canvas.active {
    left: 0;
}

.off-canvas-header {
    background-color: #444;
    padding: 1rem;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.off-canvas-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Close button styles */
.off-canvas-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.8) rotate(-90deg);
    animation: closeButtonEntrance 0.5s ease-out 0.2s forwards;
}

/* Close button entrance animation */
@keyframes closeButtonEntrance {
    0% {
        opacity: 0;
        transform: scale(0.8) rotate(-90deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Close button exit animation */
.off-canvas-close.exit {
    animation: closeButtonExit 0.3s ease-in forwards;
}

@keyframes closeButtonExit {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) rotate(90deg);
    }
}

.off-canvas-close:hover {
    transform: scale(1.1);
}

.off-canvas-close:active {
    transform: scale(0.95);
}

/* Close button icon animation */
.off-canvas-close::before,
.off-canvas-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: white;
    transition: all 0.3s ease;
}

.off-canvas-close::before {
    transform: rotate(45deg);
}

.off-canvas-close::after {
    transform: rotate(-45deg);
}

.off-canvas-close:hover::before {
    transform: rotate(225deg);
}

.off-canvas-close:hover::after {
    transform: rotate(135deg);
}

/* Off-canvas menu list styles */
.off-canvas ul {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.off-canvas li {
    margin: 0;
    border-bottom: 1px solid #444;
    width: 100% !important;
    display: block;
    position: relative;
}

.off-canvas li:last-child {
    border-bottom: none;
}

.off-canvas a {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    padding: 1rem;
    display: block;
    position: relative;
    width: 100% !important;
    margin: 0 !important;
    border-radius: 0;
    box-sizing: border-box;
}

.off-canvas a:hover {
    color: #ddd !important;
    background-color: transparent !important;
    width: 100% !important;
    margin: 0 !important;
    left: 0;
}

/* Off-canvas sub-menu styles */
.off-canvas .sub-menu {
    background-color: transparent;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    list-style: none;
    margin: 0;
    padding: 0;
}

.off-canvas .sub-menu.active {
    max-height: 500px; /* Adjust based on your needs */
}

.off-canvas .sub-menu a {
    padding-left: 2rem;
    font-size: 1rem;
    border-bottom: 1px solid #3a3a3a;
    width: 100%;
    margin: 0;
    border-radius: 0;
}

.off-canvas .sub-menu .sub-menu a {
    padding-left: 3rem;
    font-size: 0.95rem;
    width: 100%;
    margin: 0;
    border-radius: 0;
}

/* Sub-menu toggle button for off-canvas */
.off-canvas .menu-item-has-children > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.off-canvas .sub-menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.5rem;
    margin: 0;
    transition: transform 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.off-canvas .sub-menu-toggle:hover {
    color: #ff6b6b;
    transform: scale(1.1);
}

.off-canvas .sub-menu-toggle.active {
    transform: rotate(90deg);
}

/* Style for the active menu item in both menus */
.nav-menu .current-menu-item > a,
.off-canvas .current-menu-item > a {
    color: #ff6b6b;
}

/* Remove padding from specific main menu */
#menu-main-menu-1.menu {
    padding-left: 0;
    padding-right: 0;
}

.off-canvas .cta-button {
    display: block;
    margin: auto 0 0; /* Pushes to bottom, removes side/bottom margin */
    text-align: center; /* This centers the text within the full-width button */
    border-radius: 0; /* Remove rounded corners to be flush with the container */
    padding: 1rem; /* Increase padding for a better look and feel */
    flex-shrink: 0;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1001;
}

.overlay.active {
    display: block;
}

/* Responsive design for mobile only */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .navbar .cta-button {
        display: none;
    }

    .off-canvas {
        width: 250px;
        left: -250px;
    }

    .off-canvas.active {
        left: 0;
    }
}

@media (max-width: 576px) {
    .off-canvas {
        width: 100%;
        left: -100%;
    }

    .off-canvas.active {
        left: 0;
    }
}

/* Responsive padding for offcanvas header and menu items */
@media (max-width: 768px) {
    .off-canvas-header {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .off-canvas a {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .off-canvas .sub-menu a,
    .off-canvas .sub-menu .sub-menu a {
        padding-left: 25px;
        padding-right: 20px;
    }
}

@media (max-width: 576px) {
    .off-canvas-header {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .off-canvas a {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .off-canvas .sub-menu a,
    .off-canvas .sub-menu .sub-menu a {
        padding-left: 20px;
        padding-right: 15px;
    }
}

/* Touch-friendly improvements for mobile */
@media (hover: none) and (pointer: coarse) {
    .nav-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background-color: transparent;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .nav-menu li:hover > .sub-menu {
        max-height: 500px;
    }
    
    .nav-menu .sub-menu a {
        padding-left: 2rem;
        color: #666;
    }
    
    .nav-menu .sub-menu a:hover {
        background-color: transparent;
        padding-left: 2rem;
    }
}

/* Active parent state for horizontal navigation */
.nav-menu .menu-item-has-children.active-parent > a {
    color: #ff6b6b;
    font-weight: 600;
}

.nav-menu .menu-item-has-children.active-parent > a::after {
    color: #ff6b6b;
}

/* Active parent state for off-canvas navigation */
.off-canvas .menu-item-has-children.active-parent > a {
    color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.1);
    position: relative;
}

.off-canvas .menu-item-has-children.active-parent > a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #ff6b6b;
}

/* Touch-friendly improvements for mobile devices */
@media (max-width: 768px) {
    .nav-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: transparent;
        padding-left: 20px;
        max-height: none;
        overflow: visible;
    }
    
    .nav-menu .sub-menu li {
        display: block;
        margin: 0;
        padding: 0;
    }
    
    .nav-menu .sub-menu a {
        padding: 8px 15px;
        border: none;
        background: transparent;
        color: inherit;
    }
    
    .nav-menu .sub-menu a:hover {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Admin Settings Page Styles */
.ml-suite-admin .wrap {
    max-width: 1200px;
}

.ml-suite-admin .nav-tab-wrapper {
    margin-bottom: 0;
    border-bottom: 1px solid #c3c4c7;
}

.ml-suite-admin .nav-tab {
    text-decoration: none;
    transition: all 0.2s ease;
}

.ml-suite-admin .nav-tab:hover {
    background-color: #f0f0f1;
    border-color: #8c8f94;
}

.ml-suite-admin .nav-tab-active {
    background: #fff;
    border-bottom: 1px solid #fff;
    color: #000;
    font-weight: 600;
}

.ml-suite-admin .tab-content {
    margin-top: 20px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-top: none;
    padding: 20px;
}

.ml-suite-admin .tab-pane {
    display: none;
}

.ml-suite-admin .tab-pane.active {
    display: block;
}

.ml-suite-admin .ml-suite-settings-section {
    margin-top: 0;
}

.ml-suite-admin .ml-suite-settings-section h2 {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #c3c4c7;
    color: #1d2327;
}

.ml-suite-admin .ml-suite-settings-section p {
    margin-bottom: 20px;
    color: #646970;
}

.ml-suite-admin .form-table th {
    width: 200px;
    padding: 20px 10px 20px 0;
}

.ml-suite-admin .form-table td {
    padding: 15px 10px;
}

.ml-suite-admin .form-table input[type="text"],
.ml-suite-admin .form-table input[type="number"],
.ml-suite-admin .form-table select,
.ml-suite-admin .form-table textarea {
    width: 100%;
    max-width: 400px;
}

.ml-suite-admin .form-table textarea {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.4;
}

.ml-suite-admin .description {
    color: #646970;
    font-style: italic;
    margin-top: 5px;
}

.ml-suite-admin code {
    background: #f6f7f7;
    padding: 3px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Responsive admin styles */
@media (max-width: 782px) {
    .ml-suite-admin .form-table th,
    .ml-suite-admin .form-table td {
        display: block;
        width: 100%;
        padding: 10px 0;
    }
    
    .ml-suite-admin .form-table th {
        border-bottom: none;
        padding-bottom: 5px;
    }
    
    .ml-suite-admin .form-table td {
        padding-top: 0;
    }
    
    .ml-suite-admin .nav-tab-wrapper {
        display: flex;
        flex-direction: column;
    }
    
    .ml-suite-admin .nav-tab {
        margin-bottom: 5px;
        text-align: center;
    }
}
