/* ===========================
   Reset and Base Styles
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    font-family: Arial, sans-serif;
    background-color: #0000FF;
    -webkit-text-size-adjust: 90%;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===========================
   Typography
   =========================== */
h1, h2, h3, h4, p {
    font-family: Arial, sans-serif;
    color: yellow;
    margin: 0;
    padding: 0;
}

h1 { 
    font-size: 40px; 
    margin-bottom: 20px;
}

h2 { font-size: 20px; }
h3 { font-size: 14px; }
h4 { font-size: 11px; }
p { font-size: 14px; }

a {
    color: #000;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

a:hover {
    opacity: 0.8;
}

/* ===========================
   Top Menu Bar
   =========================== */
.top-menu {
    background: linear-gradient(to bottom, #adadad, #8f8f8f);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 101;
    border-bottom: 1px solid black;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.menu-icon {
    font-size: 30px;
    cursor: pointer;
    user-select: none;
    background: none;
    border: none;
    color: black;
    padding: 5px;
    transition: transform 0.3s ease;
}

.menu-icon:hover {
    transform: scale(1.1);
}

.menu-icon:active {
    transform: scale(0.95);
}

.logo-link {
    display: flex;
    align-items: center;
}

.company-logo {
    max-height: 40px;
    width: auto;
}

/* ===========================
   Side Navigation
   =========================== */
.side-nav {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 100;
    top: 0;
    background-color: #adadad;
    overflow-x: hidden;
    overflow-y: auto;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.side-nav.left { left: 0; }
.side-nav.right { right: 0; }

.side-nav.open {
    width: 250px;
}

.menu-content {
    padding-bottom: 20px;
    position: relative;
    z-index: 102;
}

.close-btn {
    position: absolute;
    top: 40px;
    right: 5px;
    font-size: 45px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 15px;
    color: black;
    transition: transform 0.3s ease;
    z-index: 105;
    pointer-events: all;
}

.close-btn:hover {
    transform: rotate(90deg);
    color: #333;
}

/* ===========================
   Expandable Menu Styles
   =========================== */
.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    padding-top: 80px;
}

.category-item {
    position: relative;
}

.category-toggle {
    width: 100%;
    text-align: left;
    padding: 10px 0 10px 32px;
    cursor: pointer;
    font-size: 25px;
    color: black;
    font-family: 'Goudy Old Style', 'Garamond', 'Baskerville', 'Times New Roman', serif;
    transition: background-color 0.3s ease, padding-left 0.3s ease;
    border: none;
    background: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-toggle::after {
    content: '+';
    font-size: 20px;
    margin-right: 20px;
    transition: transform 0.3s ease;
}

.category-toggle.expanded::after {
    transform: rotate(45deg);
}

.category-toggle:hover {
    background-color: rgba(0, 0, 0, 0.1);
    padding-left: 40px;
}

a.menu-item {
    display: block;
    padding: 10px 0 10px 32px;
    cursor: pointer;
    font-size: 25px;
    color: black;
    font-family: 'Goudy Old Style', 'Garamond', 'Baskerville', 'Times New Roman', serif;
    transition: background-color 0.3s ease, padding-left 0.3s ease;
}

a.menu-item:hover {
    background-color: rgba(0, 0, 0, 0.1);
    padding-left: 40px;
}

a.menu-item:active {
    background-color: rgba(0, 0, 0, 0.2);
}

/* Submenu List */
.submenu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.submenu-list.expanded {
    max-height: 1000px;
    transition: max-height 0.5s ease-in;
}

.submenu-list.collapsed {
    max-height: 0;
}

.submenu-item-wrapper {
    display: block;
}

.submenu-item {
    display: block;
    padding: 8px 8px 8px 48px;
    font-size: 20px;
    color: black;
    transition: all 0.3s ease;
    font-family: 'Goudy Old Style', 'Garamond', 'Baskerville', 'Times New Roman', serif;
    position: relative;
}

.submenu-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
    padding-left: 56px;
}

.submenu-item.highlight {
    color: yellow;
    font-size: 25px;
    font-weight: bold;
}

.menu-separator {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.2);
    margin: 10px 32px;
    padding: 0;
    height: 1px;
}

.submenu-list li {
    opacity: 1;
    transform: translateY(0);
}

.submenu-list.collapsed li {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.submenu-list.expanded li {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
}

/* Prevent menu closing on interaction */
.side-nav * {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* ===========================
   Page Content
   =========================== */
.page-container {
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding-top: 60px;
    padding-bottom: 20px;
}

.page-content {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    text-align: center;
}

/* ===========================
   Search Buttons
   =========================== */
.search-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.search-button {
    background: linear-gradient(145deg, #bbbbbb, #999999);
    border: none;
    width: 240px;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Goudy Old Style', 'Garamond', 'Baskerville', 'Times New Roman', serif;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    background: linear-gradient(145deg, #cccccc, #aaaaaa);
}

.search-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.search-button.main-category {
    color: yellow;
    font-size: 25px;
}

.search-button.subcategory {
    color: black;
    font-size: 20px;
    width: 200px;
    margin: 5px auto; /* CENTERED across all screens */
}

/* Arrow indicator */
.search-button::after {
    content: '';
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid white;
    margin-left: 10px;
}

.search-button.no-arrow::after {
    display: none;
}

/* Subcategory container */
.subcategory-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;

    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.subcategory-container.open {
    max-height: 300px;
}

/* ===========================
   Footer
   =========================== */
.footer {
    background-color: rgba(173, 173, 173, 0.9);
    text-align: center;
    padding: 10px;
    margin-top: 50px;
    color: black;
    border-top: 1px solid black;
}

/* ===========================
   Loading State
   =========================== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
    h1 { font-size: 32px; }

    .search-button {
        width: 90%;
        max-width: 240px;
    }

    .search-button.subcategory {
        width: 85%;
        max-width: 200px;
        margin: 5px auto; /* maintain centering */
    }

    .side-nav.open {
        width: 80%;
        max-width: 250px;
    }

    .category-toggle {
        font-size: 22px;
    }

    .submenu-item {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .top-menu {
        padding: 0 10px;
    }

    .menu-icon {
        font-size: 26px;
    }

    h1 {
        font-size: 28px;
    }

    .search-button.main-category {
        font-size: 20px;
    }

    .search-button.subcategory {
        font-size: 16px;
        margin: 5px auto;
    }
}

/* ===========================
   Accessibility
   =========================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid yellow;
    outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
    outline: none;
}

@media (prefers-contrast: high) {
    .search-button {
        border: 2px solid black;
    }

    .top-menu {
        border-bottom: 2px solid black;
    }
}


/* =======================================
   FLoating Left and Right Floating Boxes
   ======================================= */
/* Shared styles for both boxes */
.floating-box {
    width: 220px;
    height: 450px;
    background-color: #0000FF;
    position: fixed;
    top: 100px;
    z-index: 1000;
    border-radius: 10px;
    padding: 20px;
    color: white;
    font-family: 'Arial', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    z-index: 10;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid rgba(0, 0, 0, 0.2);
}

/* Specific styling for the right box */
.right-box {
    right: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: -20px 20px 15px rgba(0, 0, 0, 0.5); /* Custom shadow for right box */
}

/* Specific styling for the left box */
.left-box {
    left: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: 20px 20px 15px rgba(0, 0, 0, 0.4); /* Custom shadow for left box */
}


@media (max-width: 1023px) {
    .floating-box {
    display: none;
    }
}