/*
Theme Name: HAI Theme 01
Theme URI: https://hlaw.legal/
Author: HAI
Author URI: https://hlaw.legal/
Description: Custom theme for HAI
Version: 1.0.5
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hai-theme-01
*/

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-1: #e67e22;
    --color-2: #e8c39e;
    --color-3: #e8c39e;
    --text-color-1: #ffffff;
    --text-color-2: #ffffff;
    --text-color-3: #333333;
    --header-height: 120px;
    --page-background-color: #f5f5f5;
    --page-text-color: #333333;
}

/* Basic Layout */
html {
    height: 100%;
}

body {
    min-height: 100%;
    background-color: var(--page-background-color) !important;
    color: var(--page-text-color) !important;
    line-height: 1.6;
    position: relative;
    background-image: none !important;  
}

body::before {
    display: none !important;  
}

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: -1;
    overflow: hidden;
    background-color: transparent;
}

.background-container::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 900px;
    max-width: 100%;
    max-height: 100vh;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    pointer-events: none;
    transform: translateZ(0);
    will-change: transform;
    object-fit: cover;
    filter: blur(0);
}

body, body::before {
    background: none !important;
}

#page {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.top-header {
    background: linear-gradient(to right, var(--color-1), var(--color-2));
    color: var(--text-color-1);
    padding: 5px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 5px;
    background-color: var(--color-3);
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-logo {
    max-height: 60px;
    width: auto;
}

.main-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0rem 2rem;
    background: transparent;
    box-shadow: none;
}

.menu-wrapper {
    flex-grow: 1;
    margin: 0 2rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1rem;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: #4a5568;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.nav-menu a:hover,
.nav-menu a:focus,
.nav-menu .current-menu-item > a {
    color: #2b6cb0;
}

/* Tab line effect for desktop */
.nav-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #2b6cb0;
    transition: width 0.3s ease;
}

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

/* User Menu Styles */
.user-menu-wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.login-button {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.5rem;
    background: #ed8936;
    color: white;
    border-radius: 0.375rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.login-button:hover {
    background: #dd6b20;
    color: white;
}

.login-button .dashicons {
    margin-right: 0.5rem;
}

.user-menu {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    color: #4a5568;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-menu-toggle:hover {
    background: #edf2f7;
}

.user-menu-toggle .dashicons {
    margin-right: 0.5rem;
}

.user-dropdown {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 99999;
    min-width: 200px;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    border-radius: 0.375rem;
    margin: 0.5rem 0 0;
    padding: 0.5rem;
    transition: all 0.3s ease;
    transform: translateY(10px);
}

.user-menu:hover .user-dropdown {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.user-info {
    padding: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 0.5rem;
}

.role-label {
    display: block;
    font-size: 0.875rem;
    color: #718096;
}

.logout-button {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    color: #e53e3e;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0.25rem;
}

.logout-button:hover {
    background: #fff5f5;
    color: #c53030;
}

.logout-button .dashicons {
    margin-right: 0.5rem;
}

/* Submenu Styles */
.nav-menu .sub-menu {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 99999;
    min-width: 200px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    border-radius: 0.375rem;
    margin: 0.5rem 0 0;
    padding: 0.25rem 0;
    transition: all 0.3s ease;
    transform: translateY(10px);
}

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

.nav-menu .sub-menu a {
    padding: 0.25rem 1.5rem;
    font-size: 0.875rem;
}

.nav-menu .sub-menu a:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    padding: 1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #4a5568;
}

.menu-toggle:hover {
    color: #2b6cb0;
}

/* Mobile Styles */
@media screen and (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .menu-wrapper {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        padding: 1rem;
        box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
        margin: 0;
    }

    .menu-wrapper.active {
        display: block;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0;
    }

    .nav-menu a {
        padding: 1rem;
        border-bottom: 1px solid #e2e8f0;
    }

    .nav-menu .sub-menu {
        position: static;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.05);
        padding-left: 1rem;
        display: none;
        visibility: visible;
        opacity: 1;
        transform: none;
    }

    .nav-menu .sub-menu.active {
        display: block;
    }

    .user-menu-wrap {
        margin-left: auto;
    }
}

/* Branding */
.site-branding {
    display: flex;
    align-items: center;
    gap: 20px;
}

.custom-logo-link {
    max-width: 200px;
}

