/* Modern Google Font imports */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

/* === RESET & VARIABLES === */
:root {
  --primary-color: #f07e01;
  --primary-hover: #d66900;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --background-blur: rgba(0, 0, 0, 0.45);
  --card-bg: rgba(22, 22, 26, 0.7);
  --text-color: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.8);
  --error-color: #ff4c4c;
  --success-color: #4caf50;
  --warning-color: #ff9900;
  --font-family-base: 'Poppins', sans-serif;
  --font-family-heading: 'Montserrat', sans-serif;
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.25);
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

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

/* === BASE === */
html {
  font-size: 16px;
}

body {
  font-family: var(--font-family-base);
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  background: url('../images/login_page_logo/LILFOLKS_2.25_26-6-24[2].jpg') no-repeat center center fixed;
  background-size: cover;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* Create an overlay for better text readability */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 100%);
  z-index: -1;
}

/* === CONTAINER === */
.login-container {
  width: min(90%, 450px);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  padding: clamp(20px, 5vw, 40px);
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.7s ease-out;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* === ANIMATIONS === */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* === TYPOGRAPHY === */
h2 {
  font-family: var(--font-family-heading);
  font-size: clamp(22px, 30px);
  color: var(--text-color);
  margin-bottom: 20px;
  text-align: center;
  width: 100%;
  font-weight: 600;
  letter-spacing: 0.5px;
}

h3 {
  font-family: var(--font-family-heading);
  font-size: clamp(18px, 4vw, 24px);
  color: var(--text-color);
  margin-bottom: 15px;
  text-align: center;
  width: 100%;
  font-weight: 600;
}

/* === MESSAGES === */
p {
  width: 100%;
  text-align: center;
  font-weight: 500;
  margin-bottom: 20px;
  font-size: clamp(14px, 3vw, 16px);
  word-wrap: break-word;
  line-height: 1.5;
}

p[style*="color:red"] {
  color: var(--error-color);
  padding: 8px 12px;
  background-color: rgba(255, 76, 76, 0.1);
  border-radius: var(--border-radius-sm);
}

p[style*="color:orange"] {
  color: var(--warning-color);
  padding: 8px 12px;
  background-color: rgba(255, 153, 0, 0.1);
  border-radius: var(--border-radius-sm);
}

.error-msg {
  color: var(--error-color);
  font-weight: 500;
  text-align: center;
  margin-bottom: 20px;
  padding: 8px 12px;
  background-color: rgba(255, 76, 76, 0.1);
  border-radius: var(--border-radius-sm);
}

.warning-msg {
  color: var(--warning-color);
  font-weight: 500;
  text-align: center;
  margin-bottom: 20px;
  padding: 8px 12px;
  background-color: rgba(255, 153, 0, 0.1);
  border-radius: var(--border-radius-sm);
}

/* === FORM ELEMENTS === */
form {
  width: 100%;
}

.input-group {
  position: relative;
  width: 100%;
  margin-bottom: 24px;
}

.input-group input {
  width: 100%;
  padding: 16px 45px 16px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius-md);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-color);
  font-size: clamp(14px, 3vw, 16px);
  transition: all var(--transition-normal);
  backdrop-filter: blur(5px);
}

.input-group input::placeholder {
  color: var(--text-secondary);
}

.input-group input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(240, 126, 1, 0.25);
  background: rgba(255, 255, 255, 0.12);
}

/* === TOGGLE PASSWORD === */
.toggle-password {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  z-index: 10;
  padding: 0;
  line-height: 1;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.toggle-password svg {
  width: 20px;
  height: 20px;
  fill: var(--text-secondary);
  transition: all var(--transition-fast);
}

.toggle-password:hover svg {
  fill: var(--text-color);
  transform: scale(1.1);
}

.toggle-password .eye-open,
.toggle-password .eye-closed {
  width: 100%;
  height: 100%;
}

/* === SUBMIT BUTTON === */
button[type="submit"] {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 30px;
  background: var(--primary-color);
  color: white;
  font-size: clamp(15px, 3vw, 17px);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(240, 126, 1, 0.3);
  margin-top: 10px;
}

button[type="submit"]:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(240, 126, 1, 0.4);
  transform: translateY(-2px);
}

