
/* ===============================
   🌞🌚 THEME VARIABLES & BASE
   =============================== */

   :root {
	--bg: #ffffff;
	--text: #222222;
	--card-bg: #fff;
	--border-color: #ddd;
  }
  
  body.dark-mode {
	--bg: #121212;
	--text: #eeeeee;
	--card-bg: #1e1e1e;
	--border-color: #444;
	--text-muted: #aaaaaa;
	--text-accent: #007bff;
	--points-color: #ffd700; /* gold */	
  }
  
  body.dark-mode .battle-name {
	color: #fff;
	font-weight: bold;
  }
  

  body {
	background-color: var(--bg);
	color: var(--text);
  }
  
  /* ===============================
	 🔁 THEME-ENABLED ELEMENTS
	 =============================== */
  
  .card,
  .clan-results,
  .clan-battle-box,
  .battle-item,
  .clan-details-box,
  .speech-bubble,
  .discord-box {
	background-color: var(--card-bg) !important;
	color: var(--text) !important;
	border-color: var(--border-color) !important;
  }
  
  .battle-description,
  .battle-dates,
  .status-meta,
  .card-content .username {
	color: var(--text);
  }
  

  /* ===============================
	 🌙 THEME TOGGLE SWITCH
	 =============================== */
  
  .theme-toggle {
	position: fixed;
	top: 10px;
	right: 10px;
	z-index: 9999;
  }
  
  .switch {
	position: relative;
	display: inline-block;
	width: 50px;
	height: 26px;
  }
  
  .switch input {
	opacity: 0;
	width: 0;
	height: 0;
  }
  
  .slider {
	position: absolute;
	top: 0; left: 0; right: 0; bottom: 0;
	background-color: #ccc;
	border-radius: 34px;
	cursor: pointer;
	transition: 0.4s;
  }
  
  .slider:before {
	content: "";
	position: absolute;
	height: 18px;
	width: 18px;
	left: 4px;
	bottom: 4px;
	background-color: white;
	border-radius: 50%;
	transition: 0.4s;
  }
  
  input:checked + .slider {
	background-color: #2196f3;
  }
  
  input:checked + .slider:before {
	transform: translateX(24px);
  }
  

/* General Styles */
body {
	font-family: 'Rubik', Arial, sans-serif;
	margin: 20px;
}

h1,
h3,
p {
	font-family: 'Rubik', Arial, sans-serif;
}


#loading {
	text-align: center;
	font-size: 18px;
}

.hidden {
	display: none;
}

/* Clan Header */
.clan-header {
	display: flex;
	align-items: center;
	margin-bottom: 20px;
	gap: 16px;
	justify-content: center;
}

.clan-icon {
	width: 150px;
	height: 150px;
	border-radius: 8px;
	object-fit: cover;
}

/* Card Container */
.card-container {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	padding: 16px;
	justify-content: center;
}

/* Individual Card */
.card {
	border: 1px solid #ddd;
	border-radius: 8px;
	background-color: #fff;
	width: 300px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 16px;
}

/* Avatar Image */
.avatar {
	width: 100px;
	height: 100px;
	border-radius: 50%;
	margin-top: 16px;
	object-fit: cover;
	background-color: #f0f0f0;
	border: 3px solid #ddd;
	/* Add a subtle border */
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
	/* Add a soft shadow */
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	/* Smooth transition on hover */
}

.avatar:hover {
	transform: scale(1.05);
	/* Slightly enlarge on hover */
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
	/* Enhance shadow on hover */
}

#cardContainer {
	display: flex;
	/* Use flexbox to align cards */
	flex-wrap: wrap;
	/* Allow wrapping to a new row */
	gap: 16px;
	/* Add spacing between cards */
	justify-content: center;
	/* Center align the cards */
	margin-top: 20px;
}

.card {
	flex: 0 1 calc(300px - 16px);
	/* Make cards responsive with a fixed width */
	max-width: 300px;
	border: 1px solid #ddd;
	border-radius: 8px;
	background-color: #fff;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 16px;
}


/* Card Content */
.card-content {
	text-align: center;
	width: 100%;
}

/* Display Name Link */
.card-content h3 a {
	color: var(--text);
	text-decoration: none;
	font-size: 1.5rem;
	font-weight: bold;
}

