/* Organic Splash Screen Styles - Mobile Friendly */

#app-splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 25%, #a5d6a7 50%, #81c784 75%, #66bb6a 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* Organic background pattern */
#app-splash-screen::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(3, 92, 49, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(76, 175, 80, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(129, 199, 132, 0.1) 0%, transparent 50%);
  animation: organicFloat 20s ease-in-out infinite;
}

#app-splash-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.splash-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
}

.splash-logo {
  max-width: 140px;
  width: 35vw;
  height: auto;
  max-height: 140px;
  margin-bottom: 30px;
  opacity: 1;
  animation: logoFadeIn 1s ease-out 0.3s forwards, logoFloat 3s ease-in-out 1.3s infinite;
  filter: drop-shadow(0 4px 12px rgba(3, 92, 49, 0.3));
  object-fit: contain;
  display: block;
  visibility: visible;
}

/* Fallback text styling */
.splash-logo-fallback {
  font-size: 32px;
  font-weight: 700;
  color: #035C31;
  font-family: "Hind Siliguri", sans-serif;
  text-align: center;
  margin-bottom: 30px;
  opacity: 0;
  animation: logoFadeIn 1s ease-out 0.3s forwards, logoFloat 3s ease-in-out 1.3s infinite;
  text-shadow: 0 2px 8px rgba(3, 92, 49, 0.2);
}

.splash-loader {
  width: 50px;
  height: 50px;
  position: relative;
  margin-top: 20px;
}

.splash-loader::before,
.splash-loader::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  border: 3px solid transparent;
}

.splash-loader::before {
  width: 50px;
  height: 50px;
  border-top: 3px solid #035C31;
  border-right: 3px solid #035C31;
  animation: organicSpin 1.2s linear infinite;
}

.splash-loader::after {
  width: 35px;
  height: 35px;
  top: 7.5px;
  left: 7.5px;
  border-bottom: 3px solid #66bb6a;
  border-left: 3px solid #66bb6a;
  animation: organicSpin 0.8s linear infinite reverse;
}

/* Organic decorative elements */
.organic-leaf {
  position: absolute;
  width: 40px;
  height: 40px;
  opacity: 0.3;
  z-index: 0;
}

.organic-leaf-1 {
  top: 15%;
  left: 10%;
  animation: leafFloat1 4s ease-in-out infinite;
  background: radial-gradient(ellipse at center, #66bb6a 0%, transparent 70%);
  border-radius: 0 100% 0 100%;
  transform: rotate(-20deg);
}

.organic-leaf-2 {
  top: 20%;
  right: 15%;
  animation: leafFloat2 5s ease-in-out infinite;
  background: radial-gradient(ellipse at center, #81c784 0%, transparent 70%);
  border-radius: 100% 0 100% 0;
  transform: rotate(25deg);
}

.organic-leaf-3 {
  bottom: 25%;
  left: 15%;
  animation: leafFloat3 6s ease-in-out infinite;
  background: radial-gradient(ellipse at center, #a5d6a7 0%, transparent 70%);
  border-radius: 0 100% 0 100%;
  transform: rotate(15deg);
}

.organic-leaf-4 {
  bottom: 20%;
  right: 10%;
  animation: leafFloat4 4.5s ease-in-out infinite;
  background: radial-gradient(ellipse at center, #66bb6a 0%, transparent 70%);
  border-radius: 100% 0 100% 0;
  transform: rotate(-30deg);
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
  .splash-logo {
    max-width: 120px;
    width: 40vw;
    max-height: 120px;
    margin-bottom: 25px;
  }
  
  .splash-logo-fallback {
    font-size: 28px;
    margin-bottom: 25px;
  }
  
  .splash-loader {
    width: 45px;
    height: 45px;
  }
  
  .splash-loader::before {
    width: 45px;
    height: 45px;
  }
  
  .splash-loader::after {
    width: 32px;
    height: 32px;
    top: 6.5px;
    left: 6.5px;
  }
  
  .organic-leaf {
    width: 30px;
    height: 30px;
  }
  
  .organic-leaf-1 {
    top: 10%;
    left: 5%;
  }
  
  .organic-leaf-2 {
    top: 15%;
    right: 10%;
  }
  
  .organic-leaf-3 {
    bottom: 20%;
    left: 10%;
  }
  
  .organic-leaf-4 {
    bottom: 15%;
    right: 5%;
  }
}

@media screen and (max-width: 480px) {
  .splash-logo {
    max-width: 100px;
    width: 45vw;
    max-height: 100px;
    margin-bottom: 20px;
  }
  
  .splash-logo-fallback {
    font-size: 24px;
    margin-bottom: 20px;
  }
  
  .splash-loader {
    width: 40px;
    height: 40px;
    margin-top: 15px;
  }
  
  .splash-loader::before {
    width: 40px;
    height: 40px;
    border-width: 2.5px;
  }
  
  .splash-loader::after {
    width: 28px;
    height: 28px;
    top: 6px;
    left: 6px;
    border-width: 2.5px;
  }
  
  .organic-leaf {
    width: 25px;
    height: 25px;
    opacity: 0.25;
  }
  
  .splash-content {
    padding: 15px;
  }
}

/* Landscape orientation on mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .splash-logo {
    max-width: 80px;
    width: 20vw;
    max-height: 80px;
    margin-bottom: 15px;
  }
  
  .splash-logo-fallback {
    font-size: 20px;
    margin-bottom: 15px;
  }
  
  .splash-loader {
    width: 35px;
    height: 35px;
    margin-top: 10px;
  }
  
  .splash-loader::before {
    width: 35px;
    height: 35px;
  }
  
  .splash-loader::after {
    width: 25px;
    height: 25px;
    top: 5px;
    left: 5px;
  }
  
  .organic-leaf {
    display: none; /* Hide decorative elements in landscape to save space */
  }
}

/* Animations */
@keyframes logoFadeIn {
  from {
    opacity: 0.3;
    transform: scale(0.9) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes logoFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.02);
  }
}

@keyframes organicSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes organicFloat {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(30px, -30px) rotate(120deg);
  }
  66% {
    transform: translate(-20px, 20px) rotate(240deg);
  }
}

@keyframes leafFloat1 {
  0%, 100% {
    transform: translate(0, 0) rotate(-20deg) scale(1);
  }
  50% {
    transform: translate(15px, -20px) rotate(-15deg) scale(1.1);
  }
}

@keyframes leafFloat2 {
  0%, 100% {
    transform: translate(0, 0) rotate(25deg) scale(1);
  }
  50% {
    transform: translate(-20px, 15px) rotate(30deg) scale(1.15);
  }
}

@keyframes leafFloat3 {
  0%, 100% {
    transform: translate(0, 0) rotate(15deg) scale(1);
  }
  50% {
    transform: translate(20px, 20px) rotate(20deg) scale(1.1);
  }
}

@keyframes leafFloat4 {
  0%, 100% {
    transform: translate(0, 0) rotate(-30deg) scale(1);
  }
  50% {
    transform: translate(-15px, -15px) rotate(-25deg) scale(1.12);
  }
}

/* Prevent text selection on splash screen */
#app-splash-screen {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Ensure splash screen works on iOS Safari */
@supports (-webkit-touch-callout: none) {
  #app-splash-screen {
    position: -webkit-sticky;
    position: sticky;
  }
}

