/* ===== Website Title Styling ===== */
.website-title {
  font-family: Arial, sans-serif;
  font-size: 2.5rem;
  font-weight: bold;
  text-align: center;
  color: #ffffff;
  margin-bottom: 1rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  animation: fadeInTitle 1.5s ease-in-out both;
}

/* Custom Font for UrNEXUS Word */
.website-title .custom-font {
  font-family: "ProcrastinatingPixie", Arial, sans-serif;
  color: #4f46e5;
  font-size: 3rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  letter-spacing: 1px;
  animation: fadeInCustomFont 1.5s ease-in-out 0.5s both;
}

/* ===== User Info Section Styles ===== */
.user-info-section {
  display: flex;
  justify-content: center; /* Changed from flex-end to center */
  align-items: center;
  width: 100%;
  max-width: 800px;
  margin: 0 auto 2rem auto;
  padding: 0 1rem;
  position: relative;
  z-index: 10;
}

.user-name-link {
  color: #000000 !important; /* Dark text for visibility */
  font-weight: bold;
  cursor: pointer;
  padding: 10px 15px;
  background: rgba(255, 255, 255, 0.9) !important; /* More solid white background */
  backdrop-filter: blur(10px);
  border-radius: 8px;
  border: 2px solid rgba(79, 70, 229, 0.3);
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  min-width: 120px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.user-name-link:hover {
  background: rgba(79, 70, 229, 0.9) !important;
  color: #ffffff !important;
  border-color: #4f46e5;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

/* ===== Modal Styles ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fefefe;
  margin: 10% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 90%;
  max-width: 500px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  position: relative;
}

.modal-content h2 {
  color: #333;
  text-align: center;
  margin-bottom: 20px;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  top: 10px;
  right: 15px;
}

.close:hover,
.close:focus {
  color: #000;
}

.user-details-content {
  margin: 20px 0;
}

.user-details-content p {
  margin: 10px 0;
  padding: 8px;
  background: #f5f5f5;
  border-radius: 4px;
  color: #333;
}

.user-details-content strong {
  color: #4f46e5;
}

.modal-buttons {
  text-align: center;
  margin-top: 20px;
}

/* ===== Fading Animations ===== */
@keyframes fadeInTitle {
  0% {
    opacity: 0;
    transform: translateY(-10px);
    visibility: hidden;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
  }
}

@keyframes fadeInCustomFont {
  0% {
    opacity: 0;
    transform: translateY(-10px);
    visibility: hidden;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
  }
}

/* ===== Global Styles ===== */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Arial, sans-serif;
  line-height: 1.5;
  overflow-y: auto; /* Enable scrolling */
  overflow-x: hidden; /* Prevent horizontal scroll */
}

/* ===== Translucent Screen Overlay ===== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Slightly transparent so you can see the blurred BG */
  background: rgba(255, 255, 255, 0);
  backdrop-filter: blur(10px);
  /* Make sure pointer events fall through if needed */
  pointer-events: none;
  z-index: -1; /* above the BG, but below content */
}

/* ===== Content Wrapper ===== */
.content-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  justify-content: flex-start; /* Align content from the top */
  align-items: center;
  z-index: 0;
  text-align: center;
  overflow-y: auto; /* Enable scrolling */
  padding: 1rem;
  position: relative;
}

/* ===== Index Wrapper ===== */
.index-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1.5rem;
  z-index: 1;
  width: 100%;
  max-width: 800px;
  margin: auto;
  padding: 1rem;
}

/* ===== Index Container ===== */
.index-container {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.2),
    rgba(255, 255, 255, 0.05)
  );
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.5rem; /* Smooth rounded corners */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); /* Soft shadow */
  padding: 1.5rem;
  text-align: center;
  transition: border 0.3s ease-in-out, box-shadow 0.3s ease-in-out;

  /* Glassmorphism Effects */
  backdrop-filter: blur(15px); /* Apply blur to the background */
  -webkit-backdrop-filter: blur(15px); /* Safari support */
}

.index-container:hover {
  border: 2px solid #6366f1;
  box-shadow: 0 8px 15px rgba(99, 102, 241, 0.2);
}

/* ===== Title and Subtitle ===== */
.index-title {
  font-size: 1.8rem;
  font-weight: bold;
  color: #ffffff;
  margin-bottom: 1rem;
}