.card-content h3 a:hover {
	color: #007bff;
}

/* Username */
.card-content .username {
	font-size: 0.9rem;
	color: #666;
	margin: -8px 0 8px 0;
}

/* Permission Level Styles */
.card-content .permission-level {
	display: inline-block;
	padding: 8px 12px;
	border-radius: 20px;
	font-size: 0.9rem;
	margin-bottom: 8px;
	color: white;
	font-weight: bold;
}

.card-content .permission-level.member {
	background-color: #007bff;
	/* Blue */
}

.card-content .permission-level.officer {
	background-color: #28a745;
	/* Green */
}

.card-content .permission-level.owner {
	background-color: #dc3545;
	/* Red */
}

/* Icons */
.card-content .icon {
	width: 25px;
	height: 25px;
	vertical-align: middle;
	margin-right: 5px;
}


.card-content .icon.large-icon {
	width: 30px;
	/* Larger for Roblox.svg */
	height: 30px;
}

/* Description in Speech Bubble */
.card-content .description {
	display: inline-block;
	background-color: #f9f9f9;
	padding: 10px 15px;
	border-radius: 20px;
	font-size: 0.9rem;
	color: #333;
	margin-top: 16px;
}

/* Optional: Custom Tooltip */
.card-content p[title] {
	position: relative;
	cursor: pointer;
}

.card-content p[title]:hover::after {
	content: attr(title);
	position: absolute;
	bottom: 100%;
	/* Show above the element */
	left: 50%;
	transform: translateX(-50%);
	background-color: #333;
	color: #fff;
	padding: 5px 10px;
	border-radius: 4px;
	white-space: nowrap;
	font-size: 0.85rem;
	z-index: 10;
}

.spinner {
	width: 24px;
	height: 24px;
	border: 4px solid #f3f3f3;
	border-top: 4px solid #3498db;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	display: inline-block;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(360deg);
	}
}

.medal-icon {
	width: 30px !important;
	height: 30px !important;
	position: relative;
	cursor: pointer;
	display: block;
	margin: 0 auto;
  }
  


.medal-icon.transparent {
	opacity: 0.6;
	/* Adjust transparency */
}


/* Tooltip Wrapper */
.tooltip-container {
	position: relative;
	display: inline-block;
	/* Ensure the tooltip wraps only the icon */
}

.tooltip-container .tooltip {
	display: none;
	position: absolute;
	bottom: 125%;
	/* Position above the element */
	left: 50%;
	transform: translateX(-50%);
	background-color: #333;
	/* Dark background */
	color: #fff;
	/* White text */
	font-size: 14px;
	/* Adjust font size */
	font-weight: 400;
	/* Normal font weight */
	padding: 8px 12px;
	/* Add padding for better spacing */
	border-radius: 8px;
	/* Rounded corners */
	text-align: center;
	/* Center-align text */
	white-space: nowrap;
	/* Prevent text wrapping */
	z-index: 1000;
	/* Ensure it appears on top */
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	/* Add subtle shadow */
}

.tooltip-container .tooltip::after {
	content: '';
	position: absolute;
	top: 100%;
	/* Arrow at the bottom of the tooltip */
	left: 50%;
	transform: translateX(-50%);
	border-width: 8px;
	border-style: solid;
	border-color: #333 transparent transparent transparent;
	/* Arrow color matches tooltip background */
}

/* Show Tooltip on Hover */
.tooltip-container:hover .tooltip {
	display: block;
}

/* Clan Battle Participation Box */
.clan-battle-box {
	border: 1px solid #ddd;
	/* Light border */
	border-radius: 12px;
	/* Rounded corners */
	background-color: #f9f9f9;
	/* Light gray background */
	padding: 20px 16px;
	/* Equal top/bottom padding */
	margin-top: 20px;
	/* Space above the box */
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
	/* Subtle shadow */
}

/* Title for Clan Battle Box */
.clan-battle-box h4 {
	font-size: 1rem;
	font-weight: bold;
	text-align: center;
	margin: 0 0 12px 0;
	/* No gap above, small gap below */
	color: var(--text);
	/* Dark text color */
}

