/**
 * Capacitor Enhancements & Pray As You Go Aesthetic
 * Enhanced visual design with smooth animations and modern UI
 */

/* ============================================
   ACCESS CODE SCREEN STYLES
   ============================================ */

#access-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0%, 100% {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  }
  50% {
    background: linear-gradient(135deg, #f093fb 0%, #667eea 50%, #764ba2 100%);
  }
}

.access-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 3rem 2.5rem;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.access-card-logo {
  width: 100px;
  height: 100px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.access-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.access-card h2 {
  font-size: 1.8rem;
  color: #2d3748;
  margin-bottom: 0.5rem;
  text-align: center;
  font-weight: 700;
}

.access-card p {
  color: #718096;
  text-align: center;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.access-input-group {
  margin-bottom: 1.5rem;
}

.access-input {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1.1rem;
  text-align: center;
  letter-spacing: 2px;
  transition: all 0.3s ease;
  font-weight: 600;
  background: #f7fafc;
}

.access-input:focus {
  outline: none;
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.access-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.access-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

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

.error-message {
  color: #e53e3e;
  font-size: 0.9rem;
  text-align: center;
  margin-top: 1rem;
  display: none;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.access-input.shake {
  animation: shake 0.5s ease;
  border-color: #e53e3e;
}

#access-screen.access-granted {
  animation: fadeOut 0.6s ease forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: scale(1.1);
  }
}

/* Main app hidden by default */
#main-app {
  display: none;
}

#main-app.fade-in {
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ============================================
   PRAY AS YOU GO AESTHETIC ENHANCEMENTS
   ============================================ */

/* Smoother scrolling */
html {
  scroll-behavior: smooth;
}

/* Enhanced card designs */
.prayer-card,
.action-btn,
.card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.prayer-card:hover,
.action-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.prayer-card:active,
.action-btn:active {
  transform: translateY(-2px);
}

/* Improved gradient text */
.gradient-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Enhanced touch targets for mobile */
.btn, .nav-link, .dropdown-item {
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* Better focus states for accessibility */
button:focus,
input:focus,
a:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* Improved dark mode */
@media (prefers-color-scheme: dark) {
  .access-card {
    background: rgba(45, 55, 72, 0.95);
  }
  
  .access-card h2 {
    color: #e2e8f0;
  }
  
  .access-card p {
    color: #a0aec0;
  }
  
  .access-input {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
  }
  
  .access-input:focus {
    background: #1a202c;
    border-color: #667eea;
  }
}

/* Enhanced loading states */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #667eea;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
  to { transform: rotate(360deg); }
}

/* Capacitor safe area support */
body {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* iOS notch support */
@supports (padding-top: env(safe-area-inset-top)) {
  .navbar.fixed-top {
    padding-top: calc(0.5rem + env(safe-area-inset-top));
  }
}

/* Android status bar */
.masthead {
  padding-top: calc(8rem + env(safe-area-inset-top));
}

/* Enhanced ripple effect for buttons */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
  width: 300px;
  height: 300px;
}

/* Improved text readability */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Better contrast for prayer text */
.prayer-text,
.card-text {
  line-height: 1.8;
  font-size: 1.05rem;
  color: var(--text-primary, #2d3748);
}

/* Enhanced color scheme */
:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --accent-color: #f093fb;
  --text-primary: #2d3748;
  --text-secondary: #718096;
  --bg-light: #f7fafc;
  --bg-white: #ffffff;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

/* Dark mode enhancements */
[data-theme="dark"] {
  --primary-color: #7c3aed;
  --secondary-color: #a78bfa;
  --text-primary: #e2e8f0;
  --text-secondary: #a0aec0;
  --bg-light: #1a202c;
  --bg-white: #2d3748;
}

/* Smooth transitions globally */
* {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Disable transitions on theme change */
.no-transition * {
  transition: none !important;
}
