/* JaneX - Optimized CSS */
:root {
  /* Colors */
  --primary-gradient: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 25%, #16213e 50%, #0f3460 75%, #533483 100%);
  --secondary-gradient: linear-gradient(135deg, #0f3460 0%, #533483 50%, #e94560 100%);
  --accent-gradient: linear-gradient(135deg, #e94560 0%, #f39c12 50%, #f1c40f 100%);
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  
  /* Text colors */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.95);
  --text-muted: rgba(255, 255, 255, 0.8);
  
  /* Backgrounds */
  --bg-primary: rgba(255, 255, 255, 0.1);
  --bg-secondary: rgba(255, 255, 255, 0.05);
  
  /* Borders */
  --border-primary: rgba(255, 255, 255, 0.2);
  --border-secondary: rgba(255, 255, 255, 0.1);
  
  /* Shadows */
  --shadow-primary: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-secondary: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.7);
  
  /* Border radius */
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  /* Transitions */
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Z-index layers */
  --z-background: -2;
  --z-particles: -1;
  --z-content: 5;
  --z-header: 10;
  --z-modal: 1000;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow: hidden;
}

body {
  font-family: "SF Pro Text", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--primary-gradient);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  line-height: 1.6;
  font-weight: 400;
  position: relative;
}

/* Animated Background */
body::before,
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-background);
}

body::before {
  background: var(--primary-gradient);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

body::after {
  background: 
    radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 107, 53, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(233, 69, 96, 0.2) 0%, transparent 50%);
  animation: float 20s ease-in-out infinite;
  z-index: calc(var(--z-background) + 1);
}

/* Animations */
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-20px) rotate(1deg); }
  66% { transform: translateY(20px) rotate(-1deg); }
}

/* Particles */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: var(--z-particles);
}

.particle {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: particleFloat 20s infinite linear;
}

.particle:nth-child(1) { width: 4px; height: 4px; left: 10%; animation-delay: 0s; animation-duration: 25s; }
.particle:nth-child(2) { width: 6px; height: 6px; left: 20%; animation-delay: 2s; animation-duration: 30s; }
.particle:nth-child(3) { width: 3px; height: 3px; left: 30%; animation-delay: 4s; animation-duration: 20s; }
.particle:nth-child(4) { width: 5px; height: 5px; left: 40%; animation-delay: 6s; animation-duration: 35s; }
.particle:nth-child(5) { width: 4px; height: 4px; left: 50%; animation-delay: 8s; animation-duration: 28s; }
.particle:nth-child(6) { width: 6px; height: 6px; left: 60%; animation-delay: 10s; animation-duration: 32s; }
.particle:nth-child(7) { width: 3px; height: 3px; left: 70%; animation-delay: 12s; animation-duration: 22s; }
.particle:nth-child(8) { width: 5px; height: 5px; left: 80%; animation-delay: 14s; animation-duration: 38s; }
.particle:nth-child(9) { width: 4px; height: 4px; left: 90%; animation-delay: 16s; animation-duration: 26s; }

@keyframes particleFloat {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10%, 90% { opacity: 1; }
  100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

/* Layout */
.container {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

/* Header */
.main-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 2rem 0.125rem;
  gap: 0.5rem;
  position: relative;
  z-index: var(--z-header);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text-primary);
  text-shadow: 0 0 25px rgba(255, 255, 255, 0.4);
  letter-spacing: -0.03em;
  transition: var(--transition-normal);
}

.header-logo i {
  color: var(--accent-gradient);
  font-size: 2.8rem;
  text-shadow: 0 0 30px rgba(102, 126, 234, 0.7);
  filter: drop-shadow(0 0 15px rgba(102, 126, 234, 0.5));
  transition: var(--transition-normal);
}

.header-logo:hover i {
  transform: scale(1.1) rotate(5deg);
  text-shadow: 0 0 40px rgba(102, 126, 234, 0.9);
  filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.7));
}

.header-logo:hover {
  text-shadow: 0 0 35px rgba(255, 255, 255, 0.6);
}

