/* ------------------------------------------------------------------- */
/*
 * COMPLETE STYLESHEET FOR SOCIAL CLAN APPLICATION
 * Version: 3.5.0 (Sort Button Fix)
 * Date: 2025-10-01
 * -------------------------------------------------------------------
 */

/* === 1. GLOBAL STYLES & RESETS === */
html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}
body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at center, #151515 0%, #0d0d0d 100%);
    color: #e5e7eb;
    min-height: 100vh;
    padding: 2rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    overflow-x: hidden; 
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
}

/* Scroll Lock for Modals */
body.modal-open {
    background: radial-gradient(circle at center, #151515 0%, #0d0d0d 100%) !important; 
    overflow-y: hidden !important;
}

/* Split Screen Layout (Used for Sign-in/Auth pages) */
.split-screen-body {
    padding: 0; 
    display: flex; 
    flex-direction: column;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0d0d0d;
}
::-webkit-scrollbar-thumb {
    background-color: #333;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background-color: #555;
}

/* Text and Links */
a {
    text-decoration: none;
    color: #3b82f6;
    transition: color 0.3s ease;
}
a:hover {
    color: #5b9bf9;
}
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5rem 0;
    color: #f9fafb;
}

/* === 2. HEADER AND NAVIGATION === */
.site-header {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(42, 42, 42, 0.5);
    margin: 0 auto 2rem auto; 
    position: sticky; 
    top: 0; 
    background: rgba(13, 13, 13, 0.95); 
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px);
    z-index: 100; 
    gap: 2rem; 
}

.site-header .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f9fafb;
    text-decoration: none;
    letter-spacing: -0.05em;
    flex-shrink: 0; 
}

#mobile-menu-toggle {
    display: none;
    z-index: 210; 
    flex-shrink: 0;
}

.site-utilities {
    display: flex;
    align-items: center;
    gap: 1rem; 
    flex-shrink: 0; 
}

.nav-menu {
    display: flex;
    flex-grow: 1; 
    justify-content: center; 
    gap: 2rem;
    align-items: center;
}

.main-nav-links-wrapper {
    display: flex;
    align-items: center;
    gap: 2rem;
    transition: none; 
    transform: none; 
}

.nav-menu > .main-nav-links-wrapper > ul { 
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
}

/* --- DROPDOWN POSITIONING FIXES --- */
.nav-menu li,
.dropdown-link,
.user-menu-container,
.profile-request-container,
.post-options-container {
    position: relative; /* Anchors the absolute menu */
    list-style: none;
}

.nav-menu a {
    color: #9ca3af;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease, transform 0.3s ease;
    display: block;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transform-origin: left;
}

.nav-menu a:hover {
    color: #f9fafb;
    transform: scale(1.05);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    background-color: #151515;
    border: 1px solid rgba(42, 42, 42, 0.8);
    border-radius: 0.5rem;
    padding: 0.5rem 0;
    min-width: 160px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000; 
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    margin-top: 0.5rem;
}

/* Align Right-side menus correctly */
.user-menu-container .dropdown-menu,
.profile-request-container .dropdown-menu,
.share-container .dropdown-menu {
    left: auto;
    right: 0;
}

.nav-menu li.nav-active .dropdown-menu,
.dropdown-link.active .dropdown-menu,
.post-options-container.active .post-options-menu,
.profile-request-container.active .dropdown-menu,
.user-menu-container.active .dropdown-menu { 
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    padding: 0.75rem 1.5rem;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: block;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    transform: none;
}

/* === NOTIFICATION CENTER === */
.notification-container {
    position: relative;
    z-index: 110; 
}

.notification-toggle {
    background-color: rgba(21, 21, 21, 0.7);
    border: 1px solid rgba(42, 42, 42, 0.5);
    border-radius: 9999px;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease, background-color 0.3s ease;
    -webkit-user-select: none;
    user-select: none;
}

.notification-toggle:hover {
    transform: scale(1.05);
    background-color: rgba(21, 21, 21, 1);
}

.notification-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #f9fafb;
}

.unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #3b82f6;
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    width: 18px;
    height: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(1);
    transition: transform 0.3s ease;
}

.unread-badge.hidden {
    transform: scale(0);
}

.notification-dropdown {
    position: absolute;
    top: 150%;
    right: 0;
    width: 380px;
    background-color: rgba(21, 21, 21, 0.8);
    border-radius: 1rem;
    border: 1px solid rgba(42, 42, 42, 0.5);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem;
    transform-origin: top right;
    transform: scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 10;
    max-height: 500px;
    display: flex;
    flex-direction: column;
}

.notification-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.notification-tabs {
    display: flex;
    justify-content: space-around;
    background-color: #0d0d0d;
    border-radius: 0.75rem;
    padding: 0.25rem;
    margin-bottom: 1rem;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
}

.tab-button {
    flex-grow: 1;
    text-align: center;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #9ca3af;
    background-color: transparent;
    border: none;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: color 0.3s ease, background-color 0.3s ease;
    position: relative;
    user-select: none;
}

.tab-button:hover {
    color: #f9fafb;
}