.custom-logo {
    height: auto;
    max-width: 100%;
}

.site-title {
    margin: 0;
    font-size: 24px;
}

.site-title a {
    color: var(--text-color-3);
    text-decoration: none;
}

.site-description {
    margin: 5px 0 0;
    font-size: 14px;
    color: #666;
}

/* Contact Info */
.contact-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.contact-info span,
.contact-info a {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-color-1);
    text-decoration: none;
}

.map-link {
    transition: opacity 0.3s ease;
}

.map-link:hover {
    opacity: 0.8;
}

.contact-info .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

@media (max-width: 768px) {
    .contact-info {
        flex-direction: column;
        gap: 10px;
    }
}

/* Login Button Styles */
.login-button {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    margin-left: 15px;
    background-color: var(--color-1);
    color: var(--text-color-1);
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    font-size: var(--menu-items-font-size, 14px);
}

.login-button:hover {
    background-color: var(--color-2);
    color: var(--text-color-1);
}

.login-button .dashicons {
    margin-right: 5px;
    font-size: inherit;
    width: auto;
    height: auto;
    line-height: 1;
}

@media (max-width: 768px) {
    .login-button {
        margin: 10px 0;
        text-align: center;
        justify-content: center;
    }
}

.welcome-message {
    display: inline-flex;
    align-items: center;
    margin-left: 15px;
    color: var(--text-color-3);
    font-size: var(--top-header-font-size, 14px);
}

.welcome-message .dashicons {
    margin-right: 5px;
    font-size: var(--top-header-font-size, 14px);
    width: auto;
    height: auto;
}

.login-link {
    display: inline-flex;
    align-items: center;
    margin-left: 15px;
    color: var(--text-color-3);
    text-decoration: none;
    font-size: var(--top-header-font-size, 14px);
    transition: color 0.3s ease;
}

.login-link:hover {
    color: var(--color-2);
}

.login-link .dashicons {
    margin-right: 5px;
    font-size: var(--top-header-font-size, 14px);
    width: auto;
    height: auto;
    line-height: 1;
}

/* User Menu Styles */
.user-menu-wrap {
    position: relative;
}

.user-menu {
    position: relative;
}

.user-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: var(--color-1);
    color: var(--text-color-1);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-menu-toggle:hover {
    background: var(--color-2);
}

.user-menu-toggle .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: 4px;
    padding: 10px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    visibility: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-top: 5px;
}

.user-menu.active .user-dropdown {
    display: block;
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.user-info {
    padding: 5px 10px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    margin-bottom: 5px;
}

.role-label {
    font-size: 0.9em;
    color: #666;
}

.logout-button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 10px;
    color: #dc3545;
    text-decoration: none;
    transition: background 0.3s ease;
    border-radius: 4px;
}

.logout-button:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #c53030;
}

