/* Mobile Phones (up to 767px) and iPads (up to 1024px) */
@media only screen and (max-width: 1024px) {
  /* General Body Adjustments */
  body {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
  }
.desktop-only {
    display: none !important; /* Hide desktop Login/Logout on mobile */
  }

  .mobile-only {
    display: block; /* Show mobile Login/Logout in menu */
  }

  .menu-container.active > button.hidden {
    display: none !important; /* Ensure hidden buttons stay hidden in menu */
  }
  
  /* Header */
  header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.3rem 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #1a1a1a;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }

  .header-left {
    position: relative;
    width: 100%;
    padding: 0.2rem 0;
    border-bottom: none !important;
    display: flex;
    justify-content: center !important;
    align-items: center !important;
    text-align: center;
  }

  /* Logo Styling */
  .header-left > img {
    height: 70px;
    max-height: none !important;
    width: auto;
    margin: 0 auto !important;
    filter: drop-shadow(0 0 1px rgba(149, 126, 77, 0.5));
    position: relative;
    z-index: 501;
    display: block !important;
    left: 5rem; /*this moves the logo centered */
  }

  .menu-container {
    position: absolute;
    top: 0;
    right: 0;
    width: auto;
    padding: 0;
    margin: 0;
    z-index: 1010;
    top: -0.rem; /* This puts the hamburger in the correct top position */
    right: -4.3rem; /* This puts the hamburger in the correct right position */
  }

  .menu-toggle {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    cursor: pointer;
    padding: 0.3rem;
    margin: 0;
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    width: 40px;
    height: 30px;
    position: absolute;
    top: -0.75rem; /* This puts the hamburger in the correct top position */
    right: -2.5rem; /* This puts the hamburger in the correct right position */
    z-index: 1013;
  }

  /* The hamburger */
  .menu-toggle span {
    background: #d4b98a;
    height: 2px;
    width: 100%;
    display: block;
    border-radius: 1px;
    transition: all 0.3s ease;
  }

  .menu-toggle span:first-child {
    margin-top: 0;
  }

  .menu-container > button:not(.menu-toggle) {
    display: none;
  }

  .menu-container.active {
    position: absolute;
    top: 0;
    right: 0;
    width: 200px; /* Fixed width for the dropdown */
    z-index: 1000;
  }
  

  .menu-container.active > button:not(.menu-toggle) {
    display: block;
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: none;
    background: linear-gradient(45deg, #957e4d, #b89f6e); /* Inactive state: Default background color */
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    text-align: center;
    border-bottom: 1px solid #957e4d;
    margin: 0;
    position: absolute;
    right: 0;
    background: #1a1a1a;
    border-left: 1px solid #957e4d;
    border-right: 1px solid #957e4d;
    vertical-align: top;
    float: none;
    clear: both;
    border-radius: 5px; /* Uniformly rounded corners for all buttons */
  }
/* Add this to mobile.css inside the @media (max-width: 1024px) block */
.menu-container.active > button.hidden {
  display: none !important; /* Ensure hidden buttons stay hidden */
}
 /* Remove all the individual nth-child positioning rules (2 through 8) */

/* Replace with this stacking layout */
.menu-container.active {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-top: 35px; /* Space for the hamburger */
  gap: 0;
}

.menu-container.active > button:not(.menu-toggle) {
  position: relative;
  right: -2.5rem;
  width: 200px; /* Match the menu width */
  margin: 0;
  padding: 0.4rem 0.6rem; /* Keep your desired padding */
  margin-top: 0;
  border-radius: 5px;
  order: 1; /* Ensure buttons appear below toggle */
}

.menu-toggle {
  order: 0; /* Keep toggle at top */
  position: absolute;
  top: 0;
  right: -2.5rem;
}

/* First visible button gets top rounded corners */
.menu-container.active > button:not(.menu-toggle):not(.hidden):first-of-type {
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  border-top: 1px solid #957e4d;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
  border-bottom: 1px solid #957e4d;
  margin-top: 0;
}

/* Last visible button gets bottom rounded corners */
.menu-container.active > button:not(.menu-toggle):not(.hidden):last-of-type {
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  border-top: 1px solid #957e4d;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
  border-bottom: 1px solid #957e4d;
}

/* Hidden buttons should remain hidden */
.menu-container.active > button.hidden {
  display: none !important;
}

  .menu-container.active > button:not(.menu-toggle):hover,
  .menu-container.active > button:not(.menu-toggle).active {
    background: linear-gradient(45deg, #b89f6e, #d4b98a); /* Hovered state: Background color on hover */
    /* Note: .active state is not explicitly defined here as a selected state;
       if you want a distinct active color, add a separate rule (e.g., .active { background: ... }) */
  }

  .top-buttons {
    width: 100%;
    padding: 0.2rem 0;
    text-align: center;
  }

  .top-buttons button {
    padding: 0.3rem 0.5rem;
    border: 1px solid #957e4d;
    border-radius: 3px;
    background: linear-gradient(45deg, #957e4d, #b89f6e); /* Inactive state: Default background color for top buttons */
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
  }

  .top-buttons button:hover {
    background: linear-gradient(45deg, #b89f6e, #d4b98a); /* Hovered state: Background color on hover for top buttons */
    transform: translateY(-1px);
  }

  .top-buttons button:not(.hidden) {
    display: none;
  }

  .content-section {
    margin-top: 30px;
    padding: 0.5rem;
    min-height: calc(100vh - 60px);
    background: rgba(26, 26, 26, 0.95);
    position: relative;
    z-index: 1;
  }

  .content-section h2 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #d4b98a;
  }

  .text-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #957e4d;
    border-radius: 3px;
    color: #d4b98a;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  }

  #home {
    background-size: cover;
    background-position: center;
    min-height: 90px;
  }

  #home::before {
    background: rgba(0, 0, 0, 0.85);
  }
  
  #home .text-container{
    
    width:80%;
  }

#syncs {
    background-size: auto 18%, auto 18%; /* Reduced size for mobile */
    background-position: left 10%, right 10%; /* Adjusted position for mobile */
  min-height: 90px;
  }

