/* AI Monster Mobile Enhancements with Lightning Effects */

/* Enhanced Lightning Background Animation - DISABLED */
/*
@keyframes lightning {
  0%, 90%, 100% { opacity: 0; }
  5% { opacity: 1; box-shadow: 0 0 100px rgba(0, 255, 255, 0.8), 0 0 200px rgba(139, 0, 255, 0.6); }
  10% { opacity: 0; }
  15% { opacity: 1; box-shadow: 0 0 80px rgba(0, 255, 65, 0.9), 0 0 160px rgba(0, 255, 255, 0.7); }
  20% { opacity: 0; }
}
*/

/* Electric Pulse Animation - DISABLED */
/*
@keyframes electricPulse {
  0%, 100% {
    background-position: 0% 50%;
    filter: brightness(1) saturate(1);
  }
  25% {
    background-position: 25% 50%;
    filter: brightness(1.2) saturate(1.3);
  }
  50% {
    background-position: 100% 50%;
    filter: brightness(1.5) saturate(1.5);
  }
  75% {
    background-position: 75% 50%;
    filter: brightness(1.2) saturate(1.3);
  }
}
*/

/* Enhanced Lightning Background - DISABLED */
/*
body::before {
  background:
    radial-gradient(circle at 20% 30%, rgba(0, 255, 255, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(139, 0, 255, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(0, 255, 65, 0.1) 0%, transparent 70%),
    linear-gradient(45deg,
      rgba(0, 255, 65, 0.08) 0%,
      rgba(0, 255, 255, 0.08) 25%,
      rgba(139, 0, 255, 0.08) 50%,
      rgba(0, 255, 65, 0.08) 75%,
      rgba(0, 255, 65, 0.08) 100%);
  background-size: 200% 200%, 150% 150%, 300% 300%, 400% 400%;
  animation: electricPulse 8s ease infinite, lightningFlash 12s infinite;
}
*/

/* Lightning Flash - DISABLED */
/*
@keyframes lightningFlash {
  0%, 85%, 100% { opacity: 0.5; }
  87%, 89%, 91% { opacity: 0.8; filter: brightness(1.3); }
  88%, 90% { opacity: 0.3; filter: brightness(0.8); }
}
*/

/* Lightning Strike Effects - DISABLED */
/*
.lightning-strike {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(45deg,
    transparent 40%,
    rgba(0, 255, 255, 0.05) 50%,
    transparent 60%);
  animation: lightningStrike 15s infinite;
}
*/

/* Lightning Strike Animation - DISABLED */
/*
@keyframes lightningStrike {
  0%, 90%, 100% {
    opacity: 0;
    transform: translateX(-100px) rotate(45deg);
  }
  93% {
    opacity: 1;
    transform: translateX(calc(100vw + 100px)) rotate(45deg);
  }
  95% {
    opacity: 0.5;
    transform: translateX(calc(100vw + 200px)) rotate(45deg);
  }
}
*/

/* Add lightning strike element - DISABLED */
/*
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(45deg,
    transparent 48%,
    rgba(0, 255, 255, 0.1) 49%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(0, 255, 255, 0.1) 51%,
    transparent 52%);
  animation: lightningStrike 18s infinite;
  opacity: 0;
}
*/

/* Samsung Galaxy Fold 5 Specific Optimizations */
/* Folded State: 6.2" (904x2316px) */
@media screen and (max-width: 904px) and (max-height: 2316px) {
  .main-title {
    font-size: 1.8rem !important;
    line-height: 1.2;
  }

  .sub-title {
    font-size: 1rem !important;
  }

  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  .performance-indicator {
    padding: 1rem !important;
    gap: 1rem;
  }

  .performance-score {
    font-size: 2rem !important;
  }

  .current-specs {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .spec-item {
    padding: 1rem !important;
  }

  .upgrade-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }

  .upgrade-panel {
    padding: 1.5rem !important;
  }

  .suggestion-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }

  .component-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
}