/* Medals Container */
.medals-container {
	display: grid;
	grid-template-columns: repeat(6, 1fr); /* 8 equal columns */
	gap: 4px; /* Adjusted gap for better spacing */
	justify-content: center;
	align-items: center; /* Ensures vertical alignment */
	text-align: center;
	padding: 0;
  }
  
  

.transparent-icon {
	opacity: 0.5;
	/* Adjust transparency */
	filter: grayscale(100%);
	/* Apply greyscale filter */
	transition: all 0.3s ease;
	/* Smooth hover transition */
	width: 20px;
	height: 20px;
	margin: 0 auto;
	/* Center horizontally */
	display: block;
	/* Inherits block behavior */
	padding: 3px;
	/* Adds consistent spacing around the icon */
	box-sizing: content-box;
	/* Ensures padding doesn't affect width/height */
}

/* Tooltip Styling */
.speech-bubble {
	background-color: #f9f9f9;
	padding: 10px 15px;
	border-radius: 15px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	font-size: 1rem;
	color: #333;
	text-align: center;
	position: relative;
	cursor: pointer;
}

.speech-bubble[title]:hover::after {
	content: attr(title);
	position: absolute;
	top: -35px;
	/* Adjusts tooltip position above */
	left: 50%;
	transform: translateX(-50%);
	background-color: #333;
	color: #fff;
	font-size: 0.85rem;
	padding: 5px 8px;
	border-radius: 4px;
	white-space: nowrap;
	z-index: 10;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.speech-bubble[title]:hover::before {
	content: '';
	position: absolute;
	top: -10px;
	left: 50%;
	transform: translateX(-50%);
	border-width: 5px;
	border-style: solid;
	border-color: transparent transparent #333 transparent;
	z-index: 10;
}

/* Status Container */
.status-container {
	display: flex;
	align-items: center;
	/* Align items vertically */
	gap: 10px;
	/* Add spacing between the speech bubble and the Discord circle */
	margin-top: 10px;
	/* Space between the description and the status */
}

/* Metadata for Status */
.status-meta {
	font-size: 0.85rem;
	color: #555;
	margin-top: 5px;
	padding-left: 5px;
}

/* Clan Title Section */

.clan-title-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	/* Ensures text inside is also centered */
	gap: 20px;
	/* Space between the sections */
	margin: 20px 0;
	/* Adjust spacing above and below */
}

.clan-top-section {
	display: flex;
	align-items: center;
	/* Vertically align icon and details */
	justify-content: center;
	/* Center the whole section */
	gap: 20px;
	margin-bottom: 20px;
	/* Add spacing below the top section */
}

.clan-icon {
	width: 150px;
	height: 150px;
	border-radius: 8px;
	object-fit: cover;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	margin: 0 auto;
	/* Center the image itself */
}

.clan-info {
	display: flex;
	flex-direction: column;
	align-items: center;
	/* Center-align the name, description, and status */
	gap: 10px;
}

.clan-bottom-section {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	/* Adjust space between each line */
}

.clan-info h1 {
	font-size: 2rem;
	font-weight: bold;
	margin: 0;
}

.clan-desc {
	font-size: 1.2rem;
	color: #666;
	margin: 0;
}

.status-bubble {
	margin-top: 10px;
}

.speech-bubble {
	background-color: #f9f9f9;
	padding: 10px 15px;
	border-radius: 15px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	font-size: 1rem;
	color: #333;
	text-align: center;
	position: relative;
}

.status-meta {
	font-size: 0.85rem;
	color: #555;
	margin-top: 5px;
	text-align: center;
}

/* Bottom Section */
.clan-bottom-section {
	text-align: center;
	/* Center text */
	margin-top: 20px;
	/* Add spacing from the top section */
	line-height: 1.6;
	/* Improve readability */
	font-size: 1rem;
	color: #555;
}

.clan-bottom-section p {
	margin: 5px 0;
	font-size: 1rem;
	color: #333;
}

/* Discord Button Styles */
.discord-icon-inline {
	width: 16px;
	/* Adjust size */
	height: 16px;
	margin-left: 5px;
	vertical-align: middle;
}

.discord-icon-inline:hover {
	transform: scale(1.2);
	/* Slightly enlarge on hover */
}