#syncs .carousel-container {
    padding: 0.3rem;
    margin: 0;
    overflow-x: auto;
    white-space: nowrap;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }

  #syncs .carousel-item {
    display: inline-block;
    width: 158.4px;
    margin-right: 10px;
    scroll-snap-align: center;
    vertical-align: top;
  }

  #syncs .carousel-item img {
    width: 158.4px;
    height: 231.6px;
    object-fit: cover;
    display: block;
    border: 2px solid #957e4d;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  }
}

@media only screen and (max-width: 1024px) {
  #news {
    background-size: auto 18%, auto 18% !important; /* Force size reduction */
    background-position: 10% 10%, 90% 90% !important; /* Force positioning */
    background-repeat: no-repeat !important; /* Ensure no tiling */
    min-height: 90px;
  }
}
 #news .text-container{
    
    width:80%;
  }

  #resources {
  background-size: auto 18%, auto 18% !important; /* Force size reduction */
    background-position: 10% 10%, 90% 90% !important; /* Force positioning  left top, left top */
    background-repeat: no-repeat !important; /* Ensure no tiling */
    min-height: 90px;

  }
  #resources .text-container{
  width:80%;
  }
  #docs {
    padding: 0.2rem;
    min-height: 90px;
  }

  .docs-container {
    max-width: 100%;
    margin: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #957e4d;
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  }

  .docs-list {
    padding: 0;
    margin: 0.2rem 0;
  }

  .docs-list li {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.2rem;
    background: #1a1a1a;
    border: 1px solid #957e4d;
    border-radius: 3px;
    margin-bottom: 0.2rem;
  }

  .docs-list a {
    font-size: 0.85rem;
    color: #d4b98a;
    text-decoration: underline;
  }

  .docs-list a:hover {
    color: #b89f6e;
  }

  .modal-overlay {
    padding: 0.2rem;
  }

  .modal {
    width: 90%;
    max-height: 80vh;
    padding: 0.5rem;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #957e4d;
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  }

  .form-group {
    margin-bottom: 0.3rem;
  }

  .form-group label {
    font-size: 0.85rem;
  }

  .form-group input,
  .form-group textarea,
  .form-group button {
    width: 100%;
    font-size: 0.85rem;
    padding: 0.2rem;
  }

  #upload-history {
    max-height: 100px;
  }
}