/* Unfolded State: 7.6" (1812x2176px) */
@media screen and (min-width: 905px) and (max-width: 1812px) and (max-height: 2176px) {
  .current-specs {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .upgrade-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .status-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* General Mobile Improvements */
@media screen and (max-width: 768px) {
  .app-container {
    padding: 0.75rem !important;
  }

  .section {
    padding: 1.5rem !important;
    margin-bottom: 1.5rem !important;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
  }

  .section-title {
    font-size: 1.5rem !important;
  }

  .machine-status {
    padding: 1.5rem !important;
  }

  .status-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .upgrade-priority {
    position: static !important;
    display: inline-block;
    margin-bottom: 1rem;
  }

  .upgrade-title {
    font-size: 1.2rem !important;
    margin-top: 0.5rem;
  }

  .component-image {
    width: 60px !important;
    height: 60px !important;
    font-size: 1.5rem !important;
  }

  .component-name {
    font-size: 0.9rem !important;
  }

  .component-specs {
    font-size: 0.75rem !important;
    line-height: 1.3;
  }

  .got-button {
    padding: 0.6rem 1.2rem !important;
    font-size: 0.8rem !important;
  }

  .awd-link, .pricespy-link, .amazon-link {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.7rem !important;
  }
}

/* Very Small Screens */
@media screen and (max-width: 480px) {
  .main-title {
    font-size: 1.5rem !important;
  }

  .header {
    padding: 1.5rem !important;
  }

  .performance-indicator {
    flex-direction: column !important;
    text-align: center;
  }

  .dragon-icon {
    width: 2rem !important;
    height: 2rem !important;
  }

  .dragon-icon-large {
    width: 2.5rem !important;
    height: 2.5rem !important;
  }

  .suggestion-item {
    padding: 1rem !important;
  }

  .component-actions {
    width: 100%;
  }

  .component-actions > * {
    flex: 1;
    min-width: 0;
  }
}

/* Enhanced Touch Targets for Mobile */
@media (hover: none) and (pointer: coarse) {
  .got-button {
    min-height: 44px !important;
    min-width: 44px !important;
  }

  .awd-link, .pricespy-link, .amazon-link {
    min-height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .spec-item, .upgrade-panel, .suggestion-item {
    transition: transform 0.1s ease !important;
  }

  .spec-item:active, .upgrade-panel:active {
    transform: scale(0.98) !important;
  }
}

/* Landscape Orientation Optimizations */
@media screen and (orientation: landscape) and (max-height: 600px) {
  .header {
    padding: 1rem !important;
  }

  .main-title {
    font-size: 1.8rem !important;
  }

  .performance-indicator {
    padding: 1rem 1.5rem !important;
  }

  .section {
    padding: 1.5rem !important;
  }

  .current-specs {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
  }

  .upgrade-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)) !important;
  }
}

/* Dynamic Viewport Height Support */
.app-container {
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height for mobile browsers */
}

/* Enhanced Scrolling */
.section {
  scroll-margin-top: 2rem;
}

/* Smooth scrolling for mobile */
html {
  scroll-behavior: smooth;
}

/* Enhanced focus states for mobile accessibility */
.got-button:focus-visible,
.awd-link:focus-visible,
.pricespy-link:focus-visible,
.amazon-link:focus-visible {
  outline: 3px solid var(--ai-green) !important;
  outline-offset: 2px !important;
}

/* Enhanced Loading States */
.loading-mobile {
  animation: mobilePulse 1.5s ease-in-out infinite;
}

@keyframes mobilePulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* Better text scaling */
@media screen and (max-width: 768px) {
  .upgrade-reason {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
  }

  .impact-list li {
    font-size: 0.8rem !important;
    line-height: 1.4 !important;
  }

  .status-label {
    font-size: 0.8rem !important;
  }

  .status-value {
    font-size: 1rem !important;
  }
}

/* Improved contrast for mobile readability */
@media screen and (max-width: 768px) {
  .section {
    background: rgba(26, 26, 26, 0.85) !important;
  }

  .upgrade-panel {
    background: rgba(56, 56, 56, 0.8) !important;
  }

  .spec-item {
    background: rgba(0, 255, 65, 0.15) !important;
  }

  .machine-status {
    background: rgba(0, 255, 65, 0.25) !important;
  }
}

