
/* General styles for the main container */

@font-face {
    font-family: 'Lato';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/lato/v24/S6uyw4BMUTPHjx4wWw.ttf) format('truetype');
  }
  @font-face {
    font-family: 'Lato';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/lato/v24/S6u9w4BMUTPHh6UVSwiPHA.ttf) format('truetype');
  }
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Lato', sans-serif;
  }
  
main {
  height: 90%;
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap; /* Allow wrapping of items */
  overflow-x: hidden; /* Prevent horizontal scrolling */
}

main a {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px; /* Add margin for spacing */
  text-decoration: none;
}

main a figure {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
}

.visible {
  visibility: visible;
}


.pageMain {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow-x: hidden;
}

#main-dobble {
  height: 25vh;
  object-fit: contain;
}

/* Mobile: Make logo 50% smaller on home page */
@media (max-width: 768px) {
  #main-dobble {
    height: 12.5vh;
  }
  
  /* Add margin under explore mode button on mobile */
  .home-container .mode-selection > a:nth-child(3) {
    margin-bottom: 30px;
  }
}

/* Home page profile picture - bigger and more in corner (main/index.ejs page only, not head2 pages) */
.main-content ~ * .header .profile-menu .profile-pic,
body:not(:has(header #contentList)) .header .profile-menu .profile-pic {
  width: 75px !important;
  height: 75px !important;
}

/* Target home page specifically - header without #contentList */
body .header:not(:has(#contentList)) .profile-menu .profile-pic {
  width: 75px !important;
  height: 75px !important;
}

@media (max-width: 768px) {
  body .header:not(:has(#contentList)) .profile-menu {
    margin-top: 15px;
    margin-right: 15px;
    margin-left: 15px;
  }
  
  body .header:not(:has(#contentList)) .profile-menu .profile-pic {
    width: 48px !important;
    height: 48px !important;
  }
}

@media (max-width: 480px) {
  body .header:not(:has(#contentList)) .profile-menu {
    margin-top: 25px;
    margin-right: 10px;
    margin-left: 15px;
  }
  
  body .header:not(:has(#contentList)) .profile-menu .profile-pic {
    width: 42px !important;
    height: 42px !important;
  }
}

/* Top Buttons Container */
.header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem 1.5rem 2rem;
    background: transparent;
    box-sizing: border-box;
    z-index: 100;
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 100;
}

/* Remove .top-buttons fixed positioning */
.top-buttons {
    position: static !important;
    top: unset !important;
    right: unset !important;
    z-index: unset !important;
    display: none !important;
}

/* Login Button */
.login-button {
    position: relative;
}

.login-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    box-shadow: 
        0 4px 12px var(--shadow-light),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.login-btn:hover {
    transform: scale(1.1);
    box-shadow: 
        0 6px 20px var(--shadow-medium),
        0 0 20px rgba(135, 206, 250, 0.3);
}

.login-btn i {
    font-size: 1.5rem;
    color: var(--text-primary) !important;
}

/* Enhanced Theme Toggle Button */
.theme-toggle {
    position: relative;
    z-index: 100;
}

.theme-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    box-shadow: 
        0 4px 12px var(--shadow-light),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.theme-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.theme-btn:hover::before {
    left: 100%;
}

.theme-btn:hover {
    transform: scale(1.1);
    box-shadow: 
        0 6px 20px var(--shadow-medium),
        0 0 20px rgba(135, 206, 250, 0.3);
}

.theme-btn .moon-icon {
    display: block;
    font-size: 1.2rem;
    color: var(--text-primary) !important;
}

.theme-btn .sun-icon {
    display: none;
    font-size: 1.2rem;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .theme-btn .sun-icon {
    display: block;
}

[data-theme="dark"] .theme-btn .moon-icon {
    display: none;
    color: var(--text-primary) !important;
}

  .home-container{
    justify-content:space-evenly!important;
  }
/* Navigation styles */
nav {
   /* prevent overflow */
  width: 100vw;
}

/* Enhanced Mode Selection - Fixed Width Issues */
.mode-selection {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 20px;
  gap: 20px;
  position: relative;
  z-index: 20;
}

/* --- Sidebar horizontal scroll for mode-selection --- */
.sidebar .mode-selection {
  flex-wrap: nowrap;
  flex-direction: row;
  justify-content: flex-start;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  padding-bottom: 10px;
  scrollbar: none

}

.sidebar .mode-selection::-webkit-scrollbar {
  height: 8px;
  background: transparent;
}
.sidebar .mode-selection::-webkit-scrollbar-thumb {
  background: var(--rainbow-blue);
  border-radius: 4px;
}
.sidebar .mode-selection::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar .mode-selection > a {
  flex: 0 0 auto;
  min-width: 120px;
  max-width: 180px;
  margin-right: 16px;
}

.sidebar .mode-selection > a:last-child {
  margin-right: 0;
}

.sidebar .mode-selection > a > div {
  min-width: 120px;
  min-height: 120px;
  max-width: 180px;
  max-height: 180px;
  margin: 0;
}

/* --- End sidebar horizontal scroll --- */

.mode-selection > a {
  /*! flex: 1 1 auto; */
  min-width: 140px;
  max-width: 200px;
  text-decoration: none;
  position: relative;
  z-index: 25;
}

.mode-selection > a > div {
    /*! width: 100%; */
    /*! aspect-ratio: 1 / 1; */
    /*! max-width: 200px; */
    /*! max-height: 200px; */
    /*! min-width: 140px; */
    min-height: 140px;
    /*! display: flex; */
    /*! align-items: center; */
    /*! justify-content: center; */
    /*! color: white; */
    /*! font-weight: bold; */
    /*! text-align: center; */
    /*! margin: 10px; */
    border-radius: 15px;
    /*! transition: all 0.3s ease; */
    /*! background-color: inherit; */
    /*! background: var(--glass-bg); */
    /*! backdrop-filter: blur(20px); */
    /*! border: 2px solid var(--glass-border); */
    box-shadow: 0 4px 12px var(--shadow-light);
    position: relative;
    /*! overflow: hidden; */
    z-index: 30;
}

.mode-selection > a > div::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    border-radius: 15px;
    z-index: -1;
    opacity: 0.8;
}

.mode-selection > a > div::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--rainbow-red), var(--rainbow-orange), var(--rainbow-yellow), var(--rainbow-green), var(--rainbow-blue), var(--rainbow-indigo), var(--rainbow-violet));
    background-size: 400% 400%;
    border-radius: 17px;
    z-index: -2;
    opacity: 0.3;
    transition: opacity 0.3s ease;
    animation: rainbow-flow 3s ease-in-out infinite;
}

@keyframes rainbow-flow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.mode-selection > a {
  text-decoration: none;
}

/* Base mode-button styling */
.mode-button {
    position: relative;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white !important;
    font-weight: bold;
    text-align: center;
    padding: 20px;
    border-radius: 15px;
    transition: all 0.3s ease;
    min-height: 140px;
    font-size: 18px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    text-transform: capitalize;
    letter-spacing: 1px;
}

.mode-button{
    box-sizing: border-box;
}
.mode-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 24px var(--shadow-medium);
    border-color: var(--rainbow-blue);
    /*! background: rgba(135, 206, 250, 0.1); */
}

.mode-button:hover::after {
    opacity: 0.6;
}

/* Specific glow effects for each mode button - always glowing */
.mode-selection > a:nth-child(1) > div {
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.4), 0 0 25px rgba(255, 0, 0, 0.3);
    border-color: #ff0000;
    animation: pulse-glow-red 2s ease-in-out infinite;
}