@media only screen and (max-width: 1024px) {
  #news .text-container,
  #resources .text-container {
    max-height: 50vh; /* Slightly smaller on mobile */
  }

  .infoPRO.show,
  .infoCopyright.show,
  .infoRoyalty.show,
  .infoPub.show,
  .infoDistro.show,
   .dociSplit.show,
   .dociSamp.show,
   .dociCover.show,
   .dociLic.show
   {
    max-height: 30vh; /* Smaller expanded sections on mobile */
  }
}



/* Ensure desktop layout remains unaffected (assumed in catalog.css) */
@media only screen and (min-width: 1025px) {
  .menu-container {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    justify-content: center;
    padding: 0;
  }

  .menu-toggle {
    display: none;
  }

  .top-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
  }
}
/* mobile contact form here as it must come last */

  @media only screen and (max-width: 1024px) {

  #Contact .contact-form-container {
    max-width: 50% !important; /* Test value */
    margin: 0.01rem auto !important;
    padding: 0.01rem !important;
    border: 1px solid #957e4d !important;
    border-radius: 3px !important;
    box-shadow: 0 1.6px 4px rgba(0, 0, 0, 0.3) !important;
  }
  #Contact .contact-form-container h2 {
    font-size: 0.7rem !important;
  }
  #Contact #ContactForm .form-group {
    margin-bottom: 0.01rem !important;
  }
  #Contact #ContactForm label {
    font-size: 0.5rem !important;
  }
  #contactForm {
  width: 100% !important;
  padding: 1rem;
  }
  #Contact #ContactForm input,
  #Contact #ContactForm select,
  #Contact #ContactForm textarea {
    font-size: 0.5rem !important;
    padding: 0.01rem !important;
    width: 95% !important;
  }
  #Contact #ContactForm textarea {
    rows: 4 !important;
  }
  #Contact #ContactForm button[type="submit"] {
    font-size: 0.5rem !important;
    padding: 0.01rem 0.05rem !important;
  }
  #Contact #form-message {
    font-size: 0.5rem !important;
  }
}
@media only screen and (max-width: 1024px) {
  #Contact .contact-form-container {
    max-width: 75% !important;

  }
}
/* Admin Section Mobile Adjustments */
@media only screen and (max-width: 1024px) {
  #admin {
    background-size: cover !important;
    min-height: 90px;
  }

  #admin-controls-section {
    width: 100%;
    padding: 0.5rem;
  }

  #admin-controls-section table {
    width: 100%;
    display: flex;
    flex-direction: column;
  }

  #admin-controls-section tr {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.5rem;
  }

  #admin-controls-section td {
    padding: 0.3rem;
    width: 100% !important;
    text-align: center !important; /* Ensure text-align applies */
  }

  /* Center the Reanalyze All button more explicitly */
  #admin-controls-section tr:nth-child(1) td:last-child {
    display: flex;
    justify-content: center !important; /* Force centering */
    align-items: center !important;
    width: 100% !important;
    padding: 0.3rem !important;
  }

  .reanalyze-btn {
    width: 150px !important;
    margin: 0 auto !important; /* Reinforce centering */
    display: block !important; /* Ensure block-level for centering */
  }

  /* Ensure Clear Cache button is spaced down */
  #admin-controls-section tr:nth-child(2) {
    margin-top: 1.5rem !important; /* Increase spacing above */
    margin-bottom: 1rem !important;
  }

  .clear-cache-btn {
    width: 200px !important;
    margin: 0 auto !important; /* Center the button */
    padding: 0.4rem !important;
    display: block !important; /* Ensure block-level for centering */
  }

  #admin-create-user {
    max-width: 100% !important;
    margin: 0.5rem auto !important;
  }

  #admin-create-user input,
  #admin-create-user select,
  #admin-create-user button {
    width: 100% !important;
    font-size: 0.8rem !important;
    padding: 0.3rem !important;
  }

  .edit-delete-btn,
  .clear-cache-btn,
  .reanalyze-btn {
    width: 100% !important;
    margin: 0.2rem 0 !important;
    padding: 0.4rem !important;
    font-size: 0.8rem !important;
  }

  .admin-section-header {
    padding: 0.4rem;
    font-size: 0.9rem;
  }

  .admin-section-content {
    width: 100% !important;
    position: relative !important;
  }

  .admin-section-content.show {
    max-height: 300px !important;
    padding: 0.3rem !important;
  }

  .inline-edit-form {
    width: 95% !important;
    padding: 0.5rem !important;
    margin: 0.5rem auto !important;
  }

  .inline-edit-form .form-group {
    margin-bottom: 0.5rem !important;
  }

  .inline-edit-form input,
  .inline-edit-form select,
  .inline-edit-form textarea {
    font-size: 0.8rem !important;
    padding: 0.3rem !important;
  }

  .inline-edit-form button {
    padding: 0.4rem !important;
    font-size: 0.8rem !important;
  }

  #reanalyze-progress {
    font-size: 0.8rem !important;
    margin: 0.3rem 0 !important;
  }
}
/* Mobile Phones (up to 767px) and iPads (up to 1024px) */
@media only screen and (max-width: 1024px) {
  /* Existing styles unchanged */

  /* Search Container */
  .search-container {
    position: sticky;
    top: 60px; /* Matches mobile header height (~30-60px) */
    z-index: 100; /* Below header (z-index: 1000) */
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    padding: 0.5rem; /* Reduced padding for mobile */
    padding-top: 1.5rem; /* Per April 12, 2025 */
    border-bottom: 1px solid #957e4d;
    width: 100%; /* Fits within container */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    box-sizing: border-box;
  }

  .search-container > div {
    width: 100%;
    max-width: 600px; /* Wide enough for inline items */
    margin: 0 auto; /* Center the inner div */
    display: flex;
    flex-direction: row; /* Inline layout */
    flex-wrap: wrap; /* Allow wrapping if needed */
    justify-content: center; /* Center items horizontally */
    align-items: center;
    gap: 0.5rem; /* Smaller gap for inline */
  }

  .search-container select,
  .search-container input,
  .search-container button {
    width: auto; /* Allow natural width */
    max-width: 150px; /* Smaller width for inline */
    margin: 0; /* Remove auto margins for inline flow */
    padding: 0.3rem; /* Slightly smaller padding */
    font-size: 0.8rem; /* Smaller font for mobile */
    border: 1px solid #957e4d;
    border-radius: 4px;
    background: #1a1a1a;
    color: #ffffff;
  }

  .search-container button {
    background: linear-gradient(45deg, #957e4d, #b89f6e);
    cursor: pointer;
    transition: background 0.3s ease;
  }

  .search-container button:hover {
    background: linear-gradient(45deg, #b89f6e, #d4b98a);
  }

  /* Scrollable Content */
  .scrollable-content {
    padding-top: 1rem; /* Reduced to fit mobile layout */
    padding-bottom: 4rem; /* Extra space for pagination */
    height: calc(100vh - 100px); /* Increased to fit pagination */
    overflow-y: auto;
  }

  /* Songs Container */
  .songs-container {
    margin-top: 0.3rem; /* Reduced margin for mobile */
  }

  /* Pagination */
  .pagination {
    width: 100%; /* Fits within container */
    margin: 0.5rem auto 5rem auto; /* Extra bottom margin to avoid clipping */
    padding: 0.5rem 0;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    box-sizing: border-box;
  }

  .pagination button {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    border: 1px solid #957e4d;
    border-radius: 4px;
    background: linear-gradient(45deg, #957e4d, #b89f6e);
    color: #ffffff;
    cursor: pointer;
    transition: background 0.3s ease;
  }

  .pagination button:hover {
    background: linear-gradient(45deg, #b89f6e, #d4b98a);
  }

  .pagination button:disabled {
    background: #666;
    cursor: not-allowed;
  }
}