/* =================================== */
/* ======== THEME VARIABLES ========== */
/* =================================== */

/* Default Theme (Light Mode) */
:root {
  --bg-color: #f4f7f9;
  --primary-text: #2c3e50;
  --secondary-text: #5e6c79;
  --accent-color: #8a2be2; /* Darker purple for better contrast on light bg */
  --accent-color-hover: #7b24c6;
  --card-bg: #ffffff;
  --card-border: #e3e8ee;
  --card-hover-shadow: rgba(138, 43, 226, 0.2);
  --header-bg: rgba(255, 255, 255, 0.85);
  --input-bg: rgba(0,0,0,0.05);
}

/* Dark Mode Theme Overrides */
body.dark-mode {
  --bg-color: #1a1a2e; /* Original dark background */
  --primary-text: #ffffff;
  --secondary-text: #c0c0c0;
  --accent-color: #a07eeb; /* Original accent */
  --accent-color-hover: #b18ff0;
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.2);
  --card-hover-shadow: rgba(160, 126, 235, 0.5);
  --header-bg: rgba(0, 0, 0, 0.2);
  --input-bg: rgba(0,0,0,0.2);
}

/* =================================== */
/* ========== GLOBAL STYLES ========== */
/* =================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  color: var(--primary-text);
  background-color: var(--bg-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Apply aurora ONLY in dark mode */
body.dark-mode {
  background: radial-gradient(circle at 10% 20%, rgba(90, 92, 106, 1) 0%, rgba(32, 45, 58, 1) 81.3% );
  background-size: 200% 200%;
  animation: aurora 15s ease infinite;
}

@keyframes aurora {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- Layout: Header, Main, Footer --- */
.site-header {
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); /* For Safari */
  border-bottom: 1px solid var(--card-border);
  padding: 1rem 5%;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.site-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-text);
  text-decoration: none;
  letter-spacing: 2px;
}

.main-nav a {
  color: var(--secondary-text);
  text-decoration: none;
  margin-left: 2rem;
  font-weight: 400;
  transition: color 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--accent-color);
}

.main-content {
  flex-grow: 1;
  padding: 2rem 5%;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}
.site-footer {
  text-align: center;
  padding: 1.5rem 5%;
  margin-top: 2rem;
  color: var(--secondary-text);
  font-size: 0.9rem;
  background: rgba(0,0,0,0.02);
  border-top: 1px solid var(--card-border);
}
body.dark-mode .site-footer {
    background: rgba(0,0,0,0.1);
}


/* --- Home Page: Hero & Cards --- */
.hero {
  text-align: center;
  margin-bottom: 3rem;
}
.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.hero p {
  font-size: 1.2rem;
  color: var(--secondary-text);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.app-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}
/* Apply backdrop filter only in dark mode for the 'glass' effect */
body.dark-mode .app-card,
body.dark-mode .content-container,
body.dark-mode .status-card {
    backdrop-filter: blur(5px);
}


.app-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 30px -10px var(--card-hover-shadow);
}

.app-icon {
  width: 100px;
  height: 100px;
  border-radius: 20px;
  margin-bottom: 1rem;
}

.app-name {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--primary-text);
}

.store-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.store-links img {
  width: 150px;
  height: auto;
  transition: opacity 0.3s;
}
.store-links img:hover {
  opacity: 0.8;
}

/* --- Content Pages (Privacy, Support, 404) --- */
.content-container {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 900px;
  margin: 0 auto;
}
.content-container h1 {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 1rem;
  color: var(--accent-color);
}
.content-container h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--primary-text);
}
.content-container p, .content-container li {
  line-height: 1.8;
  color: var(--secondary-text);
  margin-bottom: 1rem;
}
.button-link {
  display: inline-block;
  background: var(--accent-color);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  margin-top: 2rem;
  transition: background 0.3s;
}
.button-link:hover {
  background: var(--accent-color-hover);
}

/* --- Support Form --- */
.support-form .form-group {
  margin-bottom: 1.5rem;
}
.support-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--primary-text);
}
.support-form input[type="radio"], .support-form textarea {
  accent-color: var(--accent-color);
}
.support-form .radio-group {
  display: flex;
  gap: 1.5rem;
}
.support-form textarea {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  color: var(--primary-text);
  font-family: 'Poppins', sans-serif;
}
.support-form button {
  cursor: pointer;
  border: none;
  padding: 12px 30px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  background: var(--accent-color);
  color: white;
  transition: background 0.3s;
}
.support-form button:hover {
  background: var(--accent-color-hover);
}
.feedback-table{
  width: 100%;
}

/* =================================== */
/* ==== GLOBAL THEME TOGGLE STYLES === */
/* =================================== */

.theme-switch-wrapper {
  display: flex;
  align-items: center;
  margin-left: 2rem;
}
.theme-switch {
  display: inline-block;
  height: 24px;
  position: relative;
  width: 44px;
}
.theme-switch input { display:none; }

.slider {
  background-color: #ccc; /* Default light-mode slider bg */
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  transition: .4s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
body.dark-mode .slider {
    background-color: #3a3a5c; /* Dark mode slider inactive bg */
}

input:checked + .slider {
  background-color: var(--accent-color);
}
input:checked + .slider:before {
  transform: translateX(20px);
}

/* =================================== */
/* ======== STATUS PAGE STYLES ======= */
/* =================================== */
.status-page .page-header {
  text-align: center;
  margin-bottom: 2rem;
}
.status-page .last-updated {
  color: var(--secondary-text);
  font-size: 0.9rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.status-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, background-color 0.3s ease, border-color 0.3s ease;
}

.status-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.status-card .app-name {
  font-size: 1.25rem;
  font-weight: 500;
}

.platform {
  font-size: 0.8rem;
  font-weight: 500;
  color: white;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
}
.platform.apple { background-color: #999; }
.platform.google { background-color: #4caf50; }

.metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
}
.metric .label {
  color: var(--secondary-text);
}
.metric .value {
  font-weight: 500;
  color: var(--primary-text);
}
.metric .value.revenue {
  color: #28a745;
  font-weight: 700;
}

.status-card.error-card {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}
body.dark-mode .status-card.error-card {
  background-color: rgba(220, 53, 69, 0.2);
  border-color: #dc3545;
  color: #f8d7da; /* Lighter text for dark bg */
}

/* =================================== */
/* ====== MOBILE HEADER STYLES ======= */
/* =================================== */

@media (max-width: 650px) {
  .site-header {
    /* Reduce padding on mobile for more space */
    padding: 1rem 5%;
  }

  .header-content {
    /* Allow items to wrap to a new line */
    flex-wrap: wrap;
    /* Center items for a better wrapped layout */
    justify-content: center;
    /* Add some space between the wrapped rows */
    gap: 1rem;
  }

  .site-title {
    /* Make the title take the full width to force nav/toggle below */
    width: 100%;
    text-align: center;
    /* Reduce font-size a bit on small screens */
    font-size: 1.6rem;
    /* Remove default letter-spacing if it's too much for mobile */
    letter-spacing: 1px;
    margin-bottom: 0.5rem; /* Add a little space below the title */
  }

  .main-nav,
  .theme-switch-wrapper {
    /* Remove the left margin used for desktop layout */
    margin-left: 0;
  }

  .main-nav {
    /* Use order to ensure nav comes before the toggle if they wrap separately */
    order: 2;
    /* Adjust spacing between nav links for mobile */
    display: flex;
    gap: 1.5rem;
  }

  .theme-switch-wrapper {
    order: 3;
  }

  .main-nav a {
      /* The .main-nav gap handles the spacing now */
      margin-left: 0;
  }
}