.tab-button.active {
    background-color: #3b82f6;
    color: #f9fafb;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}
/*
.notification-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.notification-list.hidden {
    display: none;
}

.notification-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 0.75rem;
    background-color: rgba(21, 21, 21, 0.7);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    border: 1px solid rgba(42, 42, 42, 0.5);
}

.notification-item:nth-of-type(even) {
    background-color: rgba(21, 21, 21, 0.5);
}

.notification-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.notification-item.unread {
    border-color: #3b82f6;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.notification-item .content-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 1px solid #2a2a2a;
}

.notification-item p {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #c0c0c0;
    margin: 0;
}

.notification-item h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #f9fafb;
    margin: 0;
}

.notification-actions {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.notification-actions a {
    font-size: 0.875rem;
    font-weight: 500;
    color: #3b82f6;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid #3b82f6;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    display: inline-block;
    width: auto;
    user-select: none;
}

.notification-actions a:hover {
    background-color: #3b82f6;
    color: #fff;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.4);
}

.notification-dismiss {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 1.5rem;
    height: 1.5rem;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    user-select: none;
}

.notification-item:hover .notification-dismiss {
    opacity: 1;
}

.notification-dismiss svg {
    width: 0.75rem;
    height: 0.75rem;
    color: #9ca3af;
}
*/
/* === CARD STYLES (COMMON) === */
.card {
    background-color: rgba(21, 21, 21, 0.7);
    border: 1px solid rgba(42, 42, 42, 0.5);
    border-radius: 1rem;
    padding: 2rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease;
    position: relative;
    overflow: hidden;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6), 0 0 10px rgba(59, 130, 246, 0.2);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #f9fafb;
}

/* === SOCIAL PROFILE SPECIFIC STYLES === */
.social-main {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.profile-banner {
    width: 100%;
    height: 300px;
    background: no-repeat center center/cover;
    border-radius: 1rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 2rem;
    position: relative;
}

.profile-info-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
    color: #f9fafb;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #151515;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
}

.profile-details h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

.profile-details p {
    font-size: 1rem;
    color: #9ca3af;
    margin: 0.25rem 0 0;
}

.social-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-top: 3rem;
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.right-column,#wall_posts_container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 100%;
    overflow: hidden;
}

.about-text {
    line-height: 1.6;
    color: #c0c0c0;
}

.friends-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.friend-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: #9ca3af;
    transition: color 0.3s ease, transform 0.3s ease;
}

.friend-item:hover {
    color: #f9fafb;
    transform: scale(1.05);
}

.friend-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #3b82f6;
}

.friend-name {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

/* New Member Spotlight Styles */
.member-spotlight-list {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.spotlight-member {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: rgba(21, 21, 21, 0.5);
  padding: 0.75rem;
  border-radius: 0.5rem;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.spotlight-member:hover {
  transform: translateX(5px);
  background-color: rgba(21, 21, 21, 0.7);
}

.spotlight-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.spotlight-info {
  display: flex;
  flex-direction: column;
}

.spotlight-name {
  font-weight: 600;
  color: #f9fafb;
  font-size: 0.9rem;
}

.spotlight-role {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* Updated Upcoming Events Styles */
.upcoming-events-card {
  box-shadow: inset 0 0 10px rgba(59, 130, 246, 0.1);
}

.events-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.event-item {
  display: flex;
  flex-direction: column; 
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1rem;
  border-radius: 0.5rem;
  background-color: rgba(21, 21, 21, 0.7);
  transition: all 0.3s ease;
}

.event-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4), 0 0 10px rgba(59, 130, 246, 0.3);
  background-color: rgba(21, 21, 21, 0.85);
}

.event-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.event-name {
  font-weight: 700;
  color: #f9fafb;
  font-size: 1.1rem;
}

.event-date {
  font-size: 0.85rem;
  color: #9ca3af;
  font-weight: 500;
}

.event-countdown {
  font-size: 1rem;
  font-weight: 700;
  color: #4ade80;
  background-color: rgba(74, 222, 128, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.clans-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0;
    list-style: none;
}

.clan-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    align-items: center;
    padding: 1rem;
    border-radius: 0.5rem;
    background-color: rgba(21, 21, 21, 0.5);
    transition: transform 0.3s ease, background-color 0.3s ease;
    border: 1px solid rgba(42, 42, 42, 0.5);
}

.clan-item:hover {
    transform: translateY(-3px);
    background-color: rgba(21, 21, 21, 0.7);
}

.clan-name {
    font-weight: 600;
    color: #f9fafb;
}

.clan-detail {
    font-size: 0.875rem;
    color: #9ca3af;
}

.battle-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0;
    list-style: none;
}

.battle-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background-color: rgba(21, 21, 21, 0.7);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(42, 42, 42, 0.5);
}