.header-tagline {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  opacity: 0.8;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  position: relative;
  z-index: var(--z-content);
  min-height: 0;
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin: 0 0 1.5rem;
  max-width: 700px;
  position: relative;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: -20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  z-index: -1;
  animation: heroGlow 4s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  0% { box-shadow: 0 0 20px rgba(233, 69, 96, 0.3); }
  100% { box-shadow: 0 0 40px rgba(233, 69, 96, 0.6); }
}

.hero-title {
  font-family: "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.1;
  letter-spacing: -0.025em;
  background: linear-gradient(45deg, #fff, #e0e0e0, #fff);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShine 3s ease-in-out infinite;
}

@keyframes textShine {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-title .highlight {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Apps Grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.2rem;
  max-width: 750px;
  width: 100%;
}

.app-card {
  background: var(--bg-primary);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-primary);
  min-width: 0;
}

.app-card::before,
.app-card::after {
  content: '';
  position: absolute;
  transition: var(--transition-normal);
}

.app-card::before {
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
  opacity: 0;
}

.app-card::after {
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: rotate 10s linear infinite;
  opacity: 0;
}

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

.app-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-secondary);
}

.app-card:hover::before,
.app-card:hover::after {
  opacity: 1;
}

.app-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.25rem;
}

.app-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-secondary);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.app-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.2), transparent);
  border-radius: 50%;
  animation: iconGlow 2s ease-in-out infinite alternate;
}

@keyframes iconGlow {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

.app-content {
  position: relative;
  z-index: 2;
}

.app-header-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  text-align: left;
}

.app-title-section {
  flex: 1;
  min-width: 0;
}

.app-category {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.app-title {
  font-family: "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 0;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.app-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
  line-height: 1.4;
  text-align: left;
}

.app-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.app-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-fast);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  letter-spacing: 0.025em;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  min-width: 0;
  flex-shrink: 0;
  width: auto;
  max-width: 45%;
}

.app-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.app-link:hover::before {
  left: 100%;
}

.app-link.primary {
  background: var(--accent-gradient);
  color: var(--text-primary);
  box-shadow: var(--shadow-secondary);
}

.app-link.primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.app-link.secondary {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-secondary);
}

.app-link.secondary:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.app-link i {
  transition: var(--transition-fast);
}

.app-link:hover i {
  transform: scale(1.1);
}

/* Footer */
.footer {
  margin-top: 2rem;
  position: relative;
  z-index: var(--z-header);
  flex-shrink: 0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
  transition: var(--transition-normal);
}

.footer-logo i {
  color: var(--accent-gradient);
  font-size: 0.9rem;
  text-shadow: 0 0 15px rgba(102, 126, 234, 0.4);
  filter: drop-shadow(0 0 6px rgba(102, 126, 234, 0.2));
  transition: var(--transition-normal);
}

.footer-logo:hover i {
  transform: scale(1.1);
  text-shadow: 0 0 35px rgba(102, 126, 234, 0.8);
  filter: drop-shadow(0 0 15px rgba(102, 126, 234, 0.6));
}

.footer-logo:hover {
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.8;
}

.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.75rem;
  transition: var(--transition-fast);
}

.footer-link:hover {
  color: var(--text-primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-secondary);
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: var(--z-modal);
  inset: 0;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  overflow-y: auto;
}

.modal-content {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  margin: auto;
  padding: 0;
  width: 95%;
  max-width: 700px;
  height: auto;
  max-height: 98vh;
  overflow: visible;
  box-shadow: var(--shadow-hover);
  animation: modalSlideIn 0.3s ease;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  position: relative;
  z-index: 20;
}

