
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  font-family: "Inter", sans-serif;
  transition: background 0.5s ease, color 0.3s ease;
  direction: ltr;
}
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(1rem, 5vw, 2rem);
}
body.light {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #333;
}
body.dark {
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  color: #e6e6e6;
}

/* Enhanced Tab Styles */
.tabs {
  display: flex;
  margin-top:60px;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  width: 100%;
  max-width: min(90vw, 1020px);
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 0.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
body.dark .tabs {
  background: rgba(30, 32, 44, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.tab {
  flex: 1;
  min-width: 120px;
  padding: 0.8rem 1rem;
  background: transparent;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  position: relative;
  overflow: hidden;
}
.tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.tab:hover::before {
  opacity: 1;
}
.tab.active {
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}
body.dark .tab.active {
  background: rgba(255, 255, 255, 0.95);
  color: #333;
}

.share-btn {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
  font-weight: 600;
}
.share-btn:hover {
  background-color: #3e9142;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Enhanced Card Design */
.card {
  width: 100%;
  max-width: min(90vw, 1050px);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: clamp(1.5rem, 4vw, 2.8rem);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  animation: fadein 0.6s ease;
  transition: background 0.4s ease, color 0.4s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
@keyframes fadein {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
body.dark .card {
  background: rgba(30, 32, 44, 0.95);
  color: #e6e6e6;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
body.dark .card h1,
body.dark .card .subtitle,
body.dark .card label {
  color: #f0f0f0;
}

h1 {
  text-align: center;
  margin: 0;
  font-weight: 700;
  font-size: clamp(1.5rem, 5vw, 2.4rem);
  color: #111;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
body.dark h1 {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.subtitle {
  text-align: center;
  color: #666;
  font-size: clamp(0.9rem, 3vw, 1.2rem);
  margin: 0.5rem 0 clamp(1rem, 3vw, 2.2rem);
  font-weight: 500;
}

label {
  display: block;
  margin: clamp(0.8rem, 2vw, 1.4rem) 0 0.5rem;
  font-weight: 600;
  color: #333;
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
}

select,
input[type="file"],
input[type="color"],
input[type="number"],
textarea {
  width: 100%;
  padding: clamp(0.5rem, 2vw, 0.8rem) 1rem;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.8);
}
select:focus,
input[type="file"]:focus,
input[type="color"]:focus,
input[type="number"]:focus,
textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
  background: white;
}
body.dark select,
body.dark input[type="file"],
body.dark input[type="color"],
body.dark input[type="number"],
body.dark textarea {
  background: rgba(42, 45, 58, 0.8);
  color: #e0e0e0;
  border: 1px solid #555;
}
body.dark select:focus,
body.dark input[type="file"]:focus,
body.dark input[type="color"]:focus,
body.dark input[type="number"]:focus,
body.dark textarea:focus {
  border-color: #00c6ff;
  box-shadow: 0 0 0 3px rgba(0, 198, 255, 0.2);
  background: rgba(42, 45, 58, 1);
}

button[type="submit"],
.download-btn {
  display: inline-block;
  margin: clamp(1rem, 3vw, 2rem) clamp(0.5rem, 1vw, 1rem) 0 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: clamp(0.6rem, 2vw, 0.8rem) clamp(1.2rem, 2.5vw, 1.8rem);
  border: none;
  border-radius: 12px;
  font-size: clamp(0.8rem, 2.5vw, 0.95rem);
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
button[type="submit"]::before,
.download-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;
}
button[type="submit"]:hover::before,
.download-btn:hover::before {
  left: 100%;
}
button[type="submit"]:hover,
.download-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}
body.dark button[type="submit"],
body.dark .download-btn {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: #fff;
}
body.dark button[type="submit"]:hover,
body.dark .download-btn:hover {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.result {
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
  background: rgba(250, 250, 250, 0.95);
  border-radius: 16px;
  padding: clamp(1rem, 3vw, 1.5rem);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  color: #222;
  transition: background 0.4s ease, color 0.4s ease;
  width: 100%;
  max-width: min(90vw, 720px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
body.dark .result {
  background: rgba(36, 38, 54, 0.95);
  color: #f0f0f0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

#processing-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  font-size: clamp(0.9rem, 3vw, 1.2rem);
  color: #333;
  animation: fadeInOverlay 0.3s ease forwards;
  backdrop-filter: blur(5px);
}
.spinner {
  border: 6px solid #eaeaea;
  border-top: 6px solid #667eea;
  border-right: 6px solid #764ba2;
  border-radius: 50%;
  width: clamp(50px, 10vw, 70px);
  height: clamp(50px, 10vw, 70px);
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}
.games-container {
display: flex;
flex-direction: column; /* Stack vertically instead of side-by-side */
gap: 40px; /* Add spacing between the two sections */
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes fadeInOverlay {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
body.dark #processing-overlay {
  background: rgba(20, 22, 30, 0.92);
  color: #e6e6e6;
}
body.dark .spinner {
  border: 6px solid #2a2d3a;
  border-top: 6px solid #4facfe;
  border-right: 6px solid #00f2fe;
}

/* Enhanced Tutorial Button */
.tutorial-btn {
  position: fixed;
  top: 15px;
  left: 15px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid white;
}
body.dark .tutorial-btn {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
  
}
.tutorial-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}
.tutorial-btn:active {
  transform: translateY(-1px);
}

/* Header buttons container */
.header-buttons {
  position: fixed;
  top: clamp(10px, 2vw, 20px);
  right: clamp(10px, 2vw, 20px);
  display: flex;
  gap: 10px;
  z-index: 10000;
  width: 500px;
}
#theme-toggle {
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: clamp(40px, 8vw, 50px);
  height: clamp(40px, 8vw, 50px);
  font-size: clamp(1rem, 3vw, 1.3rem);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s, box-shadow 0.3s;
  backdrop-filter: blur(10px);
}
#theme-toggle:hover {
  transform: translateY(-3px) rotate(15deg);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
}

.success-msg {
  font-weight: 600;
  color: #667eea;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
}
.error-msg {
  font-weight: 600;
  color: #ff6b6b;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
}
body.dark .success-msg {
  color: #4facfe;
}
body.dark .error-msg {
  color: #ff6b6b;
}

canvas {
  width: 100% !important;
  height: auto !important;
  max-width: min(90vw, 600px);
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  margin: clamp(0.5rem, 2vw, 1rem) auto 0;
  display: block;
}
body.dark canvas {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Enhanced Controls Panel */
#controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: clamp(0.5rem, 1vw, 0.8rem);
  margin: clamp(0.5rem, 2vw, 1rem) 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: clamp(0.8rem, 1.5vw, 1.2rem);
  width: 100%;
  max-width: min(90vw, 900px);
  transition: background 0.4s ease;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
body.dark #controls {
  background: rgba(36, 38, 54, 0.95);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
#controls label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: clamp(0.75rem, 2vw, 0.85rem);
  color: #333;
  font-weight: 600;
}
body.dark #controls label {
  color: #e0e0e0;
}
#controls select,
#controls input {
  width: 100%;
  padding: clamp(0.3rem, 1vw, 0.4rem);
  margin-bottom: 0.3rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: clamp(0.75rem, 2vw, 0.85rem);
  background: rgba(255, 255, 255, 0.8);
}
body.dark #controls select,
body.dark input[type="file"],
body.dark input[type="color"],
body.dark input[type="number"] {
  background: rgba(42, 45, 58, 0.8);
  color: #e0e0e0;
  border: 1px solid #555;
}
#controls button {
  width: 100%;
  padding: clamp(0.4rem, 1vw, 0.5rem);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: clamp(0.75rem, 2vw, 0.85rem);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
}
body.dark #controls button {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
#controls button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
#controls button.active {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  transform: scale(0.98);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}
body.dark #controls button.active {
  background: linear-gradient(135deg, #005b99, #0088cc);
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 768px) {
  #controls {
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  }
  .tabs {
    flex-direction: column;
  }
  .tab {
    border-radius: 12px;
    margin-bottom: 0.5rem;
  }
}
@media (max-width: 480px) {
  #controls {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  }
  .tutorial-btn {
    padding: 10px 16px;
    font-size: 14px;
  }
}

.result canvas {
  width: 100% !important;
  height: auto !important;
  max-width: min(90vw, 600px);
  display: block;
  margin: clamp(0.5rem, 2vw, 1rem) auto 0;
}

/* Tab Content */
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* Character counter */
.char-counter {
  text-align: right;
  font-size: 0.8rem;
  margin-top: 0.3rem;
  color: #666;
}
body.dark .char-counter {
  color: #aaa;
}

/* Text result area */
.text-result {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1.2rem;
  margin-top: 1rem;
  white-space: pre-wrap;
  min-height: 100px;
  text-align: left;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}
body.dark .text-result {
  background: #2a2d3a;
}

/* Usage counter */
.usage-counter {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #666;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  backdrop-filter: blur(5px);
}
body.dark .usage-counter {
  color: #aaa;
  background: rgba(42, 45, 58, 0.5);
}
/* Language Toggle Button */
.language-btn {
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  border: 1px solid #ddd;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
body.dark .language-btn {
  background: rgba(40, 42, 54, 0.9);
  color: #f0f0f0;
  border: 1px solid #555;
}
.language-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.language-dropdown {
  position: absolute;
  top: 100%;
  right: 270px !important;
  margin-top: 8px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 8px 0;
  min-width: 180px;
  display: none;
  z-index: 1001;
  animation: dropdownFade 0.2s ease;
}
body.dark .language-dropdown {
  background: #2a2d3a;
  color: #f0f0f0;
}
@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.language-option {
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.language-option:hover {
  background: rgba(0, 123, 255, 0.1);
}
body.dark .language-option:hover {
  background: rgba(0, 198, 255, 0.1);
}
.language-option.active {
  background: rgba(0, 123, 255, 0.15);
  font-weight: 600;
}
body.dark .language-option.active {
  background: rgba(0, 198, 255, 0.15);
}
.language-flag {
  font-size: 16px;
}
.games-container {
display: flex;
flex-direction: column; /* stack vertically */
gap: 1.5rem;
}

/* Each section stays full width */
.games-section {
flex: 1;
min-width: 300px;
overflow-x: auto;                  /* allow scroll */
-webkit-overflow-scrolling: touch; /* smooth on iOS */
}

/* Keep table layout intact */
.games-table {
width: 100%;
min-width: 900px; /* <– ensures the table is wide enough to scroll */
border-collapse: collapse;
background: rgba(255, 255, 255, 0.95);
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
white-space: nowrap; /* prevents columns from breaking into multiple lines */
}

body.dark .games-table {
background: rgba(36, 38, 54, 0.95);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.games-table th,
.games-table td {
padding: 0.8rem;
text-align: left;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

body.dark .games-table th,
body.dark .games-table td {
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.games-table th {
background: rgba(102, 126, 234, 0.1);
font-weight: 600;
}

.games-table a {
color: #667eea;
text-decoration: none;
}

body.dark .games-table a {
color: #4facfe;
}

.games-table a:hover {
text-decoration: underline;
}
/* Filters Section */
.filters {
display: flex;
flex-wrap: wrap;
gap: 1rem;
align-items: center;
margin-bottom: 1.5rem;
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
border-radius: 16px;
padding: clamp(0.8rem, 1.5vw, 1.2rem);
width: 100%;
max-width: min(90vw, 900px);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2);
}
body.dark .filters {
background: rgba(36, 38, 54, 0.95);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.filters label {
display: block;
margin-bottom: 0.3rem;
font-size: clamp(0.75rem, 2vw, 0.85rem);
color: #333;
font-weight: 600;
}
body.dark .filters label {
color: #e0e0e0;
}
.filters select,
.filters input[type="text"] {
width: 100%;
max-width: 200px;
padding: clamp(0.3rem, 1vw, 0.4rem);
border: 1px solid #ddd;
border-radius: 8px;
font-size: clamp(0.75rem, 2vw, 0.85rem);
background: rgba(255, 255, 255, 0.8);
transition: all 0.3s ease;
}
body.dark .filters select,
body.dark .filters input[type="text"] {
background: rgba(42, 45, 58, 0.8);
color: #e0e0e0;
border: 1px solid #555;
}
.filters select:focus,
.filters input[type="text"]:focus {
outline: none;
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
background: white;
}
body.dark .filters select:focus,
body.dark .filters input[type="text"]:focus {
border-color: #00c6ff;
box-shadow: 0 0 0 3px rgba(0, 198, 255, 0.2);
background: rgba(42, 45, 58, 1);
}

/* Apps Container and Table */
.apps-container {
display: flex;
flex-direction: column;
gap: 1rem;
}
.apps-section {
flex: 1;
min-width: 300px;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
.apps-table {
table-layout: auto;
width: 100%;
border-collapse: collapse;
background: rgba(255, 255, 255, 0.95);
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
white-space: nowrap;
}

.apps-table th,
.apps-table td {
padding: 6px 12px;   /* Reduce padding to tighten gaps */
width: 1%;           /* Helps auto layout compress columns */
}

body.dark .apps-table {
background: rgba(36, 38, 54, 0.95);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.apps-table th,
.apps-table td {
padding: 0.8rem;
text-align: left;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
body.dark .apps-table th,
body.dark .apps-table td {
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.apps-table th {
background: rgba(102, 126, 234, 0.1);
font-weight: 600;
}
.apps-table a {
color: #667eea;
text-decoration: none;
}
body.dark .apps-table a {
color: #4facfe;
}
.apps-table a:hover {
text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
.filters {
flex-direction: column;
align-items: flex-start;
}
.filters select,
.filters input[type="text"] {
max-width: 100%;
}
.apps-table {
min-width: 800px; /* Adjusted for smaller screens */
}
}
@media (max-width: 480px) {
.filters select,
.filters input[type="text"] {
font-size: clamp(0.7rem, 1.8vw, 0.8rem);
}
.apps-table {
min-width: 600px;
}
.apps-table th,
.apps-table td {
padding: 0.6rem;
font-size: clamp(0.7rem, 1.8vw, 0.8rem);
}
}
/* Filters Section */
.filters {
display: flex;
flex-wrap: wrap;
gap: 1rem;
align-items: center;
margin-bottom: 1.5rem;
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
border-radius: 16px;
padding: clamp(0.8rem, 1.5vw, 1.2rem);
width: 100%;
max-width: min(90vw, 1000px);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2);
}
body.dark .filters {
background: rgba(36, 38, 54, 0.95);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.filters label {
display: block;
margin-bottom: 0.3rem;
font-size: clamp(0.75rem, 2vw, 0.85rem);
color: #333;
font-weight: 600;
}
body.dark .filters label {
color: #e0e0e0;
}
.filters select,
.filters input[type="text"] {
width: 100%;
max-width: 200px;
padding: clamp(0.3rem, 1vw, 0.4rem);
border: 1px solid #ddd;
border-radius: 8px;
font-size: clamp(0.75rem, 2vw, 0.85rem);
background: rgba(255, 255, 255, 0.8);
transition: all 0.3s ease;
}
body.dark .filters select,
body.dark .filters input[type="text"] {
background: rgba(42, 45, 58, 0.8);
color: #e0e0e0;
border: 1px solid #555;
}
.filters select:focus,
.filters input[type="text"]:focus {
outline: none;
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
background: white;
}
body.dark .filters select:focus,
body.dark .filters input[type="text"]:focus {
border-color: #00c6ff;
box-shadow: 0 0 0 3px rgba(0, 198, 255, 0.2);
background: rgba(42, 45, 58, 1);
}

/* Apps Container and Table */
.apps-container {
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.apps-section {
flex: 1;
min-width: 300px;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
.apps-table {
width: 100%;
min-width: 1000px; /* Adjusted for additional columns */
border-collapse: collapse;
background: rgba(255, 255, 255, 0.95);
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
white-space: nowrap;
}
body.dark .apps-table {
background: rgba(36, 38, 54, 0.95);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.apps-table th,
.apps-table td {
padding: 0.8rem;
text-align: left;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
body.dark .apps-table th,
body.dark .apps-table td {
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.apps-table th {
background: rgba(102, 126, 234, 0.1);
font-weight: 600;
}
.apps-table a {
color: #667eea;
text-decoration: none;
}
body.dark .apps-table a {
color: #4facfe;
}
.apps-table a:hover {
text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
.filters {
flex-direction: column;
align-items: flex-start;
}
.filters select,
.filters input[type="text"] {
max-width: 100%;
}
.apps-table {
min-width: 800px; /* Adjusted for smaller screens */
}
}
@media (max-width: 480px) {
.filters select,
.filters input[type="text"] {
font-size: clamp(0.7rem, 1.8vw, 0.8rem);
}
.apps-table {
min-width: 600px;
}
.apps-table th,
.apps-table td {
padding: 0.6rem;
font-size: clamp(0.7rem, 1.8vw, 0.8rem);
}
}
.apps-table th:nth-child(2),
.apps-table td:nth-child(2),
.apps-table th:nth-child(3),
.apps-table td:nth-child(3) {
padding-left: 25px !important;   /* Reduce left padding */
padding-right: 25px !important;  /* Optional: tighten spacing */
}
.apps-table th:nth-child(2), .apps-table td:nth-child(2), .apps-table th:nth-child(3), .apps-table td:nth-child(3) {
padding-left: 1px !important;
padding-right: 1px !important;
}
/* Default desktop styles (already in place) */
/* No need to modify your current .filters inline style */

/* Mobile view: align everything to the left */
@media (max-width: 768px) {
.filters {
flex-direction: column;     /* Stack filters vertically */
align-items: flex-start;    /* Align all to the left */
gap: 0.5rem;                /* Reduce spacing for compact look */
}

.filters > div {
width: 100%;                /* Make each filter full width */
}

.filters label,
.filters select,
.filters input {
width: 100%;                /* Ensure controls align neatly */
max-width: 100%;
}

.filters div[style*="margin-left"] {
margin-left: 0 !important;  /* Remove that 200px margin on mobile */
}
}
.auth-btn {
      background: rgba(0, 0, 0, 0.6);
      color: #fff;
      border: none;
      border-radius: 50%;
      width: clamp(40px, 8vw, 50px);
      height: clamp(40px, 8vw, 50px);
      font-size: clamp(1rem, 3vw, 1.3rem);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: transform 0.3s, box-shadow 0.3s;
      backdrop-filter: blur(10px);
      text-decoration: none;
    }
    .auth-btn:hover {
      transform: translateY(-3px);
      box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
    }
    .auth-btn svg {
      width: 18px;
      height: 18px;
    }


    /* Logout Popup Modal */
    .popup-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.5);
      z-index: 10000;
      justify-content: center;
      align-items: center;
      animation: fadeInOverlay 0.3s ease forwards;
      backdrop-filter: blur(5px);
    }
    body.dark .popup-overlay {
      background: rgba(0, 0, 0, 0.7);
    }
    .popup-content {
      background: rgba(255, 255, 255, 0.98);
      border-radius: 20px;
      padding: 2rem;
      text-align: center;
      max-width: 400px;
      width: 90%;
      box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
      animation: slideUp 0.3s ease forwards;
      border: 1px solid rgba(102, 126, 234, 0.2);
    }
    body.dark .popup-content {
      background: rgba(30, 32, 44, 0.98);
      color: #e6e6e6;
      box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
      border: 1px solid rgba(79, 172, 254, 0.3);
    }
    .popup-icon {
      width: 60px;
      height: 60px;
      border-radius: 50%;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      color: white;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 2rem;
      font-weight: bold;
      margin: 0 auto 1rem;
      box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }
    body.dark .popup-icon {
      background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
      box-shadow: 0 4px 15px rgba(79, 172, 254, 0.5);
    }
    .popup-content h3 {
      margin: 0 0 0.5rem 0;
      font-size: 1.5rem;
      color: #333;
      font-weight: 700;
    }
    body.dark .popup-content h3 {
      color: #f0f0f0;
      background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }
    .popup-content p {
      margin: 0 0 1.5rem 0;
      font-size: 1rem;
      color: #555;
      line-height: 1.5;
    }
    body.dark .popup-content p {
      color: #d0d0d0;
    }
    .close-popup-btn {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      color: white;
      border: none;
      border-radius: 10px;
      padding: 0.7rem 2rem;
      font-size: 1rem;
      font-weight: 600;
      cursor: pointer;
      transition: transform 0.2s, box-shadow 0.2s;
      box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }
    .close-popup-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
    }
    body.dark .close-popup-btn {
      background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
      box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
    }
    body.dark .close-popup-btn:hover {
      box-shadow: 0 8px 20px rgba(79, 172, 254, 0.6);
    }
    .user-profile {
      position: relative;
      display: inline-block;
    }
    
    .user-btn {
      background: var(--btn-bg);
      color: var(--text-color);
      border: none;
      padding: 8px 16px;
      border-radius: 4px;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    
    .user-btn svg {
      width: 18px;
      height: 18px;
    }
    
    .user-dropdown {
      display: none;
      position: absolute;
      right: 0;
      top: 100%;
      background: var(--bg-color);
      border: 1px solid var(--border-color);
      border-radius: 4px;
      padding: 8px;
      min-width: 200px;
      z-index: 1000;
    }
    
    .user-dropdown p {
      margin: 0 0 8px;
      color: var(--text-color);
    }
    
    .user-dropdown a {
      display: block;
      color: var(--text-color);
      text-decoration: none;
      padding: 4px 0;
    }
    
    .user-dropdown a:hover {
      color: var(--primary-color);
    }
    .user-profile {
      position: relative;
      display: inline-block;
    }
    
    .user-btn {
      background: var(--btn-bg);
      color: var(--text-color);
      border: none;
      padding: 8px 16px;
      border-radius: 4px;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    
    .user-btn svg {
      width: 18px;
      height: 18px;
    }
    
    .user-dropdown {
      display: none;
      position: absolute;
      right: 0;
      top: 100%;
      background: var(--bg-color);
      border: 1px solid var(--border-color);
      border-radius: 4px;
      padding: 8px;
      min-width: 200px;
      z-index: 1000;
    }
    
    .user-dropdown p {
      margin: 0 0 8px;
      color: var(--text-color);
    }
    
    .user-dropdown a {
      display: block;
      color: var(--text-color);
      text-decoration: none;
      padding: 4px 0;
    }
    
    .user-dropdown a:hover {
      color: var(--primary-color);
    }
    


.user-dropdown {
  position: relative;
  display: inline-block;
}

.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  object-fit: cover;
  margin-top: -8px;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: #fff;
  min-width: 200px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  border-radius: 8px;
  overflow: hidden;
  z-index: 1000;
  margin-right: 150px;
  margin-top: 20px;
}

.dropdown-content.show {
  display: block;
}

.user-info {
  padding: 10px 15px;
}

.user-info strong {
  display: block;
  font-size: 14px;
}

.user-info small {
  color: #555;
  font-size: 12px;
  display: block;      /* ensures margin works properly */
  margin-top: -10px;    /* moves the text 2px up */
}


.logout-btn {
  width: 100%;
  padding: 10px 15px;
  background-color: #e74c3c;
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: bold;
  text-align: left;
}

.logout-btn:hover {
  background-color: #c0392b;
}
.header-buttons{
  left: 76%;
}
/* Mobile view: adjust position */
@media (max-width: 768px) {
  .header-buttons {
    left: 150px; /* moves container to left on small screens */
    right: auto; /* reset right */
  }
}

.language-toggle{
  margin-top: 5px;
}