.battle-item:hover {
    transform: translateY(-3px);
    background-color: rgba(21, 21, 21, 0.85);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.battle-teams {
    display: flex;
    flex-direction: column; 
    align-items: center;
    gap: 0.1rem; 
    font-weight: 500;
    color: #f9fafb;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    flex-grow: 1;
    overflow: hidden;
    white-space: nowrap;
}

.battle-teams .team-name {
    padding: 0.1rem 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.battle-teams .vs {
    font-size: 0.65rem; 
    font-weight: 400;
    color: #9ca3af;
}
.battle-teams .vs::before {
    content: "vs"; 
}

.winner .team-name {
    background-color: rgba(59, 130, 246, 0.2);
    color: #3b82f6; 
    font-weight: 600;
}

.battle-score {
    font-weight: 700;
    color: #9ca3af;
    font-size: 1rem; 
    transition: color 0.3s ease, text-shadow 0.3s ease;
    margin-top: 0.5rem;
    flex-shrink: 0;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(42, 42, 42, 0.5); 
    width: 100%;
}

.battle-score.winner-score {
    color: #4ade80;
    text-shadow: none;
}

.post-card {
    padding: 1.5rem;
    overflow: visible; 
    z-index: 20; 
}

.create-post-card {
    padding: 1rem 1.5rem; 
    overflow: hidden; 
    display: flex;
    align-items: center;
}

.create-post-card .post-header {
    width: 100%; 
}

.post-header {
    position: relative; 
    justify-content: space-between;
    align-items: flex-start; 
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.post-meta-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.post-options-container {
    position: relative;
    z-index: 10;
}

.post-options-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-options-toggle:hover {
    background-color: rgba(42, 42, 42, 0.5);
    color: #f9fafb;
}

.post-options-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
}

.post-options-menu {
    position: absolute;
    top: 100%; 
    right: 0;
    left: auto; 
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 0.5rem;
    padding: 0.5rem 0;
    min-width: 150px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 100;
    list-style: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.post-options-menu li {
    list-style: none;
    border-bottom: 1px solid #2a2a2a;
}

.post-options-menu li:last-child {
    border-bottom: none;
}

.post-options-menu a {
    color: #9ca3af;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-options-menu a:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    transform: none; 
}

.post-options-menu a.report-option:hover {
    color: #f87171;
    background-color: rgba(248, 113, 113, 0.1);
}

.post-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.post-author h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #f9fafb;
}

.post-author span {
    font-size: 0.75rem;
    color: #9ca3af;
}

.post-body p {
    line-height: 1.6;
    color: #c0c0c0;
    margin-bottom: 1.5rem;
}

.post-image {
    width: 100%;
    border-radius: 0.75rem;
    margin-top: 0.5rem;
}

.post-actions {
    display: flex;
    justify-content: space-around;
    padding-top: 1rem;
    border-top: 1px solid rgba(42, 42, 42, 0.5);
    position: relative;
    z-index: 10;
}

.action-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.3s ease, transform 0.3s ease;
    user-select: none;
}

.action-button:hover {
    color: #3b82f6;
    transform: translateY(-2px);
}

.create-post-card .action-button:hover {
    color: #f9fafb;
    transform: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}

.action-button svg {
    width: 1.25rem;
    height: 1.25rem;
}

.dropdown-link.share-container {
    position: relative;
    z-index: 10; 
}

.share-container .dropdown-menu {
    left: auto;
    right: 0;
    min-width: 120px;
    padding: 0; 
    background-color: #1a1a1a;
    z-index: 1000;
    
    display: flex;
    flex-direction: column;
    gap: 0; 

    top: auto; 
    bottom: 100%; 
    transform: translateY(-10px); 
    
    list-style: none;
}

.share-container .dropdown-menu li {
    list-style: none;
    border-bottom: 1px solid #2a2a2a; 
    transition: background-color 0.2s ease;
}

.share-container .dropdown-menu li:last-child {
    border-bottom: none;
}

.share-container .dropdown-menu a {
    color: #9ca3af;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease; 
    
    white-space: nowrap;
    display: block; 
}

.share-container .dropdown-menu a:hover {
    background-color: #1f2937;
    color: #3b82f6;
    transform: translateX(5px); 
}

/* === NEW PROFILE NAV STYLES === */
.profile-nav-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    margin-top: -1rem;
    border-bottom: 1px solid rgba(42, 42, 42, 0.5);
}

.profile-nav-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2rem;
}

.profile-nav-menu a {
    color: #9ca3af;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease, border-bottom 0.3s ease;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.profile-nav-menu a:hover,
.profile-nav-menu a.active {
    color: #f9fafb;
    border-bottom-color: #3b82f6;
}

.profile-request-container {
    position: relative;
    z-index: 10;
}

.request-button {
    background-color: #3b82f6;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.request-button:hover {
    background-color: #5b9bf9;
    color: #282d35;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.request-button::after {
    content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="white" class="w-4 h-4"><path stroke-linecap="round" stroke-linejoin="round" d="M19.5 8.25l-7.5 7.5-7.5-7.5" /></svg>');
    display: inline-block;
    width: 1rem;
    height: 1rem;
    transition: transform 0.3s ease;
}

.profile-request-container.active .request-button::after {
    transform: rotate(180deg);
}

.profile-request-container .dropdown-menu {
    left: auto;
    right: 0;
    min-width: 200px;
    z-index: 100;
    padding: 0;
}

.profile-request-container .dropdown-menu li {
    list-style: none;
    border-bottom: 1px solid #2a2a2a;
    transition: background-color 0.2s ease;
}

.profile-request-container .dropdown-menu li:last-child {
    border-bottom: none;
}

.profile-request-container .dropdown-menu a {
    color: #9ca3af;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.profile-request-container .dropdown-menu a:hover {
    background-color: #1f2937;
    color: #3b82f6;
    transform: translateX(5px);
}


/* === DASHBOARD SPECIFIC STYLES === */
.dashboard-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-top: 0;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    color: #f9fafb;
    position: relative;
    letter-spacing: -0.05em;
}

.dashboard-header h1::after {
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #9333ea);
    margin: 0.5rem auto 0;
    border-radius: 2px;
    animation: pulse 2s infinite ease-in-out;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(59, 130, 246, 0.4);
}

