/* Base Styles for Mobile - Dark Theme */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0c0c0c 0%, #1a1a1a 100%);
  color: #e0e0e0;
  line-height: 1.6;
  min-height: 100vh;
  padding: 0 4vw;
}

/* Professional Homepage Banner Styles - Dark Mobile Theme */
.dev-banner {
  background: linear-gradient(135deg, #3730a3 0%, #5b21b6 100%);
  color: #ffffff;
  padding: 12px 15px;
  position: relative;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
  animation: slideDown 0.5s ease-out;
  margin: 0 -4vw;
  width: calc(100% + 8vw);
}

.banner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.banner-icon {
  animation: pulse 2s infinite;
  font-size: 18px;
  display: none; /* Hidden on mobile to save space */
}

.banner-text {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  margin: 0;
  text-align: center;
  padding: 0 10px;
  color: #ffffff;
}

.banner-link {
  color: #fbbf24;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
  padding: 0 2px;
  border-radius: 2px;
}

.banner-link:active {
  color: #ffffff;
  border-bottom-color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
}

.banner-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ffffff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
  position: absolute;
  top: 5px;
  right: 5px;
}

.banner-close:active {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Animated background effect for dark theme */
.banner-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(255, 255, 255, 0.05) 10px,
    rgba(255, 255, 255, 0.05) 20px
  );
  animation: slide 30s linear infinite;
}

/* Animations */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

@keyframes slide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-20px); }
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Mobile Wrapper */
.rm-wrapper {
  width: 100%;
  margin: 1.5rem auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 0;
}

/* Mobile Container for Text Content */
.rm-containerH {
  width: 100%;
  background: linear-gradient(145deg, #1a1a1a, #1e1e1e);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  border: 1px solid #2a2a2a;
  position: relative;
  overflow: hidden;
}

.rm-containerH::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #F90618, #2E3192);
}

/* Mobile Text Content Card */
.rm-card {
  background: linear-gradient(145deg, #1e1e1e, #252525);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  border-left: 4px solid #F90618;
  transition: all 0.3s ease;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  flex: 1;
}

.rm-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #F90618, #2E3192);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.rm-card:active {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.rm-card:active::before {
  opacity: 1;
}

/* Mobile Title Styling */
.rm-title {
  color: #ffffff;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  position: relative;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

.rm-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #F90618, #2E3192);
  margin: 0.5rem auto 0;
  border-radius: 2px;
}

/* Mobile Text Paragraph */
.rm-text {
  color: #e0e0e0;
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: left;
  margin-bottom: 1rem;
}

/* Mobile Image Styling */
.resus-vitals-image {
  width: 100%;
  max-width: 400px;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
  border: 1px solid #333;
  align-self: center;
  margin: 1rem 0;
}