.index-subtitle {
  font-size: 1rem;
  color: #89909c;
  margin-bottom: 1.5rem;
}

/* ===== App Grid ===== */
.app-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(140px, 1fr)
  ); /* Responsive grid */
  gap: 1rem; /* Consistent spacing between cards */
  justify-content: center; /* Center the grid content */
  align-items: stretch; /* Stretch items to match row height */
  margin-top: 1rem;
  width: 100%;
  max-width: 1000px; /* Prevent grid from becoming too wide */
  padding: 0 1rem; /* Even padding on both sides */
  box-sizing: border-box; /* Ensure padding is included in width */
}

/* ===== App Card ===== */
.app-card {
  background: #fff;
  border: 2px solid #ccc;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1rem;
  transition: background-color 0.3s, border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.app-card:hover {
  background-color: #e0e0e0;
  border-color: #007bff;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.app-card img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

/* ===== Admin Panel Card Specific Styling ===== */
.app-card#adminPanelCard {
  position: relative;
  transition: all 0.3s ease;
}

.app-card#adminPanelCard:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.3);
  border-color: #4f46e5;
  background: linear-gradient(135deg, #f8f9ff, #e8ecff);
}

.app-card#adminPanelCard .gear-icon {
  font-size: 50px;
  margin-bottom: 10px;
  transition: transform 0.3s ease;
}

.app-card#adminPanelCard:hover .gear-icon {
  transform: rotate(15deg);
}

.app-card#adminPanelCard p {
  margin: 5px 0;
  font-weight: bold;
  color: #333;
}

.app-card#adminPanelCard small {
  color: #666;
  font-size: 0.8em;
  margin: 0;
}

/* ===== Access Denied Modal Specific Styling ===== */
#accessDeniedModal .modal-content {
  max-width: 400px;
  text-align: center;
  animation: modalShake 0.5s ease-in-out;
}

@keyframes modalShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

#accessDeniedModal h2 {
  color: #f44336;
  margin-bottom: 15px;
  font-size: 1.5rem;
}

#accessDeniedModal p {
  margin-bottom: 25px;
  line-height: 1.6;
  color: #555;
}

#accessDeniedModal .modal-buttons {
  margin-top: 20px;
}

#accessDeniedModal .button-30 {
  background-color: #f44336;
  color: white;
  border: none;
}

#accessDeniedModal .button-30:hover {
  background-color: #d32f2f;
  transform: translateY(-2px);
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
  .user-info-section {
    justify-content: center;
    margin-bottom: 1.5rem;
  }

  .user-name-link {
    padding: 8px 12px;
    font-size: 0.9em;
  }

  .app-grid {
    grid-template-columns: repeat(2, 1fr); /* Show 2 cards per row */
    gap: 0.5rem; /* Reduce spacing between cards */
    padding: 0 0.5rem; /* Adjust padding for smaller screens */
  }

  .app-card {
    padding: 0.5rem;
  }

  .app-card img {
    width: 60px;
    height: 60px;
  }

  .app-card#adminPanelCard .gear-icon {
    font-size: 40px;
  }

  .modal-content {
    width: 95%;
    margin: 20% auto;
  }

  #accessDeniedModal .modal-content {
    width: 90%;
    margin: 30% auto;
  }
}

@media (max-width: 480px) {
  .user-info-section {
    padding: 0 0.5rem;
    margin-bottom: 1rem;
  }

  .user-name-link {
    padding: 6px 10px;
    font-size: 0.8em;
    min-width: 100px;
  }

  .website-title {
    font-size: 2rem;
  }

  .website-title .custom-font {
    font-size: 2.5rem;
  }

  .app-grid {
    grid-template-columns: 1fr; /* Show 1 card per row on very small screens */
    gap: 0.5rem;
    padding: 0 0.5rem;
  }

  .app-card img {
    width: 50px;
    height: 50px;
  }

  .app-card#adminPanelCard .gear-icon {
    font-size: 35px;
  }

  #accessDeniedModal .modal-content {
    width: 95%;
    margin: 40% auto;
    padding: 15px;
  }

  #accessDeniedModal h2 {
    font-size: 1.3rem;
  }
}