.card::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title.dashboard {
    font-size: 1rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0;
}

.card-icon {
    color: #3b82f6;
    width: 1.5rem;
    height: 1.5rem;
}

.card-value {
    font-size: 3rem;
    font-weight: 700;
    color: #f9fafb;
    margin-top: 1rem;
    animation: slideIn 0.8s ease-out;
}

.card-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.trend-up {
    color: #4ade80;
}

.trend-down {
    color: #f87171;
}

.trend-stable {
    color: #9ca3af;
}

.chart-card {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.progress-circle-container {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1.5rem;
    background: conic-gradient(
        #9333ea 0deg,
        #3b82f6 75%,
        rgba(42, 42, 42, 0.5) 75%,
        rgba(42, 42, 42, 0.5) 100%
    );
    border-radius: 50%;
    animation: rotateGradient 4s linear infinite;
}

.progress-circle-container::before {
    content: "";
    position: absolute;
    width: 160px;
    height: 160px;
    background-color: #151515;
    border-radius: 50%;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.progress-circle-text {
    position: relative;
    font-size: 2.8rem;
    font-weight: 600;
    color: #f9fafb;
    z-index: 1;
}

.chart-description {
    margin-top: 1rem;
    font-size: 1rem;
    color: #9ca3af;
}

.bar-chart-card {
    grid-column: 1 / -1;
}

.bar-chart-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 150px;
    gap: 1rem;
    padding-top: 1rem;
}

.bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 15%;
    position: relative;
}

.bar {
    width: 100%;
    background-color: #3b82f6;
    border-radius: 6px 6px 0 0;
    transition: height 0.5s ease-out;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
    animation: barRise 1.5s ease-in-out forwards;
}

.bar-label {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

.recent-activity-card {
    grid-column: 1 / -1;
}

.activity-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0 0;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem;
    border-bottom: 1px solid #2a2a2a;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background-color: rgba(59, 130, 246, 0.1);
    transform: scale(1.02);
}

.activity-icon {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background-color: rgba(59, 130, 246, 0.2);
}

.activity-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    color: #3b82f6;
}

.activity-content {
    flex-grow: 1;
}

.activity-title {
    font-size: 1rem;
    font-weight: 500;
    color: #f9fafb;
    margin: 0;
}

.activity-details {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

.activity-time {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: #6b7280;
}

.member-list-card {
    grid-column: 1 / -1;
}

.member-list-container {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* === GLOBAL SORT BUTTON STYLE (FIX) === */
.sort-button {
    background: transparent;
    border: none;
    color: #9ca3af; /* Default text color matches headers */
    font-family: inherit;
    font-size: 0.75rem; /* Matches header font size */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem; /* Add touch target area */
    transition: all 0.3s ease;
}

.sort-button:hover,
.sort-button.active {
    color: #f9fafb;
}

.sort-button .sort-icon {
    width: 1rem;
    height: 1rem;
    opacity: 0.3;
    transition: all 0.3s ease;
}

.sort-button:hover .sort-icon {
    opacity: 0.7;
    transform: translateY(-1px);
}

.sort-button.active .sort-icon {
    opacity: 1;
    color: #3b82f6;
}

.sort-button.sort-asc .sort-icon {
    transform: rotate(180deg);
}
.sort-button.sort-desc .sort-icon {
    transform: rotate(0deg);
}

/* Specific Header Layouts that use Sort Buttons */
.member-list-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    padding: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(42, 42, 42, 0.5);
    transition: all 0.3s ease;
}

.roster-list-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    padding: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(42, 42, 42, 0.5);
    transition: all 0.3s ease;
}

/* Row Items matching headers */
.member-list-item,
.roster-list-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    align-items: center;
    padding: 1rem;
    border-radius: 0.5rem;
    background-color: rgba(21, 21, 21, 0.5);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    color: inherit;
}

.member-list-item:hover,
.roster-list-item:hover {
    background-color: rgba(21, 21, 21, 0.8);
    border: 1px solid rgba(42, 42, 42, 0.8);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.member-list-item:nth-of-type(even),
.roster-list-item:nth-of-type(even) {
    background-color: rgba(21, 21, 21, 0.2);
}

.member-name {
    font-weight: 600;
    color: #f9fafb;
    transition: color 0.3s ease;
}

/* === STYLED LINKS FOR TITLES === */
.card-title a.styled-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.card-title a.styled-link:hover {
    color: #3b82f6;
}

/* NEW STYLES for Clan Details */
.clan-details-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.clan-details-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #9ca3af;
}

.clan-details-list .detail-label {
    font-weight: 600;
    color: #f9fafb;
}

.clan-details-list .detail-value {
    flex-grow: 1;
    text-align: right;
    color: #e5e7eb;
}

/* NEW STYLES for Allies */
.allies-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ally-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-radius: 0.5rem;
    background-color: rgba(21, 21, 21, 0.7);
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(42, 42, 42, 0.5);
}

.ally-item:hover {
    transform: translateY(-3px);
    background-color: rgba(21, 21, 21, 0.85);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.ally-name {
    font-weight: 600;
    color: #f9fafb;
}

.ally-members {
    font-size: 0.875rem;
    color: #9ca3af;
}


/* === TEAM AREA STYLES (Restored) === */
.teams-card {
    padding: 2rem;
}

.team-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.team-item {
    background-color: rgba(21, 21, 21, 0.5);
    border: 1px solid rgba(42, 42, 42, 0.5);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.team-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(42, 42, 42, 0.5);
    padding-bottom: 1rem;
}

.team-header h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f9fafb;
    margin: 0;
}

