/* MySpace 2009 header and navbar styling */
body {
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;
}

body.noscroll {
    overflow: hidden !important;
}

.myspace-header {
    position: relative; /* Creates stacking context */
    z-index: 100; /* Lowered further to ensure modals (typically 1000+) overlay header */
    width: 100%;
    max-width: 990px;
    color: white;
    padding: 0;
    margin: 0 auto;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    line-height: 0;
}

/* Top blue gradient bar with logo and elements */
.myspace-header .top-nav {
    background: #003399; /* Fallback */
    background: linear-gradient(to bottom, #3066cc 0%, #1e4390 100%);
    height: 100px;
    display: flex;
    justify-content: space-between;
    padding: 0;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    margin-bottom: 0;
    border-bottom: 1px solid #1e4390;
    position: relative;
    overflow: hidden;
}

/* Ensure header content sits above the visualizer canvas */
.myspace-header .top-nav .left,
.myspace-header .top-nav .right {
    position: relative;
    z-index: 1;
}

/* Left section with logo */
.myspace-header .left {
    height: 100%;
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.myspace-header .site-name {
    display: flex;
    align-items: center;
    height: 100%;
    text-decoration: none;
}

.myspace-header .nav-logo {
    height: 45px; /* Further reduced from 30px */
    width: auto;
    margin: 0 10px; /* Maintain spacing around the logo */
    position: relative;
    top: 2px; /* Fine-tune vertical alignment */
}

/* Right section with search */
.myspace-header .right {
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: flex-end;
}

/* Search box */
.myspace-header .search-box {
    display: flex;
    align-items: center;
    height: 22px;
    margin: 0 20px 0 0;
    white-space: nowrap; /* Prevent wrapping of form elements */
}

.myspace-header .search-input {
    width: 150px;
    height: 22px;
    box-sizing: border-box;
    border: 2px solid #0046ad;
    border-right: none;
    border-radius: 4px 0 0 4px;
    padding: 0 5px;
    font-size: 11px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    vertical-align: middle;
    max-width: 100%; /* Ensure input doesn't overflow container */
}

.myspace-header .search-button {
  background: linear-gradient(to bottom, #ffffff 0%, #e4e4e4 100%);
  color: #0046ad;
  border: 2px solid #0046ad;
  border-left: none;
  border-radius: 0 4px 4px 0;
  font-weight: bold;
  cursor: pointer;
  text-shadow: 0 1px 0 #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  line-height: 18px;
  height: 22px;
  padding: 0 10px;
  margin: 0;
  display: inline-block;
  font-size: 11px;
  vertical-align: middle;
}

.myspace-header .search-button:hover {
  background: linear-gradient(to bottom, #e4e4e4 0%, #ffffff 100%);
}

/* Main Navigation Bar with button-style links */
.myspace-header .main-nav-wrapper {
    background: #0046a6;
    background: linear-gradient(to bottom, #1e4390 0%, #0a2a78 100%);
    height: 29px;
    width: 100%;
    border-top: 1px solid #5588bb;
    border-bottom: 1px solid #0f2f7d;
    clear: both;
    position: relative;
    top: -1px;
    z-index: 2;
    margin-top: 0;
    padding-top: 0;
}

.myspace-header .main-nav-container {
    width: 990px;
    margin: 0 auto;
    height: 100%;
    padding: 0;
    display: flex;
    justify-content: flex-start;
    position: relative;
    z-index: 1;
}

.myspace-header .main-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    height: 100%;
}

.myspace-header .main-nav li {
    display: inline-block;
    padding: 0;
    height: 100%;
    position: relative;
    margin-right: 0;
}

.myspace-header .main-nav li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 11px;
    display: inline-block;
    padding: 0 15px;
    height: 29px;
    line-height: 29px;
    border-right: 1px solid #002a6e;
    text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.5);
}

.myspace-header .main-nav li:first-child a {
    padding-left: 10px;
    margin-left: 0;
}

.myspace-header .main-nav li a:hover {
    background-color: #0033a7;
}

.myspace-header .main-nav li a.active {
    background-color: #0033a7;
}

/* Dropdown Menu Styles - Authentic MySpace 2009 */
.myspace-header .dropdown {
    position: relative;
    display: inline-block;
    height: 29px;
}

/* .myspace-header .dropdown:hover .dropdown-menu { display: block; } */ /* Removed to rely on JS click toggle */

/* Ensure the entire dropdown list item, not just the menu, is on the highest layer */
.myspace-header .dropdown {
    position: relative; /* establishes stacking context for the dropdown as a whole */
    z-index: 101; /* Keep dropdown above header but below modals */
}


.myspace-header .dropdown-menu.js-dropdown-open {
    display: block !important; /* Use !important to ensure JS toggle takes precedence */
}

.myspace-header .dropdown-toggle {
    cursor: pointer;
}

.myspace-header .dropdown-menu {
    position: absolute;
    display: none; /* Default hidden, JS toggles with .js-dropdown-open */
    top: 29px; /* Match the height of the nav items */
    right: 0; /* Align to right edge of More button */
    background: #f7f7f7; /* Very very light gray */
    width: 150px;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 200;
    border: 1px solid #666666;
    border-top: none;
    padding: 0;
    margin-top: 0;
    color: #003399;
    font-family: Arial, Helvetica, sans-serif;
    text-align: left;
    font-size: 11px;
    box-sizing: content-box;
    border-radius: 0;
}

/* Dropdown header removed */

.myspace-header .dropdown-menu a {
    color: #0046ad !important; 
    text-decoration: none;
    font-size: 11px;
    font-weight: normal;
    display: block;
    padding: 6px 8px;
    height: auto;
    width: 100%;
    line-height: normal;
    box-sizing: border-box;
    text-align: left;
    border-bottom: 1px solid #eeeeee;
    background: transparent;
}

.myspace-header .dropdown-menu a:last-child {
    border-bottom: none;
}

/* Force white text on dropdown hover with maximum specificity */
.myspace-header .dropdown-menu a:hover,
.myspace-header .dropdown-menu a:active,
.myspace-header .dropdown-menu a:focus {
    color: #ffffff !important;
    background: #0033a7 !important;
    text-decoration: none !important;
}

/* Additional ultra-specific rule to override any global styles */
body .myspace-header .dropdown-menu a:hover,
body .myspace-header .dropdown-menu a:active,
body .myspace-header .dropdown-menu a:focus {
    color: #ffffff !important;
    background: #0033a7 !important;
    text-decoration: none !important;
}

/* Show class for the dropdown when activated */
.myspace-header .dropdown-menu.show { 
    display: block;
}

/* Force intended gradient and style for all .submit-btns */
.submit-btn {
  background: linear-gradient(to bottom, #ffffff 0%, #e4e4e4 100%) !important;
  color: #0046ad !important;
  border: 2px solid #0046ad !important;
  border-left: none !important;
  border-radius: 0 4px 4px 0 !important;
  font-weight: bold !important;
  cursor: pointer !important;
  text-shadow: 0 1px 0 #ffffff !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
  line-height: 18px !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .myspace-header .main-nav-container {
        width: 100%;
    }
    
    .myspace-header .main-nav {
        white-space: nowrap; 
    }
    
    .myspace-header .main-nav li {
        margin: 0;
        height: auto;
    }


    
    .myspace-header .main-nav li a {
        padding: 0 5px; 
    }
    
    /* Mobile Popup Styling for .dropdown-menu - Centered Popup, slightly higher */
    .myspace-header .dropdown-menu {
        position: fixed !important; 
        top: 35% !important; /* Positioned higher than true center */
        left: 50% !important;
        transform: translate(-50%, -50%) !important; 
        width: 70vw !important; /* Further reduced width */
        max-width: 240px !important; /* Further reduced max-width */
        max-height: 60vh !important; /* Adjusted max-height */
        overflow-y: auto !important; 
        background: linear-gradient(to bottom, #1e4390 0%, #0a2a78 100%) !important; /* Blue gradient */
        border: 1px solid #002a6e !important; /* Darker border for contrast */
        border-radius: 8px !important; /* Rounded corners for popup */
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important; /* More pronounced shadow */
        z-index: 600 !important;
        padding: 10px 0 !important; /* Vertical padding for the menu box */
        /* display: none; is handled by .js-dropdown-open globally */
        text-align: center !important; /* Center text for the menu box itself, if needed */
    }

    /* Explicitly style links within the mobile popup for stacking and appearance */
    .myspace-header .dropdown-menu a {
        display: block !important; 
        width: 100% !important;    
        box-sizing: border-box !important;
        text-align: center !important; /* Center text within links */
        padding: 10px 15px !important; 
        white-space: normal !important; 
        color: #ffffff !important; /* White text color */
        border-bottom: 1px solid #002a6e !important; /* Darker blue separator */
        font-size: 14px !important; 
        line-height: 1.4 !important;
        font-weight: bold !important; 
        text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.5) !important; 
    }
    
    .myspace-header .dropdown-menu a:last-child {
        border-bottom: none !important; 
    }
    
    .myspace-header .dropdown-menu a:hover {
        background-color: #0033a7 !important; /* Hover effect like main nav items */
    }
}

/* Mobile styles */
@media (max-width: 480px) {
    .myspace-header .search-box {
        margin: 0 5px 0 0; /* Reduce right margin further on mobile */
        min-width: 0; /* Allow the box to shrink below its content's width */
    }
    
    .myspace-header .search-input {
        width: 90px; /* Further reduced width for mobile */
        padding: 0 3px; /* Reduce padding to save space */
        font-size: 10px; /* Slightly smaller font */
    }
    
    .myspace-header .search-button {
        padding: 0 6px; /* Reduce button padding */
        font-size: 10px; /* Match input font size */
        white-space: nowrap; /* Prevent text wrapping */
    }
}

/* Preserve folder icon styles if needed */
.fa-folder {
  color: #0046ad;
  font-size: 16px;
  margin-right: 5px;
}
