/* ==========================================================
   E-WASTE MANAGEMENT SYSTEM
   COMPLETE WEBSITE STYLESHEET
   ========================================================== */


/* ----------------------------------------------------------
   1. GENERAL RESET
   ---------------------------------------------------------- */

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

:root {
  --primary-green: #137547;
  --dark-green: #075c37;
  --light-green: #e8f5eb;

  --accent-green: #22a65b;

  --text-dark: #183027;
  --text-muted: #596c62;

  --white: #ffffff;

  --border-color: #d6e4da;

  --error-red: #b42318;

  --shadow:
    0 12px 35px rgba(0, 0, 0, 0.14);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  color: var(--text-dark);

  line-height: 1.6;

  background-color: #dcebdd;

  /*
    Optional background image:

    Place an image named background.jpg inside
    your public folder to enable it.

    If background.jpg is not present, the green
    gradient will still display correctly.
  */

  background-image:
    linear-gradient(
      rgba(231, 245, 232, 0.66),
      rgba(217, 238, 219, 0.66)
    ),
    url("background.jpg");

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}


/* ----------------------------------------------------------
   2. MAIN WEBSITE PANEL
   ---------------------------------------------------------- */

.panel {
  width: min(1120px, calc(100% - 32px));

  margin: 42px auto;

  padding: 38px;

  background: rgba(255, 255, 255, 0.91);

  border: 1px solid rgba(255, 255, 255, 0.8);

  border-radius: 20px;

  box-shadow: var(--shadow);

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}


/* ----------------------------------------------------------
   3. SYSTEM HEADER
   ---------------------------------------------------------- */

header {
  text-align: center;

  padding-bottom: 26px;

  margin-bottom: 30px;

  border-bottom: 2px solid var(--border-color);
}

.symbol {
  width: 76px;
  height: 76px;

  display: flex;

  align-items: center;
  justify-content: center;

  margin: 0 auto 14px;

  background: var(--light-green);

  border: 2px solid #c1e3cb;

  border-radius: 50%;

  font-size: 42px;
}

h1 {
  color: var(--dark-green);

  font-size: clamp(26px, 4vw, 38px);

  line-height: 1.25;

  margin-bottom: 12px;
}

.subtitle {
  max-width: 650px;

  margin: 0 auto;

  color: var(--text-muted);

  font-size: 16px;
}


/* ----------------------------------------------------------
   4. SECTION HEADINGS
   ---------------------------------------------------------- */

h2 {
  color: var(--dark-green);

  font-size: 23px;

  line-height: 1.35;

  margin-bottom: 10px;
}

h3 {
  font-size: 15px;

  font-weight: 600;
}

p {
  margin-bottom: 12px;
}


/* ----------------------------------------------------------
   5. GOOGLE SIGN-IN SECTION
   ---------------------------------------------------------- */

#signed-out {
  max-width: 540px;

  margin: 0 auto;

  padding: 40px 25px;

  text-align: center;

  background: rgba(248, 253, 249, 0.95);

  border: 1px solid var(--border-color);

  border-radius: 16px;

  box-shadow:
    0 5px 20px rgba(0, 0, 0, 0.05);
}

#signed-out h2 {
  font-size: 28px;
}

#signed-out p {
  color: var(--text-muted);

  margin-bottom: 24px;
}


/* ----------------------------------------------------------
   6. BUTTONS
   ---------------------------------------------------------- */

button {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  min-height: 44px;

  padding: 12px 20px;

  font-family: inherit;

  font-size: 15px;

  font-weight: 600;

  line-height: 1.3;

  cursor: pointer;

  border: none;
  border-radius: 9px;

  transition:
    background-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

button:not(:disabled):hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.6;

  cursor: not-allowed;
}

#google-login {
  background: var(--primary-green);

  color: var(--white);

  min-width: 230px;

  box-shadow:
    0 4px 12px rgba(19, 117, 71, 0.2);
}

#google-login:not(:disabled):hover {
  background: var(--dark-green);
}

#logout {
  background: #f1f5f2;

  color: var(--dark-green);

  border: 1px solid #b8d2c1;

  white-space: nowrap;
}

#logout:not(:disabled):hover {
  background: #e0eee4;
}