.team-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #3b82f6;
    flex-shrink: 0;
}

/* Team specific Member Lists */
.team-members-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(42, 42, 42, 0.5);
    padding-bottom: 1rem;
}

.sortable-members {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
}

.team-members-list li, .sortable-members li {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    align-items: center;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: #c0c0c0;
    transition: background-color 0.3s ease, transform 0.3s ease;
    border-radius: 0.5rem;
    cursor: pointer;
}

/* Hover effect */
.team-members-list li:hover, .sortable-members li:hover {
    background-color: rgba(59, 130, 246, 0.1);
    transform: translateX(5px);
}

/* Fixed leader and co-leader styling */
.team-leader {
    background-color: rgba(245, 158, 11, 0.2) !important;
    color: #f59e0b;
    font-weight: 700;
}

.co-leader {
    background-color: rgba(59, 130, 246, 0.2) !important;
    color: #3b82f6;
    font-weight: 600;
}

.member-name {
    font-weight: 500;
    color: #f9fafb;
}

.member-role {
    font-style: italic;
    color: #9ca3af;
}

.member-status {
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.member-status.active {
    background-color: rgba(76, 209, 55, 0.2);
    color: #4ade80;
}

.member-status.inactive {
    background-color: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

.member-status.on-leave {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}
/* === SIGN IN SPECIFIC STYLES === */

/* Updated Container for Split Screen */
.split-screen-container {
    display: flex;
    flex-grow: 1; 
    min-height: 0; 
    width: 100%;
}

.left-visual-panel {
    flex: 1 1 50%;
    overflow-y: auto; 
    background: url('https://placehold.co/800x1200/1a1a1a/e5e7eb?text=Connect+%26+Compete') no-repeat center center/cover;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 4rem;
    box-shadow: inset -10px 0 30px rgba(0, 0, 0, 0.5);
}

.left-visual-content {
    color: #f9fafb;
    text-align: center;
    z-index: 10;
    max-width: 80%;
}

.left-visual-content h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.7);
    line-height: 1.2;
}

.left-visual-content p {
    font-size: 1.1rem;
    color: #c0c0c0;
    line-height: 1.5;
}

.right-form-panel {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background-color: #0d0d0d;
    overflow-y: auto; 
}

.signin-container {
    width: 100%;
    max-width: 450px; 
    margin: 0; 
    padding: 0;
    text-align: center;
}

.signin-card {
    background-color: rgba(21, 21, 21, 0.9);
    border: 1px solid rgba(42, 42, 42, 0.5);
    border-radius: 1rem; 
    padding: 2.5rem;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transition: all 0.5s ease;
    position: relative;
    overflow: hidden;
}

.signin-card:hover {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8), 0 0 25px rgba(59, 130, 246, 0.4);
    transform: none; 
}

.signin-card::before {
    /*content: '';*/
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    opacity: 0.3;
    transition: opacity 0.5s ease;
    z-index: 0;
}

.signin-card:hover::before {
    opacity: 0.5;
}

.signin-title {
    font-size: 2rem;
    font-weight: 700;
    color: #f9fafb;
    margin-bottom: 0.5rem;
    z-index: 1;
    position: relative;
}

.signin-subtitle {
    font-size: 1rem;
    color: #9ca3af;
    margin-bottom: 2rem;
    z-index: 1;
    position: relative;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
    z-index: 1;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #f9fafb;
}

.form-group input,
.form-group select { 
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #0d0d0d;
    border: 1px solid #2a2a2a;
    border-radius: 0.5rem;
    color: #f9fafb;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;

    appearance: none; 
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="%239ca3af" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M19.5 8.25l-7.5 7.5-7.5-7.5" /></svg>');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    cursor: pointer;
}

.form-group input:focus,
.form-group select:focus { 
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

.submit-button {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #f9fafb;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    background: linear-gradient(90deg, #3b82f6 0%, #9333ea 100%); 
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-top: 1rem;
    z-index: 1;
    position: relative;
}

.submit-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.7);
}

.forgot-password {
    display: block;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s ease;
    z-index: 1;
    position: relative;
}

.forgot-password:hover {
    color: #3b82f6;
}

/* === Multi-Step Form Logic Fixes === */
.form-step {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.form-step.active {
    display: block; 
    opacity: 1;
}

/* === MODAL STYLES (COMMON) === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

.modal-overlay.visible {
    visibility: visible;
    opacity: 1;
}

.modal-box {
    background-color: #151515;
    border-radius: 1rem;
    border: 1px solid rgba(42, 42, 42, 0.5);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    padding: 2rem;
    width: 90%;
    max-width: 600px; 
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    max-height: 80vh; 
    overflow-y: auto;
}

.modal-overlay.visible .modal-box {
    transform: translateY(0);
}

.modal-content {
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f9fafb;
    margin: 0 0 0.5rem 0;
}

.modal-message {
    font-size: 1rem;
    color: #c0c0c0;
    margin: 0;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-button {
    flex-grow: 1;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.modal-button.modal-cancel {
    background-color: #424242;
    color: #f9fafb;
}

.modal-button.modal-yes {
    background-color: #3b82f6;
    color: white;
}

.modal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.modal-button.modal-yes:hover {
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

/* Styles specific to the textarea in the Post modals */
.modal-textarea:focus {
    border-color: #3b82f6 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5) !important;
}

/* NEW: Styles for the Report Modal */
.modal-report-post .modal-box {
    padding: 1.5rem; 
}
.modal-report-post .modal-content {
    text-align: left;
}

/* Styles for radio buttons in report form */
.report-reasons input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid #3b82f6;
    border-radius: 50%;
    margin: 0;
    vertical-align: middle;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

.report-reasons input[type="radio"]:checked {
    background-color: #f87171; 
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.3);
}