/* Clan Details Box */
.clan-details-box {
	margin-top: 10px;
	/* Reduce the top margin */
	padding: 12px;
	/* Decrease the padding inside the container */
	border: 1px solid #ddd;
	border-radius: 8px;
	background-color: #f9f9f9;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	text-align: center;
	/* Center-align the text */
}


/* Clan Icon */
.clan-icon {
	width: 150px;
	height: 150px;
	border-radius: 8px;
	object-fit: cover;
	margin-bottom: 10px;
	/* Add spacing below the icon */
	display: flex;
	align-items: center;
	justify-content: center;
}

.clan-name {
	font-size: 3rem;
	font-weight: bold;
	color: #333;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	/* Remove default margins */
}

/* Clan Description */
.clan-desc {
	font-size: rem;
	color: #666;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	/* Space between text and Discord icon */
}

/* Discord Icon Inline */
.discord-icon-inline {
	width: 20px;
	/* Smaller size for the icon */
	height: 20px;
	margin-left: 4px;
	/* Slight spacing from text */
	vertical-align: middle;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.discord-icon-inline:hover {
	transform: scale(1.2);
	/* Slightly enlarge on hover */
	opacity: 0.8;
	/* Add a hover effect */
}


.speech-bubble[title]:hover::after {
	content: attr(title);
	position: absolute;
	top: -35px;
	left: 50%;
	transform: translateX(-50%);
	background-color: #333;
	color: #fff;
	font-size: 0.85rem;
	padding: 5px 8px;
	border-radius: 4px;
	white-space: nowrap;
	z-index: 10;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.speech-bubble[title]:hover::before {
	content: '';
	position: absolute;
	top: -10px;
	left: 50%;
	transform: translateX(-50%);
	border-width: 5px;
	border-style: solid;
	border-color: transparent transparent #333 transparent;
}

.discord-box {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	/* Space between text and icon */
	margin-top: 10px;
	/* Add spacing above */
	padding: 10px 20px;
	border: 1px solid #ddd;
	/* Light border */
	border-radius: 25px;
	/* Rounded corners */
	background-color: #f9f9f9;
	/* Light gray background */
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	/* Subtle shadow */
	font-size: 1rem;
	/* Adjust text size */
	color: #555;
	/* Gray text color */
	text-align: center;
	/* Center-align text */
}

.discord-icon-inline-large {
	width: 24px;
	/* Larger icon */
	height: 24px;
	vertical-align: middle;
	transition: transform 0.2s ease;
	/* Hover effect */
}

.discord-icon-inline-large:hover {
	transform: scale(1.2);
	/* Slightly enlarge on hover */
}

/* Discord Circle */
.discord-circle {
	width: 40px;
	/* Diameter of the circle */
	height: 40px;
	border-radius: 50%;
	/* Make it circular */
	background-color: #f9f9f9;
	/* Background color */
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
	/* Subtle shadow */
	border: 1px solid #ddd;
}

.discord-icon-circle {
	width: 24px;
	/* Icon size */
	height: 24px;
	transition: transform 0.2s ease;
}

.discord-icon-circle:hover {
	transform: scale(1.2);
	/* Slightly enlarge on hover */
}

/* Clan Icon Container */
.clan-icon-container {
	position: relative;
	/* Required for the Discord circle positioning */
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	text-align: center;
}

/* Clan Icon */
.clan-icon {
	width: 150px;
	height: 150px;
	border-radius: 8px;
	object-fit: cover;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Clan Name */
.clan-name {
	font-size: 3rem;
	font-weight: bold;
	margin: 10px 0;
	color: var(--text);
}

.discord-icon-circle:hover {
	transform: scale(1.2);
	/* Slightly enlarge on hover */
}


/* Clan Battle Results Container */
.clan-results {
	display: flex;
	flex-direction: column;
	align-items: center;
	background: #fff;
	padding: 10px;
	border-radius: 12px;
	box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.15);
  }
  
  .clan-results h2 {
	margin-bottom: 8px; /* Reduce space below "Clan Battle Results" */
  }


  
  /* Medals Summary Section */
  .medals-summary {
	display: flex;
	justify-content: center;
	gap: 15px; /* Keeps medals spaced properly */
	margin-bottom: 24px; /* Increase space below medals */
  }

  .medal-item {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 1.8rem;
	font-weight: normal;
	color: var(--text); /* 🔥 use theme-safe text color */
  }
  
  
  .medal-icon {
	width: 30px !important;
	height: 30px !important;
	display: block;
	margin: auto; /* Ensures medal centers inside the grid cell */
  }
  
  
  
  /* Battle Container Grid Layout */
  #battle-container {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 16px; /* Keeps gaps between battle items */
	max-width: 100%;
	margin: 0 auto;
	padding: 0 20px;
	margin-bottom: 40px; /* Adds more space below battle items */
  }
  
  
  /* Battle Item - Consistent Size */
  .battle-item {
	display: flex;
	flex-direction: column;
	height: 100%; /* Full height container */
	align-items: stretch;
	justify-content: space-between;
	background: #fff;
	padding: 16px;
	border-radius: 10px;
	text-align: left;
	min-height: 70px;
	border: 1.5px solid rgba(0, 0, 0, 0.1);
	box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.15);
	transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
	width: 250px; /* Ensures items are same width */
  }
  
  
  
  /* Hover Effect */
  .battle-item:hover {
	transform: translateY(-3px);
	box-shadow: 0px 5px 12px rgba(0, 0, 0, 0.2);
  }
  
  /* Battle Details (Left-Aligned) */
  .battle-details {
	display: flex;
	flex-direction: column;
	justify-content: space-between; /* 👈 This spreads top + bottom */
	height: 100%;                   /* Make it fill .battle-item */
	flex: 1;
  }
  
  .battle-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start; /* 👈 aligns medal with top of text block */
  }
  
  
  
  
  .battle-content {
	display: flex;
	flex-direction: column;
	gap: 4px;
  }
  
  
  .battle-description {
	font-size: 0.85rem;
	font-style: italic;
	color: #666;
	margin-top: 4px;
	margin-bottom: 2px;
  
	display: -webkit-box;
	-webkit-line-clamp: 2;      /* 👈 Limit to 2 lines */
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	min-height: 2.4em;           /* 👈 Reserve height for up to 2 lines */
  }
  
  
  
  

  /* Medal Icon on the Right */
  .battle-medal {
	position: absolute;
	top: 0;
	right: 0;
  }
  
  
  .battle-medal img {
	width: 45px; /* Slightly larger */
	height: 45px;
  }
  
  /* Battle Name */
  .battle-name {
	font-size: 1.15rem;         /* ⬆️ Slightly larger text */
	font-weight: bold;
	display: flex;
	gap: 8px;
	color: var(--text);         /* works in both themes */
	margin-bottom: 6px;         /* ⬇️ More spacing underneath */
  }
  
  
  /* Battle Number */
  .battle-number {
	font-size: 1.15rem; /* Slightly bigger */
	font-weight: normal;
	color: var(--text-muted);
  }
  
  /* Date Styling */
  .battle-dates {
	font-size: 0.9rem;
	color: #666;
  }

  .battle-dates-row {
	position: relative;
	margin: 4px 0 8px 0;
	
  }

  .battle-score {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 1.05rem;
	font-weight: normal;
	margin-top: 4px;
  }
  
  .battle-place {
	font-weight: normal;
	color: var(--text-accent); /* Keeps your blue */
	white-space: nowrap; /* Prevents wrapping */
  }
  
  .battle-points {
	display: flex;
	align-items: center;
	gap: 4px; /* Reduce gap between star icon and number */
	color: var(--points-color); /* Brighter for visibility */
  }
  
  .battle-description {
	font-size: 0.9rem;
	font-style: normal;
	color: #666;
	margin-top: 2px;     /* 👈 Add space above */
	margin-bottom: 4px;  /* Optional: tighten spacing below */
  }
  

  .battle-title-block {
	display: flex;
	flex-direction: column;
	flex: 1;
  }
  
  .battle-rewards {
	display: flex;
	gap: 4px;
	margin: 4px 0 8px 0; /* Top & bottom spacing tightened */
  }
  
  .battle-reward {
	width: 30px;
	height: 30px;
	object-fit: contain;
	border-radius: 4px;
  }
  
  

  .points-icon {
	height: 16px;
	display: inline-block;
	vertical-align: middle;
  }
  
  