/* ==================== GLOBAL RESET ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==================== LOGIN PAGE STYLES ==================== */

.login-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  animation: fadeInUp 0.6s ease-out;
}

/* Login Header */
.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-icon {
  font-size: 3.5rem;
  margin-bottom: 0.8rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  animation: bounce 2s infinite;
}

.login-card h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
  margin: 0 0 0.4rem 0;
  letter-spacing: -0.5px;
}

.login-subtitle {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  font-weight: 400;
}

/* Login Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Input Groups */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  font-size: 1.1rem;
  pointer-events: none;
  z-index: 1;
}

.input-group input {
  width: 100%;
  padding: 0.9rem 0.9rem 0.9rem 2.8rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  color: white;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.input-group input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.input-group input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-link {
  width: 100%;
  padding: 0.9rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background: rgba(255, 255, 255, 0.9);
  color: #667eea;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-top: 0.3rem;
}

.btn-primary:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.btn-link {
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem;
}

.btn-link:hover {
  color: white;
  text-decoration: underline;
}

/* Divider */
.divider {
  position: relative;
  text-align: center;
  margin: 0.3rem 0;
}

.divider::before,
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 45%;
  height: 1px;
  background: rgba(255, 255, 255, 0.3);
}

.divider::before {
  left: 0;
}

.divider::after {
  right: 0;
}

.divider span {
  background: transparent;
  padding: 0 1rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  font-weight: 500;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ==================== HOME PAGE STYLES ==================== */

.home-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 2.5rem;
  animation: fadeInDown 0.8s ease-out;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  color: white;
  margin: 0;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  letter-spacing: -1px;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 0.5rem;
  font-weight: 300;
}

/* Navigation Grid */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  max-width: 960px;
  width: 100%;
  margin-bottom: 2rem;
}

/* Navigation Cards with Glassmorphism */
.nav-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 1.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.nav-card:hover {
  transform: translateY(-8px);
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.nav-card:active {
  transform: translateY(-4px);
}

.card-icon {
  font-size: 2.75rem;
  margin-bottom: 0.9rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.nav-card h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: white;
  margin: 0.5rem 0;
  letter-spacing: 0.5px;
}

.nav-card p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  font-weight: 400;
}

/* Admin Cards - Special Styling */
.admin-card {
  background: rgba(255, 165, 0, 0.2);
  border: 1px solid rgba(255, 165, 0, 0.3);
}

.admin-card:hover {
  background: rgba(255, 165, 0, 0.3);
}

/* Logout Button */
.logout-button {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.85rem 2.25rem;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.logout-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.logout-button:active {
  transform: scale(0.98);
}

/* Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== OTHER PAGES (SHOP, ACCOUNT, ADMIN, ETC) ==================== */

/* Legacy login-box style for pages that haven't been modernized yet */
.login-box {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 2rem;
  width: 100%;
  max-width: 900px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  margin: 0 auto;
}

.login-box h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 2rem;
  color: white;
  font-weight: 700;
}

.login-box h3 {
  margin-bottom: 1rem;
  color: white;
  font-weight: 600;
  font-size: 1.3rem;
}

/* Body for other pages */
body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 2rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* -------------------- INPUT -------------------- */
input[type="text"], 
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 0.9rem;
  margin-bottom: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  color: white;
  font-size: 0.95rem;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

/* -------------------- BUTTONS -------------------- */
button {
  padding: 0.85rem 1.5rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: #667eea;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

button:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

button:active {
  transform: translateY(0);
}

#checkout-btn {
  width: 100%;
  margin-top: 0.5rem;
  background: rgba(40, 167, 69, 0.9);
  color: white;
}

#checkout-btn:hover {
  background: rgba(40, 167, 69, 1);
}

#back-home {
  width: 100%;
  background: rgba(108, 117, 125, 0.9);
  color: white;
}

#back-home:hover {
  background: rgba(108, 117, 125, 1);
}

#back-login {
  width: 100%;
  background: rgba(108, 117, 125, 0.9);
  color: white;
}

#back-login:hover {
  background: rgba(108, 117, 125, 1);
}

#paylater-btn {
  width: 100%;
  margin-top: 0.5rem;
  background: rgba(255, 193, 7, 0.9);
  color: #333;
}

#paylater-btn:hover {
  background: rgba(255, 193, 7, 1);
}

#pay-all-btn {
  margin-top: 1rem;
  padding: 0.9rem 2rem;
  background: rgba(33, 150, 243, 0.9);
  color: white;
  font-size: 1rem;
}

#pay-all-btn:hover {
  background: rgba(33, 150, 243, 1);
}

/* -------------------- TABLES -------------------- */
.table-container {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
}

.table-container table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table-container th, 
.table-container td {
  padding: 0.9rem;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
}

.table-container th {
  background: rgba(255, 255, 255, 0.15);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.table-container tbody tr {
  background: rgba(255, 255, 255, 0.05);
}

.table-container tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.08);
}

.table-container tbody tr:hover {
  background: rgba(255, 255, 255, 0.15);
}

.add-cart-btn, 
.remove-cart-btn,
.pay-order-btn {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: white;
  font-weight: 600;
  transition: all 0.3s ease;
}

.add-cart-btn {
  background: rgba(40, 167, 69, 0.9);
}

.add-cart-btn:hover {
  background: rgba(40, 167, 69, 1);
  transform: translateY(-2px);
}

.remove-cart-btn {
  background: rgba(220, 53, 69, 0.9);
}

.remove-cart-btn:hover {
  background: rgba(220, 53, 69, 1);
  transform: translateY(-2px);
}

.pay-order-btn {
  background: rgba(40, 167, 69, 0.9);
}

.pay-order-btn:hover {
  background: rgba(40, 167, 69, 1);
  transform: translateY(-2px);
}