/* Style for action buttons in report success state */
.report-success-content .action-button {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    color: white;
    box-shadow: none;
}
.report-success-content .action-button:hover {
    transform: translateY(-3px);
}
.report-success-content .block-user:hover {
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}
.report-success-content .unfollow-user:hover {
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}


/* Battle History Container fixes */
.battle-history-container {
    padding: 1.5rem;
    overflow: hidden;
}
.scroll-container {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
    margin-top: 1rem;
}
.scroll-container::-webkit-scrollbar {
    height: 8px;
}
.scroll-container::-webkit-scrollbar-thumb {
    background-color: #3b82f6;
    border-radius: 4px;
}
.battle-card {
    min-width: 250px;
    background-color: rgba(21, 21, 21, 0.7);
    border: 1px solid rgba(42, 42, 42, 0.5);
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
}
.battle-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}
.battle-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}
.battle-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.team-label {
    font-size: 1.25rem;
    font-weight: 600;
    color: #e5e7eb;
}
.winner-team {
    color: #3b82f6;
    font-weight: 700;
}
.vs-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
}
.battle-score {
    font-size: 2rem;
    font-weight: 700;
    color: #4ade80;
}

/* === SEARCH & FILTER STYLES (NEW) === */
.search-grid {
    display: grid;
    grid-template-columns: 1fr 3fr; 
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
}

.filter-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 6rem; /* Keeps sidebar visible while scrolling */
    height: fit-content;
}

.filter-card {
    padding: 1.5rem;
}

/* Checkbox Groups */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.5rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #c0c0c0;
    cursor: pointer;
    transition: color 0.3s ease;
}

.checkbox-group input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid #3b82f6;
    border-radius: 4px;
    margin-right: 0.5rem;
    cursor: pointer;
    background-color: #0d0d0d;
    position: relative;
}

.checkbox-group input[type="checkbox"]:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

/* Search Results Layout */
.results-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.clan-result-card {
    position: relative; 
    overflow: hidden; 
    border-radius: 1rem;
    background-color: rgba(21, 21, 21, 0.7);
    border: 1px solid rgba(42, 42, 42, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex; 
    flex-direction: column; 
}

.clan-result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), 0 0 10px rgba(59, 130, 246, 0.2);
}

.clan-banner-bg {
    width: 100%;
    height: 120px; 
    background-position: center top; 
    background-size: cover;
    border-radius: 1rem 1rem 0 0; 
    position: relative;
    z-index: 1;
    box-shadow: inset 0 -40px 50px rgba(0, 0, 0, 0.8);
}

.clan-content-wrapper {
    display: flex;
    align-items: flex-start; 
    gap: 1.5rem;
    padding: 1.5rem; 
    position: relative; 
    z-index: 2; 
    background-color: rgba(21, 21, 21, 0.8); 
    border-radius: 0 0 1rem 1rem; 
    margin-top: -30px; 
    padding-top: 1rem; 
}

.clan-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #3b82f6;
    flex-shrink: 0;
    margin-top: -20px; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    object-fit: cover;
}

.clan-name-tag {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f9fafb;
    line-height: 1.2;
}

.clan-tag {
    font-size: 0.875rem;
    color: #9ca3af;
    font-style: italic;
}

.clan-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    color: #c0c0c0;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #4ade80; 
}

.create-clan-button {
    background: linear-gradient(90deg, #f59e0b 0%, #ef4444 100%);
    color: white;
    padding: 1.5rem 2rem;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 0.75rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block; 
    text-decoration: none;
}

.create-clan-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.7);
}

/* Modal Open Button */
.modal-open-button {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #0d0d0d;
    border: 1px solid #2a2a2a;
    border-radius: 0.5rem;
    color: #f9fafb;
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-open-button:hover {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.5);
}

.modal-open-button .count {
    font-weight: 700;
    background-color: #3b82f6;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.85rem;
}

/* Selected Games Chips */
.selected-games-display {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.5rem 0;
    border-top: 1px solid #2a2a2a;
    border-bottom: 1px solid #2a2a2a;
    min-height: 20px;
}

.game-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer; 
}

/* Game Modal Grid */
.game-list-container {
    max-height: 400px; 
    overflow-y: auto;
    padding-right: 10px; 
    margin-top: 1rem;
    padding-top: 1rem;
}

#game-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); 
    gap: 1rem;
}

.game-list-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-radius: 0.75rem;
    background-color: rgba(21, 21, 21, 0.7);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    position: relative;
    padding: 0; 
    overflow: hidden;
    border: 2px solid transparent;
}

.game-list-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    border-color: #3b82f6;
}

.game-list-item.selected {
    border-color: #4ade80; 
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.5);
}