.resus-vitals-image:active {
  transform: scale(1.02);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

/* Mobile Control Vitals Container */
.control-vitals-container {
  width: 100%;
  background: linear-gradient(145deg, #1a1a1a, #1e1e1e);
  padding: 2rem 1.5rem;
  border-radius: 14px;
  margin: 2rem auto;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  text-align: center;
  border: 1px solid #2a2a2a;
  position: relative;
  overflow: hidden;
}

.control-vitals-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #F90618, #2E3192);
}

.control-vitals-title {
  color: #ffffff;
  font-size: 1.6rem;
  margin-bottom: 2rem;
  padding-bottom: 0.8rem;
  display: inline-block;
  font-weight: 700;
  position: relative;
}

.control-vitals-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 3px;
  background: linear-gradient(90deg, #F90618, #2E3192);
  border-radius: 2px;
}

/* Mobile Button Grid */
.vital-control-buttons {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  justify-content: center;
  max-width: 100%;
  margin: 0 auto;
}

.control-button {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: linear-gradient(145deg, #1e1e1e, #252525);
  padding: 1.5rem;
  border-radius: 12px;
  border-left: 4px solid #F90618;
  transition: all 0.3s ease;
  color: #e0e0e0;
  min-height: 180px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  border: 1px solid #2a2a2a;
}

.control-button:active {
  background: linear-gradient(145deg, #252525, #2a2a2a);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  border-left: 4px solid #2E3192;
}

.button-title {
  font-size: 1.2rem;
  margin: 0 0 1rem 0;
  color: #ffffff;
  font-weight: 600;
  position: relative;
  line-height: 1.3;
  text-align: center;
}

.button-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, #F90618, #2E3192);
  margin: 0.5rem auto 0;
  border-radius: 1px;
}

.button-description {
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
  color: #b0b0b0;
  text-align: left;
  flex: 1;
}

/* Mobile Session ID Container */
.resus-session-id-container {
  width: 100%;
  background: linear-gradient(145deg, #1a1a1a, #1e1e1e);
  padding: 2rem 1.5rem;
  border-radius: 14px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  border: 1px solid #2a2a2a;
  position: relative;
  overflow: hidden;
  margin: 2rem auto;
}

.resus-session-id-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #F90618, #2E3192);
}

.resus-session-id-header {
  color: #ffffff;
  text-align: center;
  margin: 0 0 1.5rem 0;
  font-size: 1.4rem;
  font-weight: 700;
  position: relative;
}

.resus-session-id-header::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, #F90618, #2E3192);
  margin: 0.8rem auto 0;
  border-radius: 2px;
}

.resus-session-id-control-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.resus-session-id-subheader {
  color: #e0e0e0;
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  width: 100%;
}

/* Mobile Input Styling */
.resus-session-id-input {
  width: 100%;
  max-width: 300px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
  background: #252525;
  border: 2px solid #333;
  color: #ffffff;
  border-radius: 8px;
  text-transform: uppercase;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  font-weight: 600;
  letter-spacing: 1px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.resus-session-id-input:focus {
  outline: none;
  border-color: #F90618;
  box-shadow: 0 0 0 3px rgba(249, 6, 24, 0.25);
  background: #2a2a2a;
}

/* Mobile Button Group */
.resus-session-id-btn-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
  width: 100%;
  max-width: 300px;
}

/* Mobile Button Styling */
.resus-session-id-set-btn,
.resus-session-id-generate-btn {
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.3px;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* Individual Button Colors */
.resus-session-id-set-btn {
  background: linear-gradient(135deg, #F90618, #d40515);
  color: white;
  box-shadow: 0 4px 15px rgba(249, 6, 24, 0.3);
}

.resus-session-id-generate-btn {
  background: linear-gradient(135deg, #2E3192, #25257a);
  color: white;
  box-shadow: 0 4px 15px rgba(46, 49, 146, 0.3);
}

/* Mobile Active Effects */
.resus-session-id-set-btn:active,
.resus-session-id-generate-btn:active {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(249, 6, 24, 0.4);
}

.resus-session-id-generate-btn:active {
  box-shadow: 0 6px 20px rgba(46, 49, 146, 0.4);
}

/* Mobile Message Styling */
.resus-session-id-message {
  margin: 1.5rem 0 0 0;
  padding: 1rem;
  border-radius: 6px;
  font-weight: 500;
  text-align: center;
  min-height: 20px;
  background: #252525;
  color: #e0e0e0;
  border: 1px solid #333;
  font-size: 0.9rem;
  width: 100%;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Mobile QR Section */
.resus-session-id-qr-section {
  display: none;
  background: linear-gradient(145deg, #1a1a1a, #1e1e1e);
  padding: 2rem 1.5rem;
  border-radius: 14px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  max-width: 100%;
  margin: 2rem auto;
  text-align: center;
  border: 1px solid #2a2a2a;
  position: relative;
  overflow: hidden;
}

.resus-session-id-qr-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #F90618, #2E3192);
}

.resus-session-id-current {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1.5rem;
}

.resus-session-id-current span {
  color: #F90618;
  font-weight: 800;
}

.resus-session-id-qr-image {
  width: 200px;
  height: 200px;
  object-fit: contain;
  margin-bottom: 1.5rem;
  background-color: #fff;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  border: 1px solid #333;
}

.resus-session-id-instructions p {
  font-size: 0.85rem;
  color: #b0b0b0;
  margin-top: 1rem;
  line-height: 1.5;
}

/* Mobile Section Container */
.rm-session-container {
  width: 100%;
  background: linear-gradient(145deg, #1a1a1a, #1e1e1e);
  padding: 2rem 1.5rem;
  border-radius: 14px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
  border: 1px solid #2a2a2a;
  position: relative;
  overflow: hidden;
  margin: 2rem auto;
}

.rm-session-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #F90618, #2E3192);
}

.rm-session-container:active {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.rm-session-title {
  font-size: 1.4rem;
  color: #ffffff;
  margin-bottom: 1.5rem;
  font-weight: 700;
  position: relative;
  display: inline-block;
  text-align: center;
  width: 100%;
}

.rm-session-title::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, #F90618, #2E3192);
  border-radius: 2px;
}

.rm-session-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #e0e0e0;
  text-align: left;
}

/* Tablet Optimization for Dark Theme */
@media (min-width: 481px) and (max-width: 768px) {
  body {
    padding: 0 5vw;
  }
  
  .dev-banner {
    margin: 0 -5vw;
    width: calc(100% + 10vw);
  }
  
  .banner-container {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  
  .banner-icon {
    display: inline-block;
    font-size: 16px;
  }
  
  .banner-text {
    font-size: 15px;
    flex: 1;
    min-width: 200px;
  }
  
  .banner-close {
    position: static;
    margin-left: 10px;
  }
  
  .resus-session-id-input,
  .resus-session-id-btn-group,
  .resus-session-id-message {
    max-width: 350px;
  }
}

/* Very Small Mobile Optimization */
@media (max-width: 480px) {
  body {
    padding: 0 3vw;
  }
  
  .dev-banner {
    margin: 0 -3vw;
    width: calc(100% + 6vw);
    padding: 10px 12px;
  }
  
  .banner-text {
    font-size: 13px;
    padding: 0 5px;
  }
  
  .rm-wrapper {
    margin: 1rem auto;
    gap: 1.5rem;
  }
  
  .rm-containerH,
  .control-vitals-container,
  .resus-session-id-container,
  .rm-session-container {
    padding: 1.25rem;
  }
  
  .rm-card {
    padding: 1.25rem;
  }
  
  .rm-title {
    font-size: 1.3rem;
  }
  
  .control-vitals-title {
    font-size: 1.4rem;
  }
  
  .resus-session-id-header {
    font-size: 1.3rem;
  }
  
  .resus-session-id-input {
    max-width: 280px;
    padding: 0.9rem 1rem;
  }
  
  .resus-session-id-btn-group {
    max-width: 280px;
  }
  
  .resus-session-id-message {
    max-width: 280px;
  }
}

/* Focus states for accessibility */
.control-button:focus,
.resus-session-id-set-btn:focus,
.resus-session-id-generate-btn:focus,
.resus-session-id-input:focus {
  outline: 2px solid #F90618;
  outline-offset: 2px;
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .rm-card:hover,
  .control-button:hover,
  .resus-vitals-image:hover,
  .rm-session-container:hover,
  .resus-session-id-set-btn:hover,
  .resus-session-id-generate-btn:hover,
  .banner-link:hover,
  .banner-close:hover {
    transform: none;
  }
  
  .rm-card:active,
  .control-button:active,
  .resus-vitals-image:active,
  .rm-session-container:active,
  .resus-session-id-set-btn:active,
  .resus-session-id-generate-btn:active,
  .banner-link:active,
  .banner-close:active {
    transform: translateY(-2px) scale(0.98);
  }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .rm-card,
  .control-button,
  .resus-session-id-set-btn,
  .resus-session-id-generate-btn,
  .resus-vitals-image,
  .rm-session-container,
  .resus-session-id-input,
  .dev-banner,
  .banner-icon,
  .banner-background {
    transition: none !important;
    animation: none !important;
  }
  
  .rm-card:active,
  .control-button:active,
  .resus-vitals-image:active,
  .rm-session-container:active,
  .resus-session-id-set-btn:active,
  .resus-session-id-generate-btn:active,
  .banner-link:active,
  .banner-close:active {
    transform: none !important;
  }
}