/* Mobile Styles */
@media screen and (max-width: 768px) {
    .user-menu-toggle .user-name {
        display: none;
    }

    .user-menu-toggle {
        padding: 5px 10px;
    }

    .user-dropdown {
        right: -10px;
        min-width: 180px;
    }

    .logout-button {
        padding: 5px 10px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .top-header, .main-header {
        flex-direction: column;
        text-align: center;
    }
}

/* Responsive */
@media screen and (max-width: 768px) {
    :root {
        --header-height: 150px;
    }

    .site-content {
        padding: 0;
    }

    .site-content-wrapper {
        margin: 0;
        border-radius: 0;
    }
    
    .main-header {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .nav-menu {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-menu li {
        margin: 5px 0;
    }

    .contact-info {
        flex-direction: column;
        gap: 10px;
    }

    .entry-title {
        font-size: 24px;
    }

    .entry-wrapper {
        padding: 20px;
    }
}

@media screen and (max-width: 768px) {
    .site-content {
        margin-top: 100px;
    }
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    /* Top Header Mobile */
    .top-header {
        height: 40px;
        padding: 0;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .top-header::-webkit-scrollbar {
        display: none;
    }

    .top-header .contact-info {
        display: inline-flex;
        align-items: center;
        padding: 0 15px;
        font-size: 14px;
    }

    .top-header .contact-info span {
        margin-right: 15px;
    }

    /* Main Header Mobile */
    .main-header {
        height: 60px;
        padding: 5px 5px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .site-branding {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .custom-logo {
        max-height: 40px;
        width: auto;
    }

    .site-title {
        font-size: 16px;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .site-title a {
        color: var(--text-color-3);
        text-decoration: none;
    }

    .site-description {
        display: none;
    }

    /* Menu Toggle Button */
    .menu-toggle {
        padding: 5px;
        margin-left: auto;
    }

    /* Adjust content spacing */
    .site-content {
        margin-top: 100px; /* Combined height of both headers */
    }
}

@media screen and (max-width: 768px) {
    .top-header {
        height: 40px;
        padding: 0;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .top-header::-webkit-scrollbar {
        display: none;
    }

    .top-header .contact-info {
        display: inline-flex;
        align-items: center;
        padding: 0 15px;
        font-size: 14px;
    }

    .main-header {
        height: 60px;
        padding: 5px 10px;
    }

    .site-branding {
        flex: 0 1 auto;
        min-width: 0;
    }

    .custom-logo {
        max-height: 40px;
    }

    .site-title {
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .main-navigation {
        flex: 0 0 auto;
    }

    .menu-toggle {
        padding: 5px;
        background: none;
        border: none;
        color: var(--text-color-3);
        cursor: pointer;
    }

    .login-button {
        padding: 5px 10px;
        font-size: 14px;
    }

    .login-button .button-text {
        display: none;
    }

    .menu-wrapper {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        padding: 2px;
        display: none;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    .menu-wrapper.active {
        display: block;
    }

    .nav-menu {
        flex-direction: column;
    }

    .nav-menu .sub-menu {
        position: static;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.05);
        padding-left: 20px;
        display: none;
        visibility: visible;
        opacity: 1;
        transform: none;
    }

    .nav-menu .menu-item-has-children.active > .sub-menu {
        display: block;
    }
}

/* Login Modal Styles */
.login-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.login-modal-content {
    background-color: #fff;
    margin: 10vh auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.close-modal {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 24px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #000;
}

.login-modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.modal-logo {
    max-width: 200px;
    height: auto;
    margin: 0 auto;
}

.login-modal-body form {
    padding: 0;
    margin: 0;
    box-shadow: none;
}

.login-modal-body p {
    margin-bottom: 15px;
}

.login-modal-body label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-size: 14px;
}

.login-modal-body .input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.login-modal-body .input:focus {
    border-color: var(--color-1);
    outline: none;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.login-modal-body .button-primary {
    width: 100%;
    padding: 10px;
    background: var(--color-1);
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.login-modal-body .button-primary:hover {
    background: var(--color-2);
}

@media (max-width: 768px) {
    .login-modal-content {
        width: 95%;
        margin: 5vh auto;
    }
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Main Content */
.site-content {
    flex: 1;
    margin-top: var(--header-height);
    width: 100%;
    position: relative;
    z-index: 1;
    padding: 0;
}

.site-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    background: transparent;
    overflow: hidden;
}

.site-main {
    width: 100%;
}

/* Page Content */
.page-content-top {
    width: 100%;
    background: transparent;
}

.entry-wrapper {
    padding: 10px;
}

.entry-title {
    text-align: center;
    margin: 10px 0;
    color: var(--color-1);
    font-size: 32px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.entry-content {
    line-height: 1.8;
    color: #333;
    background: transparent;
}

.entry-content p {
    margin-bottom: 1.5em;
    font-size: 16px;
}

/* Footer */
.site-footer {
    background: transparent !important;
    margin-top: auto !important;
    position: relative;
    z-index: 1;
}

.site-footer .top-footer {
    background-color: var(--color-3) !important;
    color: var(--text-color-3) !important;
    padding: 5px 0 !important;
    margin: 0 !important;
}

.site-footer .bottom-footer {
    background-color: var(--color-1) !important;
    color: var(--text-color-1) !important;
    padding: 5px 0 !important;
    margin: 0 !important;
}

.site-footer .footer-content {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 10px !important;
    text-align: center !important;
}

.site-footer .footer-content p,
.site-footer .disclaimer,
.site-footer .copyright {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    text-align: center !important;
}

/* Login Button */
.login-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: var(--color-1);
    color: var(--text-color-1);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.login-button:hover {
    background: var(--color-2);
}

/* Navigation remains transparent */
.main-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: transparent;
    box-shadow: none;
}