button[type="submit"]:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(240, 126, 1, 0.3);
}

/* === E-CATALOG CONTAINER === */
.ecatalog-container {
  width: 100%;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  padding: clamp(16px, 4vw, 24px);
  margin-top: 24px;
  box-shadow: var(--shadow-md);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: fadeIn 0.7s ease-out;
  animation-delay: 0.2s;
  animation-fill-mode: both;
}

.ecatalog-container h3 {
  font-size: clamp(17px, 3.5vw, 22px);
  color: var(--primary-color);
  margin-bottom: 12px;
  position: relative;
  display: inline-block;
}

.ecatalog-container h3::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  height: 2px;
  background-color: var(--primary-color);
  border-radius: 1px;
}

.ecatalog-container p {
  font-size: clamp(13px, 2.5vw, 16px);
  color: var(--text-secondary);
  margin-bottom: 20px;
  word-wrap: break-word;
  line-height: 1.6;
}

.ecatalog-container .phone-highlight {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1.1em;
  letter-spacing: 0.5px;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 30px;
  background: rgba(240, 126, 1, 0.1);
  transition: all var(--transition-normal);
}

.ecatalog-container .phone-highlight:hover {
  background: rgba(240, 126, 1, 0.2);
  transform: translateY(-2px);
}

/* === E-CATALOG BUTTONS === */
.ecatalog-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  width: 100%;
  margin-top: 5px;
}

.whatsapp-btn,
.call-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 30px;
  border: none;
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  font-weight: 600;
  font-size: clamp(14px, 2.8vw, 16px);
  text-decoration: none;
  transition: all var(--transition-normal);
  flex: 1 1 120px;
  max-width: 180px;
  backdrop-filter: blur(5px);
  box-shadow: var(--shadow-sm);
}

.whatsapp-btn {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.whatsapp-btn.full-width {
  max-width: none;
  width: 100%;
}

.call-btn {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
}

/* FontAwesome icons for buttons */
.whatsapp-btn i.fab.fa-whatsapp,
.call-btn i.fas.fa-phone-alt,
.call-btn i.fas.fa-phone {
  font-size: 18px;
  margin-right: 8px;
}

/* Fix for reversed phone icon */
.call-btn i.fas.fa-phone {
  transform: scaleX(-1) rotate(-45deg);
  position: relative;
  top: 1px;
}

/* Proper styling for phone-alt icon (no transform needed) */
.call-btn i.fas.fa-phone-alt {
  position: relative;
  top: 1px;
}

.whatsapp-btn:hover,
.call-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.whatsapp-btn:active,
.call-btn:active {
  transform: translateY(1px);
}

.whatsapp-btn img, .call-btn img {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Fallback for missing SVG icons */
.whatsapp-btn::before, .call-btn::before {
  display: inline-block;
  font-family: "Font Awesome 5 Free", "Font Awesome 5 Brands";
  font-weight: 900;
  font-size: 18px;
  margin-right: 8px;
  vertical-align: middle;
}

.whatsapp-btn img[src*="undefined"], 
.whatsapp-btn img:not([src]), 
.whatsapp-btn img[src=""], 
.whatsapp-btn img:not(:loaded) {
  display: none;
}

.call-btn img[src*="undefined"], 
.call-btn img:not([src]), 
.call-btn img[src=""], 
.call-btn img:not(:loaded) {
  display: none;
}

.whatsapp-btn img[src*="undefined"] ~ span::before,
.whatsapp-btn img:not([src]) ~ span::before,
.whatsapp-btn img[src=""] ~ span::before,
.whatsapp-btn img:not(:loaded) ~ span::before {
  content: "\f232"; /* WhatsApp icon */
  font-family: "Font Awesome 5 Brands";
  margin-right: 8px;
}

.call-btn img[src*="undefined"] ~ span::before,
.call-btn img:not([src]) ~ span::before,
.call-btn img[src=""] ~ span::before,
.call-btn img:not(:loaded) ~ span::before {
  content: "\f879"; /* Phone-alt icon (fa-phone-alt) */
  font-family: "Font Awesome 5 Free";
  margin-right: 8px;
}

/* === LANGUAGE MODAL === */
#language-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overflow: hidden;
  animation: fadeIn 0.5s ease-out;
}

#language-modal.show-modal {
  display: flex;
}