/* -------------------- CART TOTAL -------------------- */
#cart-total,
#running-total {
  font-weight: bold;
  font-size: 1.3rem;
  color: white;
}

.table-container p {
  color: white;
  font-size: 1.1rem;
  margin-top: 1rem;
}

/* -------------------- SEARCH INPUT -------------------- */
#shop-search {
  margin-bottom: 1.5rem;
}

/* -------------------- EXPANDABLE ROWS (ACCOUNT PAGE) -------------------- */
.expandable-row {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1) !important;
  transition: background 0.3s ease;
}

.expandable-row:hover {
  background: rgba(255, 255, 255, 0.15) !important;
}

.order-items {
  display: none;
}

.order-items td {
  background: rgba(102, 126, 234, 0.3) !important;
  padding: 1rem 1rem 1rem 2rem !important;
  font-size: 0.9rem;
  color: white !important;
  border-left: 3px solid rgba(255, 255, 255, 0.5) !important;
}

/* -------------------- ALL USERS PAGE -------------------- */
.user-row {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1) !important;
  transition: background 0.3s ease;
}

.user-row:hover {
  background: rgba(255, 255, 255, 0.15) !important;
}

.user-details {
  display: none;
}

.user-details td {
  background: rgba(102, 126, 234, 0.25) !important;
  padding: 1.5rem !important;
  color: white !important;
}

.orders-section {
  margin-bottom: 1.5rem;
}

.orders-section h4 {
  margin: 1rem 0 0.5rem 0;
  color: white !important;
  font-weight: 600;
  font-size: 1.1rem;
}

.order-item {
  padding: 0.8rem;
  margin: 0.5rem 0;
  background: rgba(255, 255, 255, 0.15) !important;
  border-left: 3px solid rgba(76, 175, 80, 1);
  border-radius: 6px;
  color: white !important;
}

.order-item.pending {
  border-left-color: rgba(255, 152, 0, 1);
}

.order-timestamp {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 1) !important;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.order-items-list {
  margin: 0.5rem 0;
  padding-left: 1rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.95) !important;
}

.order-total {
  font-weight: 600;
  color: rgba(100, 200, 255, 1) !important;
  margin-top: 0.3rem;
}

.expand-icon {
  float: right;
  font-size: 1.1rem;
  transition: transform 0.3s;
  color: white !important;
}

.user-row.expanded .expand-icon {
  transform: rotate(180deg);
}

.no-orders {
  color: rgba(255, 255, 255, 0.7) !important;
  font-style: italic;
  font-size: 0.9rem;
}

/* ==================== RESPONSIVE DESIGN ==================== */

/* Tablets (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .login-card {
    max-width: 480px;
    padding: 3rem 2.5rem;
  }

  .login-card h2 {
    font-size: 2rem;
  }

  .login-icon {
    font-size: 4rem;
  }

  .hero-title {
    font-size: 3.5rem;
  }

  .nav-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 720px;
  }

  .nav-card {
    padding: 2rem;
  }

  .card-icon {
    font-size: 3rem;
  }

  .nav-card h3 {
    font-size: 1.4rem;
  }

  .login-box {
    max-width: 800px;
  }
}

/* Desktop (1025px+) */
@media (min-width: 1025px) {
  .login-card {
    max-width: 500px;
    padding: 3.5rem 3rem;
  }

  .login-card h2 {
    font-size: 2.2rem;
  }

  .login-icon {
    font-size: 4.5rem;
  }

  .input-group input,
  .btn-primary,
  .btn-secondary {
    padding: 1.1rem 1.1rem 1.1rem 3.2rem;
    font-size: 1rem;
  }

  .input-icon {
    font-size: 1.2rem;
    left: 1.1rem;
  }

  .hero-title {
    font-size: 4rem;
  }

  .hero-subtitle {
    font-size: 1.4rem;
  }

  .nav-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 840px;
    gap: 1.5rem;
  }

  .nav-card {
    padding: 2.25rem;
  }

  .card-icon {
    font-size: 3.5rem;
  }

  .nav-card h3 {
    font-size: 1.5rem;
  }

  .nav-card p {
    font-size: 1rem;
  }

  .login-box {
    max-width: 1000px;
  }
}

/* Mobile (max 767px) */
@media (max-width: 767px) {
  body {
    padding: 1rem;
  }

  .login-container {
    padding: 1.5rem;
  }

  .login-card {
    padding: 2rem 1.5rem;
  }

  .login-card h2 {
    font-size: 1.6rem;
  }

  .login-icon {
    font-size: 3rem;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .nav-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .nav-card {
    padding: 1.5rem;
  }

  .card-icon {
    font-size: 2.5rem;
  }

  .nav-card h3 {
    font-size: 1.25rem;
  }

  .nav-card p {
    font-size: 0.85rem;
  }

  .home-container {
    padding: 1.5rem;
  }

  .login-box {
    padding: 1.5rem;
    max-width: 100%;
  }

  .login-box h2 {
    font-size: 1.6rem;
  }

  .table-container {
    padding: 0.8rem;
  }

  .table-container th,
  .table-container td {
    padding: 0.6rem;
    font-size: 0.85rem;
  }

  button {
    font-size: 0.9rem;
    padding: 0.8rem 1.2rem;
  }
}

/* Small Mobile (max 480px) */
@media (max-width: 480px) {
  .login-card {
    padding: 1.75rem 1.25rem;
  }

  .login-card h2 {
    font-size: 1.5rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .card-icon {
    font-size: 2.25rem;
  }

  .nav-card h3 {
    font-size: 1.15rem;
  }

  .login-box {
    padding: 1.25rem;
  }

  .table-container th,
  .table-container td {
    padding: 0.5rem;
    font-size: 0.8rem;
  }
}