.game-item-content {
    display: block;
    width: 100%;
    padding: 0;
    text-decoration: none;
    color: inherit;
    position: relative;
    z-index: 2;
}

.game-icon-bg {
    width: 100%;
    height: 80px;
    background-size: cover;
    background-position: center;
    border-radius: 0.75rem 0.75rem 0 0;
    position: relative;
}

.game-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f9fafb;
    padding: 0.75rem 0.5rem;
    width: 100%;
    background-color: rgba(21, 21, 21, 0.9);
    border-radius: 0 0 0.75rem 0.75rem;
}

.selection-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(59, 130, 246, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
    pointer-events: none; 
}

.game-list-item.selected .selection-overlay {
    opacity: 1;
}

.selection-overlay svg {
    width: 3rem;
    height: 3rem;
    color: #4ade80;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    padding: 0.5rem;
}

.game-list-item input[type="checkbox"] {
    display: none;
}

/* === NEW ADVANCED FILTERS STYLES (Defaults) === */
.advanced-filters-toggle {
    display: none; /* Hidden on desktop */
}
.advanced-filters-container {
    display: block; /* Always visible on desktop */
}

/* === ANIMATIONS === */
@keyframes pulse {
    0% { transform: scaleX(1); opacity: 0.8; }
    50% { transform: scaleX(1.1); opacity: 1; }
    100% { transform: scaleX(1); opacity: 0.8; }
}

