/* assets/css/default/header.css */

/* --- Default Header (Sticky & Responsive) --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: transparent;
    border-bottom: 1px solid transparent;
    padding: 0.5rem 0;
    z-index: 1000;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.header.header-scrolled {
    background: var(--color-surface);
    border-color: var(--color-border);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4.5rem;
}

/* Brand Logo and Name */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}
.nav-logo img {
    height: 50px;
}
.brand-name {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    white-space: nowrap;
    letter-spacing: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Desktop Navigation Menu */
.nav-right-side {
    display: flex;
    align-items: center; /* Ito ang nagpapantay sa items */
    gap: 1.5rem;
}
.nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 2.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    position: relative;
    font-weight: 500;
    color: var(--color-text);
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}
.nav-link i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

/* --- FIX: Updated Button Styles (Key Shape) --- */
.btn {
    display: inline-flex;
    align-items: stretch;
    height: 45px; /* Pinaliit nang konti for header/sidebar */
    text-decoration: none;
    filter: drop-shadow(0 4px 8px rgba(0, 150, 255, 0.2));
    transition: transform 0.2s ease, filter 0.2s ease;
    padding: 0;
    border-radius: 0;
    background: none;
    transform: none;
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-2px);
    filter: drop-shadow(0 6px 15px rgba(0, 150, 255, 0.35));
    /* Resetting unnecessary inherited styles */
    color: inherit;
    box-shadow: none;
}

.btn-icon {
    width: 45px; /* Match the height */
    height: 100%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    display: grid;
    place-items: center;
    font-size: 1.5rem; /* Pinaliit ang icon */
    color: var(--color-white);
    clip-path: polygon(0% 0%, 80% 0%, 100% 50%, 80% 100%, 0% 100%);
    padding-right: 9px; /* Adjusted icon padding */
}

.btn-text {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    padding: 0 1.2rem 0 0.8rem; /* Adjusted padding */
    margin-left: -9px; /* Overlap (20% of 45px) */
    display: grid;
    place-items: center;
    font-size: 0.85rem; /* Pinaliit ang text */
    font-weight: 600;
    color: var(--color-white);
    transform: skewX(-15deg);
    border-radius: 0 4px 4px 0;
    white-space: nowrap;
    font-style: normal; /* Siguraduhing hindi italic ang container */
}

/* --- FIX: Target the inner span to unskew the text --- */
.btn-text span {
    display: inline-block;
    transform: skewX(15deg); /* Ito yung nagpapa-straight sa text */
    font-style: normal; /* Siguraduhing hindi italic ang text */
}
/* --- END OF FIX --- */

/* Hindi na kailangan ng extra span, diretso na sa .btn-text */
/* --- END OF FIX --- */

/* Theme Toggle Animation */
.theme-toggle {
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    width: 24px;
    height: 24px;
    top: -8px;
}

.theme-toggle i {
    position: absolute;
    transition: transform 0.4s ease, opacity 0.4s ease;
}
.theme-toggle .ri-sun-line {
    transform: scale(0) rotate(-90deg);
    opacity: 0;
}
[data-theme="dark"] .theme-toggle .ri-moon-line {
    transform: scale(0) rotate(90deg);
    opacity: 0;
}
[data-theme="dark"] .theme-toggle .ri-sun-line {
    transform: scale(1) rotate(0deg);
    opacity: 1;
}

/* Desktop Dropdown Menu */
.dropdown {
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: -1rem;
}
.dropdown:hover .nav-link i {
    transform: rotate(180deg);
}
.dropdown-menu {
    position: absolute;
    top: 150%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: .5rem;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, top 0.3s, visibility 0.3s;
    min-width: 280px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    list-style-type: none;
}
.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    top: 100%;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    color: var(--color-text);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.dropdown-link:hover {
    color: var(--color-primary);
    background-color: rgba(255, 255, 255, 0.07);
}
.dropdown-link i {
    font-size: 1.2rem;
    color: var(--color-primary);
}

/* --- Mobile Navigation & Sidebar --- */

.nav-toggle {
    display: none;
    position: fixed;
    top: calc(2.75rem - 10.5px);
    right: 1.5rem;
    width: 25px;
    height: 21px;
    z-index: 1100;
    cursor: pointer;
}

.sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: clamp(280px, 80vw, 320px);
    /* === ITO YUNG BINAGO PARA SA MOBILE VIEWPORT === */
    height: 100svh; /* Dati: 100vh */
    /* === END NG BINAGO === */
    background: var(--color-surface);
    z-index: 1050;
    transition: right 0.4s ease-in-out;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    border-left: 1px solid var(--color-border);
    /* === ITO YUNG BINAGO === */
    overflow: hidden; /* Dati: overflow-x: hidden; */
}
.sidebar.is-active {
    right: 0;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
}

.sidebar .sidebar-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 2rem;
    height: 4.5rem;
    padding: 0 0.5rem;
    padding-right: 4rem;
}
.sidebar-header .nav-logo img {
    height: 35px;
}

.sidebar-header .brand-name {
    font-size: 1.0rem;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}
.sidebar-header .nav-logo {
    gap: 0.5rem;
}

.sidebar-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-grow: 1;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.sidebar-nav-list .nav-link {
    font-size: 1.1rem;
    gap: 0.5rem;
    padding-bottom: 0;
    color: var(--color-text);
    display: flex;
    align-items: center;
}
.sidebar-nav-list .nav-link span {
    white-space: normal;
    word-break: break-word;
    min-width: 0;
}

.sidebar-nav-list .nav-link:after {
    display: none;
}
.sidebar-nav-list .nav-link i {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.sidebar-details summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    list-style: none;
    color: var(--color-text);
    gap: 0.5rem;
}
.sidebar-details summary > span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}
.sidebar-details summary > span > span {
    white-space: normal;
    word-break: break-word;
}

.sidebar-details summary::-webkit-details-marker {
  display: none;
}
.sidebar-details summary i {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}
.sidebar-details[open] > summary i {
    transform: rotate(90deg);
}

.sidebar-dropdown-list {
    list-style: none;
    padding: 0 0 0 1.25rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.5s ease-in-out, margin-top 0.5s ease-in-out;
}
.sidebar-details[open] .sidebar-dropdown-list {
    max-height: 400px;
    margin-top: 0.75rem;
}

.sidebar-dropdown-list .dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text);
    font-size: 0.95rem;
    opacity: 0;
    transform: translateX(-15px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    white-space: normal;
    word-break: break-word;
    min-width: 0;
}
.sidebar-dropdown-list .dropdown-link i {
    font-size: 1.1rem;
    color: var(--color-primary);
    flex-shrink: 0;
}

.sidebar-details[open] .sidebar-dropdown-list .dropdown-link {
    opacity: 1;
    transform: translateX(0);
}
.sidebar-details[open] .sidebar-dropdown-list li:nth-child(1) .dropdown-link { transition-delay: 0.05s; }
.sidebar-details[open] .sidebar-dropdown-list li:nth-child(2) .dropdown-link { transition-delay: 0.1s; }
.sidebar-details[open] .sidebar-dropdown-list li:nth-child(3) .dropdown-link { transition-delay: 0.15s; }
.sidebar-details[open] .sidebar-dropdown-list li:nth-child(4) .dropdown-link { transition-delay: 0.2s; }
.sidebar-details[open] .sidebar-dropdown-list li:nth-child(5) .dropdown-link { transition-delay: 0.25s; }
.sidebar-details[open] .sidebar-dropdown-list li:nth-child(6) .dropdown-link { transition-delay: 0.3s; }
.sidebar-details[open] .sidebar-dropdown-list li:nth-child(7) .dropdown-link { transition-delay: 0.35s; }


.sidebar .sidebar-footer {
    padding-top: 1.5rem;
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--color-border);
}

/* Hamburger to 'X' Animation */
.nav-toggle span {
    display: block;
    position: absolute;
    width: 100%;
    height: 3px;
    background-color: var(--color-text);
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}
.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 9px; }
.nav-toggle span:nth-child(3) { top: 18px; }

.nav-toggle.is-active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.nav-toggle.is-active span:nth-child(2) {
    opacity: 0;
}
.nav-toggle.is-active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* --- MOBILE VIEW --- */
@media screen and (max-width: 1024px) {
    .nav-right-side .nav-menu,
    .nav-right-side .contact-btn {
        display: none;
    }
    .nav-toggle {
        display: block;
    }
    .header .theme-toggle {
        display: none;
    }

    .header .nav-logo {
        gap: 0.5rem;
    }
    .header .nav-logo img {
        height: 40px;
    }
    .header .brand-name {
        font-size: 1.25rem;
        letter-spacing: 1px;
    }
}

/* --- Desktop View --- */
@media screen and (min-width: 1025px) {
    .sidebar {
        display: none;
        right: -100%;
    }
    .nav-toggle {
        display: none;
    }
}