.modal-header h3 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.modal-body {
  padding: 1.5rem;
  color: var(--text-secondary);
  line-height: 1.5;
  height: auto;
  overflow: visible;
  background: rgba(0, 0, 0, 0.3);
  font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  body { overflow: auto; }
  
  .container {
    padding: 1rem;
    overflow: auto;
    height: auto;
    min-height: 100vh;
  }
  
  .main-content { gap: 3rem; }
  .hero-section { margin-top: 1rem; }
  .main-header { padding: 2rem 2rem 1rem; }
  .hero-title { font-size: 2rem; }
  .hero-subtitle { font-size: 0.875rem; }
  
  .apps-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    max-width: 100%;
  }
  
  .app-card { padding: 1.25rem; max-width: 100%; }
  .app-icon { width: 48px; height: 48px; font-size: 1rem; }
  .app-title { font-size: 1.25rem; }
  .app-description { font-size: 0.9rem; margin-bottom: 1.25rem; }
  
  .app-actions {
    flex-direction: row;
    gap: 0.5rem;
    flex-wrap: nowrap;
    justify-content: center;
  }
  
  .app-link { 
    padding: 0.75rem 1.25rem; 
    font-size: 0.85rem; 
    gap: 0.4rem;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .modal-content {
    margin: 2% auto;
    width: 95%;
    max-height: 90vh;
  }
  
  .modal-header { padding: 1rem 1.5rem; }
  .modal-body { padding: 1.5rem; }
}

@media (max-width: 480px) {
  body { overflow: auto; }
  
  .container {
    padding: 0.75rem;
    overflow: auto;
    height: auto;
    min-height: 100vh;
  }
  
  .hero-title { font-size: 1.75rem; }
  .main-content { gap: 2.5rem; }
  .app-card { padding: 1rem; }
  .app-icon { width: 40px; height: 40px; font-size: 0.875rem; }
  .app-title { font-size: 1.125rem; }
  .app-description { font-size: 0.85rem; margin-bottom: 1rem; }
  
  .app-link {
    padding: 0.625rem 1rem;
    font-size: 0.75rem;
    min-width: auto;
    max-width: 40%;
    gap: 0.3rem;
  }
  
  .app-actions { gap: 0.2rem; flex-wrap: nowrap; }
  
  .modal-content {
    margin: 1% auto;
    width: 98%;
    max-height: 95vh;
  }
  
  .modal-header { padding: 0.875rem 1.25rem; }
  .modal-header h3 { font-size: 1.25rem; }
  .modal-body { padding: 1.25rem; }
}

@media (max-height: 800px) {
  body { overflow: auto; }
  
  .container {
    padding: 1rem;
    overflow: auto;
    height: auto;
    min-height: 100vh;
  }
  
  .main-content { gap: 1.75rem; }
  .hero-section { margin-bottom: 1.5rem; }
  .hero-title { font-size: 2rem; margin-bottom: 0.75rem; }
  .hero-subtitle { font-size: 0.875rem; }
  .app-card { padding: 1.25rem; }
  .app-icon { width: 48px; height: 48px; font-size: 1rem; }
  .app-title { font-size: 1.25rem; margin-bottom: 0.5rem; }
  .app-description { font-size: 0.9rem; margin-bottom: 1.25rem; }
  
  .app-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.5rem;
    justify-content: center;
  }
  
  .footer { margin-top: 1.5rem; }
}

@media (max-height: 600px) {
  body { overflow: auto; }
  
  .container {
    padding: 0.75rem;
    overflow: auto;
    height: auto;
    min-height: 100vh;
  }
  
  .main-content { gap: 1.25rem; }
  .hero-section { margin-bottom: 1rem; }
  .hero-title { font-size: 1.75rem; margin-bottom: 0.5rem; }
  .hero-subtitle { font-size: 0.8rem; }
  .app-card { padding: 1rem; }
  .app-icon { width: 40px; height: 40px; font-size: 0.875rem; }
  .app-title { font-size: 1.125rem; margin-bottom: 0.5rem; }
  .app-description { font-size: 0.75rem; margin-bottom: 1rem; }
  
  .app-actions {
    gap: 0.375rem;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
  }
  
  .app-link { 
    padding: 0.5rem 0.75rem; 
    font-size: 0.8rem; 
    gap: 0.3rem;
  }
  .footer { margin-top: 1rem; }
}