@keyframes slideIn {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes rotateGradient {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes barRise {
    from { height: 0; }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === MEDIA QUERIES FOR RESPONSIVENESS === */
@media (min-width: 769px) { 
    .social-grid {
        grid-template-columns: 1fr 2fr;
    }
    .grid-container.three-column {
        grid-template-columns: repeat(3, 1fr);
    }
    #mobile-menu-toggle {
        display: none;
    }
    
    .nav-menu {
        position: static; 
        flex-direction: row;
        width: auto;
        height: auto;
        padding: 0;
        transition: none;
        transform: none;
        z-index: auto;
        overflow-y: visible; 
    }
    
    .main-nav-links-wrapper {
        display: flex;
        align-items: center;
        gap: 2rem;
        width: auto;
        transition: none;
        transform: none;
    }
    
    .nav-menu > .main-nav-links-wrapper > ul {
        display: flex;
        flex-direction: row;
        gap: 1.5rem;
    }
    
    .site-header {
        flex-direction: row;
        gap: 2rem;
        justify-content: space-between; 
    }
    
    .user-menu-container {
        list-style: none;
        padding: 0;
    }
    
    .site-utilities {
        display: flex;
        align-items: center;
        gap: 1rem;
        flex-shrink: 0;
    }

    .notification-container,
    .user-menu-container {
        width: auto; 
    }
}

/* Mobile Breakpoint (<= 768px) */
@media (max-width: 768px) {
    body {
        padding: 1rem;
        overflow-x: hidden; 
        display: block;
    }
    
    #mobile-menu-toggle {
        display: flex;
        background: none;
        border: none;
        color: #f9fafb;
        padding: 0.5rem;
        cursor: pointer;
        z-index: 210; 
        order: 3; 
    }
    #mobile-menu-toggle svg {
        width: 1.5rem;
        height: 1.5rem;
        transition: transform 0.3s ease;
    }
    #mobile-menu-toggle.active svg {
        transform: rotate(90deg); 
    }

    .site-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        max-width: none;
        margin: 0 auto 1.5rem auto; 
        padding: 1rem 0;
        gap: 0.5rem;
        z-index: 100; 
    }

    .site-header .logo {
        order: 1; 
    }
    
    .site-utilities {
        order: 2; 
        gap: 0.5rem;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0; 
        width: 100vw;
        background-color: #0d0d0d;
        z-index: 200; 
        transform: translateX(100%); 
        transition: transform 0.4s ease-in-out;
        overflow-y: auto; 
        height: 100vh;
        display: flex; 
        flex-direction: column;
    }
    
    .nav-menu.menu-open {
        transform: translateX(0); 
        overflow-y: auto;
    }
    
    .main-nav-links-wrapper {
        min-height: calc(100vh - 60px - 2rem); 
        box-sizing: border-box;
        overflow-y: visible; 
        display: flex; 
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        padding: 60px 2rem 2rem 2rem; 
        gap: 1.5rem;
    }

    .main-nav-links-wrapper > ul {
        display: flex;
        flex-direction: column; 
        width: 100%;
        padding-bottom: 1rem;
        border-bottom: 1px solid rgba(42, 42, 42, 0.5);
        margin: 0;
    }
    
    .main-nav-links-wrapper > ul li {
        list-style-type: none !important; 
    }

    .main-nav-links-wrapper > ul a {
        font-size: 1.25rem;
        padding: 0.75rem 0;
    }

    .notification-container,
    .user-menu-container {
        position: static;
        width: auto; 
    }
    
    .user-menu-container .user-menu-toggle {
        width: auto;
        padding: 0.5rem;
    }
    
    .notification-dropdown {
        position: fixed;
        top: 60px; 
        bottom: 0;
        height: calc(100vh - 60px); 
        width: 95vw; 
        max-width: 400px;
        right: 50%;
        left: 50%;
        transform: translateX(-50%) scale(0.95);
        transform-origin: top center;
        padding: 1.5rem;
        border-radius: 0.5rem;
    }

    .notification-dropdown.active {
        transform: translateX(-50%) scale(1);
    }
    
    .profile-banner {
        height: 200px;
        border-radius: 0.75rem;
    }

    .social-grid {
        grid-template-columns: 1fr;
        margin-top: 5rem;
    }
    
    .member-spotlight-list {
        grid-template-columns: 1fr;
    }
    
    .battle-teams {
        flex-direction: row; 
        justify-content: space-around;
        width: 100%;
    }
    .battle-teams .vs {
        font-size: 0.9rem; 
    }
    .battle-score {
        font-size: 1.25rem; 
    }

    .clan-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    /* Search Page Mobile Adjustments */
    .search-grid {
        grid-template-columns: 1fr;
        width: 100%; 
        max-width: none; 
        margin: 1rem auto;
        padding: 0 0;
    }
    .filter-sidebar {
        width: 100%;
        position: static; 
        height: auto;
    }
    .filter-card {
        padding: 1.5rem;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    .clan-content-wrapper {
        flex-direction: column; 
        align-items: center;
        text-align: center;
        gap: 0.5rem;
        width: 100%;
        box-sizing: border-box;
    }
    .clan-logo {
        margin-top: -50px; 
    }
    .clan-stats {
        justify-content: center; 
        flex-wrap: wrap; 
        width: 100%; 
    }
    .form-group input,
    .form-group select {
        width: 100%;
        min-width: 0;
    }

    .member-list-header {
        display: none;
    }
    .member-list-item {
        grid-template-columns: 2fr 1fr 1fr;
        gap: 0.5rem;
        font-size: 0.875rem;
    }
    
    .post-header {
        align-items: center;
    }
    .post-meta-area {
        align-items: center;
    }
    .post-options-menu {
        right: 0;
        top: 90%; 
    }
    
    .split-screen-container {
        flex-direction: column; 
        min-height: auto; 
        flex-grow: 0;
    }
    .left-visual-panel {
        min-height: 250px; 
        padding: 2rem;
        flex: 0 0 auto; 
    }
    .left-visual-content h2 {
        font-size: 2rem;
    }
    .right-form-panel {
        flex: 1 1 auto; 
        padding: 1rem;
        overflow-y: visible; 
        justify-content: flex-start;
    }
    .signin-container {
        max-width: 100%;
    }
    
    .profile-details h2 {
        font-size: 1.75rem;
    }
    .profile-avatar {
        width: 80px;
        height: 80px;
        transform: translateY(10px);
    }
    .profile-info-overlay {
        left: 10px;
        bottom: 10px;
    }

    .nav-menu.menu-open .dropdown-menu {
        position: static;
        width: 100%; 
        min-width: unset; 
        background-color: transparent; 
        border: none;
        box-shadow: none;
        transform: none;
        opacity: 1; 
        visibility: visible;
        padding: 0 0 0 1rem; 
        margin-top: 0.5rem;
    }

    .nav-menu.menu-open .dropdown-menu a {
        font-size: 1.15rem; 
        padding: 0.5rem 0.75rem; 
    }

    .nav-menu.menu-open .dropdown-menu li {
        border-bottom: 1px dashed rgba(42, 42, 42, 0.5); 
    }
    
    .nav-menu.menu-open .user-dropdown-menu {
        border: none;
        padding: 1rem 0;
        margin-top: 1rem;
    }
    
    .nav-menu.menu-open .user-dropdown-menu a {
        font-size: 1.25rem;
        padding: 0.75rem 0;
    }
    
    .nav-menu.menu-open .dropdown-footer {
        border-top: none; 
        padding-top: 0;
    }

    /* === MOBILE SPECIFIC ADVANCED FILTER STYLES === */
    /* 1. Show the toggle button on mobile */
    .advanced-filters-toggle {
        display: flex; /* Show flex on mobile */
        align-items: center;
        justify-content: space-between;
        width: 100%;
        background-color: transparent;
        border: 1px solid rgba(42, 42, 42, 0.5);
        border-radius: 0.5rem;
        color: #9ca3af;
        padding: 0.75rem 1rem;
        margin-bottom: 1rem;
        cursor: pointer;
        font-size: 0.95rem;
        font-weight: 500;
        transition: all 0.3s ease;
    }
    
    .advanced-filters-toggle:hover {
        background-color: rgba(21, 21, 21, 0.5);
        color: #f9fafb;
    }

    .advanced-filters-toggle svg {
        width: 1.25rem;
        height: 1.25rem;
        transition: transform 0.3s ease;
    }

    .advanced-filters-toggle.active svg {
        transform: rotate(180deg);
    }

    /* 2. Hide the container by default on mobile */
    .advanced-filters-container {
        display: none; /* Hide on mobile by default */
        padding-top: 0.5rem;
        border-top: 1px solid rgba(42, 42, 42, 0.5);
        margin-top: 0.5rem;
        animation: slideDown 0.3s ease-out;
    }

    /* 3. Show the container when 'open' class is added via JS */
    .advanced-filters-container.open {
        display: block;
    }
}

/* Added for extra small screens/devices */
@media (max-width: 500px) {
    .signin-container {
        padding: 0.5rem;
        margin-top: 0;
    }
    .signin-card {
        padding: 1.5rem;
    }
    .left-visual-panel {
        padding: 1rem;
    }
    .left-visual-content h2 {
        font-size: 1.5rem;
    }
}