.mode-selection > a:nth-child(1) > div::after {
    background: linear-gradient(45deg, #ff0000, #cc0000, #ff0000);
    background-size: 200% 200%;
    animation: rainbow-flow 3s ease-in-out infinite;
}

.mode-selection > a:nth-child(2) > div {
    box-shadow: 0 4px 12px rgba(0, 0, 255, 0.4), 0 0 25px rgba(0, 0, 255, 0.3);
    border-color: #0000ff;
    animation: pulse-glow-blue 2s ease-in-out infinite;
}

.mode-selection > a:nth-child(2) > div::after {
    background: linear-gradient(45deg, #0000ff, #1a1a66, #0000ff);
    background-size: 200% 200%;
    animation: rainbow-flow 3s ease-in-out infinite;
}

.mode-selection > a:nth-child(3) > div {
    box-shadow: 0 4px 12px rgba(255, 165, 0, 0.4), 0 0 25px rgba(255, 165, 0, 0.3);
    border-color: #ffa500;
    animation: pulse-glow-orange 2s ease-in-out infinite;
}

.mode-selection > a:nth-child(3) > div::after {
    background: linear-gradient(45deg, #ffa500, #cc8400, #ffa500);
    background-size: 200% 200%;
    animation: rainbow-flow 3s ease-in-out infinite;
}

.mode-selection > a:nth-child(4) > div {
    box-shadow: 0 4px 12px rgba(34, 160, 38, 0.4), 0 0 25px rgba(34, 160, 38, 0.3);
    border-color: #22a026;
    animation: pulse-glow 2s ease-in-out infinite;
}

.mode-selection > a:nth-child(4) > div::after {
    background: linear-gradient(45deg, #22a026, #2d5a2d, #22a026);
    background-size: 200% 200%;
    animation: rainbow-flow 3s ease-in-out infinite;
}

.mode-selection > a:nth-child(5) > div {
    box-shadow: 0 4px 12px rgba(204, 30, 126, 0.4), 0 0 25px rgba(204, 30, 126, 0.3);
    border-color: #cc1e7e;
    animation: pulse-glow-pink 2s ease-in-out infinite;
}

.mode-selection > a:nth-child(5) > div::after {
    background: linear-gradient(45deg, #cc1e7e, #a01865, #cc1e7e);
    background-size: 200% 200%;
    animation: rainbow-flow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { 
        box-shadow: 0 4px 12px rgba(34, 160, 38, 0.4), 0 0 25px rgba(34, 160, 38, 0.3);
    }
    50% { 
        box-shadow: 0 4px 12px rgba(34, 160, 38, 0.6), 0 0 35px rgba(34, 160, 38, 0.5);
    }
}

@keyframes pulse-glow-blue {
    0%, 100% { 
        box-shadow: 0 4px 12px rgba(0, 0, 255, 0.4), 0 0 25px rgba(0, 0, 255, 0.3);
    }
    50% { 
        box-shadow: 0 4px 12px rgba(0, 0, 255, 0.6), 0 0 35px rgba(0, 0, 255, 0.5);
    }
}

@keyframes pulse-glow-orange {
    0%, 100% { 
        box-shadow: 0 4px 12px rgba(255, 165, 0, 0.4), 0 0 25px rgba(255, 165, 0, 0.3);
    }
    50% { 
        box-shadow: 0 4px 12px rgba(255, 165, 0, 0.6), 0 0 35px rgba(255, 165, 0, 0.5);
    }
}

@keyframes pulse-glow-red {
    0%, 100% { 
        box-shadow: 0 4px 12px rgba(255, 0, 0, 0.4), 0 0 25px rgba(255, 0, 0, 0.3);
    }
    50% { 
        box-shadow: 0 4px 12px rgba(255, 0, 0, 0.6), 0 0 35px rgba(255, 0, 0, 0.5);
    }
}

@keyframes pulse-glow-pink {
    0%, 100% { 
        box-shadow: 0 4px 12px rgba(204, 30, 126, 0.4), 0 0 25px rgba(204, 30, 126, 0.3);
    }
    50% { 
        box-shadow: 0 4px 12px rgba(204, 30, 126, 0.6), 0 0 35px rgba(204, 30, 126, 0.5);
    }
}

/* Enhanced hover effects */
.mode-selection > a:nth-child(1) > div:hover {
    /*! box-shadow: 0 8px 24px rgba(34, 160, 38, 0.5), 0 0 30px rgba(34, 160, 38, 0.4); */
    /*! border-color: #22a026; */
    /*! transform: translateY(-8px) scale(1.08); */
}

.mode-selection > a:nth-child(2) > div:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 255, 0.5), 0 0 30px rgba(0, 0, 255, 0.4);
    border-color: #0000ff;
    transform: translateY(-8px) scale(1.08);
}

.mode-selection > a:nth-child(3) > div:hover {
    box-shadow: 0 8px 24px rgba(255, 165, 0, 0.5), 0 0 30px rgba(255, 165, 0, 0.4);
    border-color: #ffa500;
    transform: translateY(-8px) scale(1.08);
}

.mode-selection > a:nth-child(4) > div:hover {
    box-shadow: 0 8px 24px rgba(255, 0, 0, 0.5), 0 0 30px rgba(255, 0, 0, 0.4);
    border-color: #ff0000;
    transform: translateY(-8px) scale(1.08);
}

.mode-selection > a:nth-child(5) > div:hover {
    box-shadow: 0 8px 24px rgba(204, 30, 126, 0.5), 0 0 30px rgba(204, 30, 126, 0.4);
    border-color: #cc1e7e;
    transform: translateY(-8px) scale(1.08);
}

/* Click animations */
.mode-selection > a:nth-child(1) > div:active {
    transform: translateY(-4px) scale(0.95);
    box-shadow: 0 4px 12px rgba(34, 160, 38, 0.7), 0 0 20px rgba(34, 160, 38, 0.6);
}


/* Username Validation Styles */
.username-validation {
    margin-top: 8px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.username-validation.success {
    color: #22c55e;
}

.username-validation.error {
    color: #ef4444;
}

.username-validation.warning {
    color: #f59e0b;
}

.username-validation i {
    font-size: 14px;
}

/* Enhanced Save Button Styles */
.save-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary-color, #3b82f6);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.save-btn:hover {
    background: var(--primary-hover, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.save-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.save-btn i {
    font-size: 14px;
}

.mode-selection > a:nth-child(2) > div:active {
    transform: translateY(-4px) scale(0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 255, 0.7), 0 0 20px rgba(0, 0, 255, 0.6);
}

.mode-selection > a:nth-child(3) > div:active {
    transform: translateY(-4px) scale(0.95);
    box-shadow: 0 4px 12px rgba(255, 165, 0, 0.7), 0 0 20px rgba(255, 165, 0, 0.6);
}

.mode-selection > a:nth-child(4) > div:active {
    transform: translateY(-4px) scale(0.95);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.7), 0 0 20px rgba(255, 0, 0, 0.6);
}

.mode-selection > a:nth-child(5) > div:active {
    transform: translateY(-4px) scale(0.95);
    box-shadow: 0 4px 12px rgba(204, 30, 126, 0.7), 0 0 20px rgba(204, 30, 126, 0.6);
}

/* Rainbow Bar */
.rainbow-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--rainbow-red), var(--rainbow-orange), var(--rainbow-yellow), var(--rainbow-green), var(--rainbow-blue), var(--rainbow-indigo), var(--rainbow-violet));
    background-size: 200% 100%;
    animation: rainbow-flow 3s ease-in-out infinite;
    z-index: 1002;
}

/* Responsive Design without Media Queries */
.mode-selection > a {
  /*! flex: 1 1 20vh; */ /* Flexibly sized square buttons */
  /*! max-width: 20vh; */ /* Prevent excessive growth */
}

@media (max-width: 800px) {
    .top-buttons {
        top: 1rem;
        right: 1rem;
        gap: 0.5rem;
    }
    
    .theme-btn,
    .login-btn {
        width: 40px;
        height: 40px;
    }
    
    .mode-selection {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .mode-selection > a {
        width: 100%;
        max-width: 250px;
    }
    
    .mode-selection > a > div {
        width: 100%;
        min-width: 120px;
        min-height: 120px;
        border-radius: 12px;
    }

    /* Sidebar horizontal scroll on mobile: keep row direction */
    .sidebar .mode-selection {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: stretch;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 12px;
        padding-bottom: 8px;
    }
    .sidebar .mode-selection > a {
        min-width: 100px;
        max-width: 140px;
        margin-right: 10px;
    }
    .sidebar .mode-selection > a:last-child {
        margin-right: 0;
    }
    .sidebar .mode-selection > a > div {
        min-width: 100px;
        min-height: 100px;
        max-width: 140px;
        max-height: 140px;
        margin: 0;
    }
}

@media (max-width: 480px) {
    .mode-selection > a {
        width: 100%;
        max-width: 200px;
    }
    
    .mode-selection > a > div {
        min-width: 100px;
        min-height: 100px;
    }
    .sidebar .mode-selection > a {
        min-width: 80px;
        max-width: 110px;
    }
    .sidebar .mode-selection > a > div {
        min-width: 80px;
        min-height: 80px;
        max-width: 110px;
        max-height: 110px;
    }
}