/* Enhanced animations for mobile performance */
@media (prefers-reduced-motion: no-preference) {
  .upgrade-panel {
    transition: transform 0.2s ease, background-color 0.2s ease !important;
  }

  .spec-item {
    transition: transform 0.15s ease, background-color 0.15s ease !important;
  }
}

/* Samsung Fold 5 Fold/Unfold Transition Support */
@media screen and (min-width: 904px) and (max-width: 905px) {
  * {
    transition: all 0.3s ease !important;
  }

  .current-specs,
  .upgrade-grid,
  .status-grid {
    transition: grid-template-columns 0.5s ease !important;
  }
}

/* Enhanced Electric Effects for Mobile */
@media screen and (max-width: 768px) {
  .header::before {
    animation-duration: 4s !important;
  }

  .performance-indicator::before {
    animation-duration: 3s !important;
  }

  /* Reduce intensive effects on mobile for battery life */
  .performance-indicator::after {
    animation-duration: 6s !important;
  }

  .header::after {
    animation-duration: 8s !important;
  }
}

/* Mobile-specific electric particle effects - DISABLED */
/*
@media screen and (max-width: 768px) {
  .mobile-lightning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background:
      radial-gradient(ellipse at top left, rgba(0, 255, 255, 0.1) 0%, transparent 50%),
      radial-gradient(ellipse at bottom right, rgba(139, 0, 255, 0.1) 0%, transparent 50%);
    animation: mobileLightning 10s ease infinite;
  }
}
*/

/* Mobile Lightning Animations - DISABLED */
/*
@keyframes mobileLightning {
  0%, 100% { opacity: 0.3; }
  25% { opacity: 0.6; }
  50% { opacity: 0.4; }
  75% { opacity: 0.7; }
}
*/

/* Add mobile lightning element via JavaScript if needed - DISABLED */
/*
.js-mobile-lightning {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(
    45deg,
    transparent 48%,
    rgba(0, 255, 255, 0.05) 49%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(0, 255, 255, 0.05) 51%,
    transparent 52%
  );
  animation: mobileLightningStrike 12s infinite;
  opacity: 0;
}
*/

/* Mobile Lightning Strike Animation - DISABLED */
/*
@keyframes mobileLightningStrike {
  0%, 95%, 100% {
    opacity: 0;
    transform: translateX(-50px) rotate(30deg);
  }
  97% {
    opacity: 0.8;
    transform: translateX(calc(100vw + 50px)) rotate(30deg);
  }
}
*/

/* Lightning Flash Animation - DISABLED */
/*
@keyframes lightningFlash {
  0% { opacity: 0; }
  10% { opacity: 1; }
  20% { opacity: 0; }
  30% { opacity: 0.8; }
  40% { opacity: 0; }
  100% { opacity: 0; }
}
*/

/* Folded device specific styles */
.device-folded .current-specs {
  grid-template-columns: 1fr !important;
}

.device-folded .upgrade-grid {
  grid-template-columns: 1fr !important;
}

.device-folded .status-grid {
  grid-template-columns: 1fr !important;
}

.device-folded .header-content {
  flex-direction: column !important;
  text-align: center;
}

.device-folded .main-title {
  font-size: 1.6rem !important;
}

.device-folded .performance-indicator {
  flex-direction: column !important;
  padding: 1rem !important;
}

/* Unfolded device specific styles */
.device-unfolded .current-specs {
  grid-template-columns: repeat(2, 1fr) !important;
}

.device-unfolded .upgrade-grid {
  grid-template-columns: repeat(2, 1fr) !important;
}

.device-unfolded .status-grid {
  grid-template-columns: repeat(2, 1fr) !important;
}

/* Folded layout class */
.folded-layout {
  --section-gap: 1rem;
  --card-gap: 0.75rem;
}

.folded-layout .section {
  padding: 1.25rem !important;
}