/* ----------------------------------------------------------
   7. SIGNED-IN USER PROFILE
   ---------------------------------------------------------- */

#signed-in {
  width: 100%;
}

.user-profile {
  display: flex;

  align-items: center;

  gap: 16px;

  padding: 18px 20px;

  margin-bottom: 28px;

  background: rgba(236, 247, 239, 0.95);

  border: 1px solid #c7e3cf;

  border-radius: 13px;
}

.user-profile img {
  width: 54px;
  height: 54px;

  flex-shrink: 0;

  object-fit: cover;

  border-radius: 50%;

  border: 2px solid var(--white);
}

.user-profile > div {
  flex: 1;

  min-width: 0;
}

.user-profile h2 {
  font-size: 19px;

  margin-bottom: 2px;

  overflow-wrap: anywhere;
}

#user-email {
  color: var(--text-muted);

  font-size: 14px;

  margin-bottom: 0;

  overflow-wrap: anywhere;
}


/* ----------------------------------------------------------
   8. ADMINISTRATOR DASHBOARD
   ---------------------------------------------------------- */

#dashboard-section {
  margin-bottom: 36px;

  padding: 26px;

  background: rgba(249, 253, 250, 0.96);

  border: 1px solid var(--border-color);

  border-radius: 15px;
}

.dashboard-header {
  margin-bottom: 22px;
}

.dashboard-header h2 {
  margin-bottom: 7px;
}

.dashboard-header p {
  color: var(--text-muted);

  margin-bottom: 0;

  font-size: 15px;
}


/* ----------------------------------------------------------
   9. DASHBOARD STATISTICS GRID
   ---------------------------------------------------------- */

.dashboard-grid {
  display: grid;

  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  gap: 16px;

  margin-bottom: 18px;
}

.dashboard-card {
  min-width: 0;

  padding: 22px 17px;

  background: var(--white);

  border: 1px solid #d6e8db;

  border-top: 4px solid var(--primary-green);

  border-radius: 12px;

  text-align: center;

  box-shadow:
    0 4px 12px rgba(12, 86, 48, 0.06);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.dashboard-card:hover {
  transform: translateY(-3px);

  box-shadow:
    0 8px 20px rgba(12, 86, 48, 0.11);
}

.dashboard-card h3 {
  min-height: 46px;

  display: flex;

  align-items: center;
  justify-content: center;

  color: var(--text-muted);

  font-size: 14px;

  line-height: 1.4;
}

.dashboard-card p {
  margin: 10px 0 0;

  color: var(--dark-green);

  font-size: clamp(25px, 3vw, 34px);

  line-height: 1.2;

  font-weight: 700;

  overflow-wrap: anywhere;
}

#dashboard-status {
  margin-top: 14px;

  margin-bottom: 0;

  color: var(--text-muted);

  font-size: 14px;
}


/* ----------------------------------------------------------
   10. E-WASTE REQUEST SECTION
   ---------------------------------------------------------- */

#request-section {
  padding: 28px;

  background: rgba(249, 253, 250, 0.96);

  border: 1px solid var(--border-color);

  border-radius: 15px;
}

#request-section .dashboard-header {
  padding-bottom: 17px;

  border-bottom: 1px solid var(--border-color);

  margin-bottom: 25px;
}


/* ----------------------------------------------------------
   11. REQUEST FORM
   ---------------------------------------------------------- */

#ewaste-request-form {
  width: 100%;
}

.form-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 19px 22px;
}

.form-group {
  display: flex;

  flex-direction: column;

  min-width: 0;
}

.form-group label {
  margin-bottom: 7px;

  color: var(--text-dark);

  font-size: 14px;

  font-weight: 600;
}


/* ----------------------------------------------------------
   12. INPUTS AND SELECT MENUS
   ---------------------------------------------------------- */

.form-group input,
.form-group select {
  width: 100%;

  min-width: 0;

  min-height: 45px;

  padding: 11px 13px;

  background: var(--white);

  color: var(--text-dark);

  border: 1px solid #b6cbbd;

  border-radius: 8px;

  font-family: inherit;

  font-size: 15px;

  outline: none;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary-green);

  box-shadow:
    0 0 0 3px rgba(19, 117, 71, 0.13);
}