#language-modal.hide-modal {
  display: none;
}

#language-modal form.modern-lang-form {
  background: #ffffff;
  padding: clamp(2rem, 5vw, 3rem);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  text-align: center;
  width: min(90%, 360px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

#language-modal h3 {
  color: #333;
  margin-bottom: 24px;
  font-family: var(--font-family-heading);
  font-weight: 600;
  font-size: 1.4rem;
}

#language-modal .language-buttons {
  display: flex;
  gap: 16px;
  width: 100%;
  justify-content: center;
}

#language-modal .lang-btn {
  flex: 1;
  padding: 14px 20px;
  border-radius: 8px;
  border: 2px solid #f0f0f0;
  background-color: #ffffff;
  color: #333;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 110px;
  text-align: center;
}

#language-modal .lang-btn:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* === TYPEWRITER EFFECT === */
#typewriter-cursor {
  display: inline-block;
  animation: blink 1.1s steps(2) infinite;
  font-weight: 600;
  color: var(--primary-color);
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* === CATALOG STATUS === */
.catalog-status {
  margin-top: 24px; 
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 30px;
  padding: 8px 18px;
  box-shadow: var(--shadow-sm);
  width: auto;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fadeIn 0.7s ease-out;
  animation-delay: 0.4s;
  animation-fill-mode: both;
}

.catalog-status-dot {
  display: inline-block;
  min-width: 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 2px;
  flex-shrink: 0;
}

.catalog-status-text {
  color: #2ecc40;
  font-weight: 600;
  font-size: clamp(14px, 3vw, 16px);
  letter-spacing: 0.3px;
}

.catalog-status-text-red {
  color: #ff4136;
  font-weight: 600;
  font-size: clamp(14px, 3vw, 16px);
  letter-spacing: 0.3px;
}

.live-dot {
  background: #2ecc40;
  box-shadow: 0 0 6px 2px rgba(46, 204, 64, 0.4);
  animation: live-dot-wave 2s infinite ease-in-out;
}

.live-red-dot {
  background: #ff4136;
  box-shadow: 0 0 6px 2px rgba(255, 65, 54, 0.4);
  animation: live-red-dot-wave 2s infinite ease-in-out;
}

@keyframes live-dot-wave {
  0% {
    box-shadow: 0 0 6px 2px rgba(46, 204, 64, 0.4);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 18px 8px rgba(46, 204, 64, 0.2);
    opacity: 0.7;
  }
  100% {
    box-shadow: 0 0 6px 2px rgba(46, 204, 64, 0.4);
    opacity: 1;
  }
}

@keyframes live-red-dot-wave {
  0% {
    box-shadow: 0 0 6px 2px rgba(255, 65, 54, 0.4);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 18px 8px rgba(255, 65, 54, 0.2);
    opacity: 0.7;
  }
  100% {
    box-shadow: 0 0 6px 2px rgba(255, 65, 54, 0.4);
    opacity: 1;
  }
}

/* === RESPONSIVE ADJUSTMENTS === */
@media (max-width: 480px) {
  html {
    font-size: 15px;
  }
  
  .login-container {
    padding: clamp(15px, 4vw, 25px);
  }
  
  .input-group {
    margin-bottom: 18px;
  }
}

@media (max-height: 700px) {
  .login-container {
    padding: 20px 15px;
    margin: 15px 0;
  }
  
  h2 {
    margin-bottom: 15px;
  }
  
  .ecatalog-container {
    padding: 15px;
    margin-top: 15px;
  }
  
  .catalog-status {
    margin-top: 15px;
    padding: 6px 14px;
  }
}

/* === ACCESSIBILITY === */
:focus {
  outline: 3px solid rgba(240, 126, 1, 0.5);
  outline-offset: 2px;
}

/* === TEXT SELECTION === */
::selection {
  background-color: var(--primary-color);
  color: white;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