.folded-layout .upgrade-panel {
  padding: 1.25rem !important;
}

/* Samsung Galaxy Fold 5 Specific CSS Optimizations */

/* Cover Screen (Folded): 6.2" 904×2316 pixels, 23.1:9 aspect ratio */
@media screen and (max-width: 904px) and (min-height: 2000px) {
  :root {
    --mobile-padding: 1rem;
    --mobile-gap: 1rem;
    --mobile-text-scale: 0.9;
  }

  .app-container {
    padding: var(--mobile-padding) !important;
  }

  .header {
    padding: 1.5rem var(--mobile-padding) !important;
    margin-bottom: 1.5rem !important;
  }

  .main-title {
    font-size: calc(1.8rem * var(--mobile-text-scale)) !important;
    text-align: center;
  }

  .sub-title {
    font-size: calc(1rem * var(--mobile-text-scale)) !important;
    text-align: center;
  }

  .performance-indicator {
    flex-direction: column !important;
    gap: 1rem !important;
    padding: 1rem !important;
  }

  .performance-score {
    font-size: 2.5rem !important;
  }

  .current-specs,
  .upgrade-grid,
  .status-grid {
    grid-template-columns: 1fr !important;
    gap: var(--mobile-gap) !important;
  }

  .spec-item,
  .upgrade-panel {
    padding: 1.25rem !important;
  }

  .suggestion-item {
    flex-direction: column !important;
    text-align: center;
    padding: 1rem !important;
  }

  .component-image {
    width: 60px !important;
    height: 60px !important;
    font-size: 1.8rem !important;
  }

  .component-actions {
    flex-direction: column !important;
    width: 100%;
    gap: 0.75rem !important;
  }

  .component-actions > * {
    width: 100% !important;
    text-align: center;
  }

  .dragon-icon {
    width: 1.8rem !important;
    height: 1.8rem !important;
  }

  .section-title {
    font-size: 1.4rem !important;
  }

  .upgrade-title {
    font-size: 1.2rem !important;
  }
}

/* Main Screen (Unfolded): 7.6" 1812×2176 pixels, 5:6 aspect ratio */
@media screen and (min-width: 1700px) and (max-width: 1900px) and (min-height: 2000px) and (max-height: 2300px) {
  :root {
    --tablet-columns: 2;
    --tablet-gap: 1.5rem;
  }

  .current-specs {
    grid-template-columns: repeat(var(--tablet-columns), 1fr) !important;
    gap: var(--tablet-gap) !important;
  }

  .upgrade-grid {
    grid-template-columns: repeat(var(--tablet-columns), 1fr) !important;
    gap: 2rem !important;
  }

  .status-grid {
    grid-template-columns: repeat(var(--tablet-columns), 1fr) !important;
  }

  .header-content {
    flex-direction: row !important;
    align-items: center;
  }

  .main-title {
    font-size: 2.5rem !important;
  }

  .performance-indicator {
    flex-direction: row !important;
    gap: 2rem !important;
  }

  .performance-score {
    font-size: 3.5rem !important;
  }

  .suggestion-item {
    flex-direction: row !important;
    align-items: center;
    text-align: left;
  }

  .component-image {
    width: 80px !important;
    height: 80px !important;
    font-size: 2rem !important;
  }
}
  gap: 0.75rem !important;
}

.component-actions > * {
  padding: 0.5rem 1rem !important;
  border-radius: 8px !important;
}

/* Better visual hierarchy on mobile */
@media screen and (max-width: 768px) {
  .upgrade-priority {
    font-size: 0.8rem !important;
    padding: 0.4rem 0.8rem !important;
  }

  .section-icon {
    font-size: 2rem !important;
  }

  .component-price {
    font-size: 1.1rem !important;
  }
}

/* Enhanced notification for mobile */
@media screen and (max-width: 768px) {
  .notification {
    top: 10px !important;
    right: 10px !important;
    left: 10px !important;
    padding: 1rem !important;
    font-size: 0.9rem !important;
    border-radius: 8px !important;
  }
}