.form-group input:hover,
.form-group select:hover {
  border-color: #7eaa8d;
}

.form-group input::placeholder {
  color: #83948a;
}

.form-group select {
  cursor: pointer;
}

.form-group input:disabled,
.form-group select:disabled {
  background: #f1f4f1;

  cursor: not-allowed;
}


/* ----------------------------------------------------------
   13. REQUEST SUBMISSION BUTTON
   ---------------------------------------------------------- */

#submit-request {
  width: 100%;

  margin-top: 25px;

  padding: 14px 22px;

  background: var(--primary-green);

  color: var(--white);

  font-size: 16px;

  box-shadow:
    0 4px 12px rgba(19, 117, 71, 0.16);
}

#submit-request:not(:disabled):hover {
  background: var(--dark-green);
}


/* ----------------------------------------------------------
   14. STATUS MESSAGES
   ---------------------------------------------------------- */

#request-status,
#status {
  padding: 12px 15px;

  font-size: 14px;

  line-height: 1.5;

  overflow-wrap: anywhere;

  border-radius: 8px;
}

#request-status {
  margin-top: 18px;

  margin-bottom: 0;

  color: var(--dark-green);

  background: var(--light-green);

  border: 1px solid #c7e4d1;
}

#request-status:empty {
  display: none;
}

#status {
  margin-top: 26px;

  margin-bottom: 0;

  background: rgba(232, 245, 235, 0.95);

  border: 1px solid #c8e3cf;

  color: var(--dark-green);

  text-align: center;
}


/* ----------------------------------------------------------
   15. ACCESSIBILITY
   ---------------------------------------------------------- */

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(19, 117, 71, 0.35);

  outline-offset: 3px;
}


/* ----------------------------------------------------------
   16. TABLET LAYOUT
   ---------------------------------------------------------- */

@media (max-width: 950px) {

  .dashboard-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .panel {
    padding: 28px;
  }

}


/* ----------------------------------------------------------
   17. MOBILE LAYOUT
   ---------------------------------------------------------- */

@media (max-width: 600px) {

  body {
    background-attachment: scroll;
  }

  .panel {
    width: calc(100% - 20px);

    margin: 10px auto;

    padding: 20px 15px;

    border-radius: 14px;
  }

  header {
    margin-bottom: 23px;
  }

  .symbol {
    width: 65px;
    height: 65px;

    font-size: 36px;
  }

  h1 {
    font-size: 26px;
  }

  h2 {
    font-size: 21px;
  }

  .subtitle {
    font-size: 14px;
  }

  #signed-out {
    padding: 28px 16px;
  }

  #google-login {
    width: 100%;

    min-width: 0;
  }

  .user-profile {
    flex-wrap: wrap;

    padding: 15px;

    gap: 12px;
  }

  .user-profile > div {
    flex-basis: calc(100% - 70px);
  }

  #logout {
    width: 100%;
  }

  #dashboard-section,
  #request-section {
    padding: 20px 15px;
  }

  .dashboard-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    gap: 10px;
  }

  .dashboard-card {
    padding: 16px 10px;
  }

  .dashboard-card h3 {
    font-size: 12px;

    min-height: 42px;
  }

  .dashboard-card p {
    font-size: 25px;
  }

  .form-grid {
    grid-template-columns: 1fr;

    gap: 16px;
  }

  .form-group input,
  .form-group select {
    font-size: 16px;
  }

}


/* ----------------------------------------------------------
   18. VERY SMALL MOBILE SCREENS
   ---------------------------------------------------------- */

@media (max-width: 360px) {

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-card h3 {
    min-height: auto;
  }

}


/* ----------------------------------------------------------
   19. REDUCED MOTION ACCESSIBILITY
   ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;

    transition-duration: 0.01ms !important;

    animation-duration: 0.01ms !important;
  }

}


/* ----------------------------------------------------------
   20. SECURITY-RELATED DISPLAY RULE
   ---------------------------------------------------------- */

/*
  Keep sections hidden when their HTML hidden attribute
  is present.

  The actual administrator security is enforced by
  Firestore Security Rules, not by CSS.
*/

[hidden] {
  display: none !important;
}


/* ==========================================================
   END OF STYLESHEET
   ========================================================== */