@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

/* Locker Modal for Mobile Screens */
/* General small-screen responsiveness */
@media (max-width: 768px), (max-height: 700px) {
  .locker-modal {
    padding: 5px;
  }

  .modal-content {
    width: 95%;
    max-height: 90vh; /* Strict viewport-height limit */
    height: auto;
    padding: 5px;
    overflow-y: auto; /* Allow scrolling inside modal */
    position: relative;
  }

  iframe {
    width: 100%;
    height: calc(100vh - 160px); /* Ensures iframe never overflows viewport */
  }

  .close-modal-btn {
    top: 6px;
    right: 6px;
    font-size: 0.8rem;
    padding: 4px 6px;
  }

  .modal-content p {
    font-size: 0.85rem;
    margin: 5px 0;
  }
}

/* Specific adjustment for very small heights (like your example) */
@media (max-height: 640px) {
  iframe {
    height: calc(100vh - 190px); /* More space reduction for tiny viewports */
  }

  .modal-content {
    padding: 4px;
  }

  .close-modal-btn {
    top: 4px;
    right: 4px;
    font-size: 0.75rem;
  }
}




.device-modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.device-modal .modal-content {
  background: #2c3e50;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
}

.device-modal button {
  margin: 10px;
  padding: 10px 20px;
  background: #f39c12;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}


button {
  background-color: #3b4a60; /* Muted blue-gray */
  color: #fff; /* White text */
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #50647a; /* Slightly lighter blue-gray */
}

button:active {
  background-color: #2f3d4e; /* Slightly darker blue-gray */
}

button:focus {
  outline: none;
  box-shadow: 0 0 0 2px #50647a; /* Subtle focus indicator */
}





/* Enhanced Loading Popup Styles */
.loading-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8); /* Darker background for better focus */
  justify-content: center;
  align-items: center;
  color: white;
  z-index: 9999;
  animation: fadeIn 0.3s ease-in-out; /* Smooth fade-in animation */
}

.popup-content {
  text-align: center;
  background: linear-gradient(145deg, #333, #222); /* Subtle gradient */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); /* Elevated shadow */
  padding: 30px 20px;
  border-radius: 15px;
  width: 320px;
  transform: scale(0.9); /* Slight shrink for entrance animation */
  animation: popIn 0.3s ease-in-out forwards; /* Smooth scale-in animation */
}

.gear-icon img {
  width: 60px; /* Slightly larger for better emphasis */
  height: 60px;
  margin-bottom: 15px;
}

.popup-content p {
  font-size: 1rem;
  margin-top: 10px;
  color: #f0f0f0;
}

.progress-bar {
  width: 100%;
  height: 12px; /* Slimmer progress bar */
  background: #555; /* Softer background color */
  margin-top: 20px;
  border-radius: 50px; /* Circular ends */
  overflow: hidden; /* Ensures no overflow beyond border radius */
  border: 1px solid #777;
}

.progress {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #4caf50, #8bc34a); /* Gradient effect */
  transition: width 0.4s ease-in-out; /* Smooth width transition */
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes popIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}



/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background-color: #1d1f28;
  color: white;
}

/* Header Styling */
header {
  text-align: center;
  padding: 20px;
  background-color: #2e3b4e;
}

header .logo {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

header img {
  width: 80px; /* Smaller logo for mobile */
}

header h1 {
  margin-top: 10px;
  font-size: 1.8rem;
  color: #00f7ff;
}

header p {
  font-size: 1rem;
  color: #7f8c8d;
  margin-top: 5px;
}



/* App Cards Grid */
#apps-container {
  display: grid;
  grid-template-columns: 1fr; /* Single column for mobile */
  gap: 15px;
}

#apps-container .app-card {
  background-color: #2c3e50;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}

#apps-container img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
}

.app-card h3 {
  font-size: 1.2rem;
  color: #f39c12;
  margin: 10px 0 5px;
}

.app-card p {
  font-size: 0.9rem;
  color: #bdc3c7;
}

.app-card .rating {
  font-size: 1rem;
  color: #f39c12;
}

#all-apps .search-bar {
  text-align: center;
  margin: 20px 0;
}

#all-apps input[type="text"] {
  padding: 10px;
  width: 100%;
  font-size: 1rem;
  border-radius: 5px;
  border: none;
}

/* Loading Popup Styles */
.loading-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  color: white;
  z-index: 9999;
}

.popup-content {
  text-align: center;
  background-color: #222;
  padding: 20px;
  border-radius: 10px;
  width: 300px;
}

.gear-icon img {
  width: 50px;
  height: 50px;
}

.progress-bar {
  width: 100%;
  height: 20px;
  background-color: #444;
  margin-top: 20px;
  border-radius: 10px;
}

.progress {
  height: 100%;
  width: 0;
  background-color: #4caf50;
  border-radius: 10px;
}

/* Media Queries for Larger Screens */

/* Tablet (min-width: 768px) */
@media (min-width: 768px) {
  header img {
    width: 100px; /* Larger logo for tablets */
  }

  header h1 {
    font-size: 2rem;
  }

  #featured-apps h2, #all-apps h2 {
    font-size: 1.8rem;
  }

  .carousel-container img {
    width: 120px;
    height: 120px;
  }

  #apps-container {
    grid-template-columns: repeat(2, 1fr); /* Two columns for tablets */
    gap: 20px;
  }
}

/* Desktop (min-width: 1024px) */
@media (min-width: 1024px) {
  header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
  }

  header .logo {
    flex-direction: row;
  }

  header img {
    width: 120px; /* Larger logo for desktop */
  }

  header h1 {
    margin-top: 0;
    margin-left: 15px;
    font-size: 2.5rem;
  }

  #featured-apps h2, #all-apps h2 {
    font-size: 2rem;
  }

  #apps-container {
    grid-template-columns: repeat(3, 1fr); /* Three columns for desktop */
    gap: 30px;
  }
}

/* Locker Modal Styling */
.locker-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7); /* Darker background for focus */
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: fadeInModal 0.3s ease-in-out; /* Modal fade-in */
}

/* Modal Content Styling */
.modal-content {
  background: #222;
  color: #fff;
  border-radius: 15px;
  padding: 25px;
  width: 90%;
  max-width: 800px;
  height: 80%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
  transform: scale(0.95); /* Slight scaling for entrance */
  animation: popInModal 0.4s ease-in-out forwards; /* Pop-in effect */
}

/* Iframe Styling */
iframe {
  width: 100%;
  height: 90%;
  border: none;
  border-radius: 10px; /* Rounded corners */
}

/* Message Styling */
.modal-content p {
  text-align: center;
  font-size: 1.1rem;
  margin-top: 10px;
  color: #f39c12; /* Golden color for emphasis */
  font-weight: 500;
}

/* Close Button (optional, but could be useful for functionality) */
.close-modal-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  background: #f39c12;
  border: none;
  color: white;
  font-size: 1.2rem;
  padding: 5px 10px;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.close-modal-btn:hover {
  background-color: #e67e22; /* Darker shade on hover */
}

/* Fade-In and Pop-In Animations */
@keyframes fadeInModal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes popInModal {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}


#apps-container .app-card a {
  text-decoration: none; /* Removes the underline */
  color: inherit; /* Ensures the text color is consistent */
}

#apps-container .app-card a:hover {
  text-decoration: none; /* Keeps it consistent on hover */
}
.carousel-container .app-card a {
  text-decoration: none; /* Removes underline from links */
  color: inherit; /* Ensures the text color matches parent styles */
}

.carousel-container .app-card a:hover {
  text-decoration: none; /* Ensures no underline on hover */
}

/* Force Responsive Modal Styling (override) */
@media (max-width: 768px), (max-height: 700px) {
  .locker-modal {
    padding: 5px !important;
  }

  .locker-modal .modal-content {
    width: 95% !important;
    max-width: 100% !important;
    max-height: 90vh !important;
    height: auto !important;
    padding: 5px !important;
    overflow-y: auto !important;
    position: relative !important;
  }

  .locker-modal iframe {
    width: 100% !important;
    height: calc(100vh - 180px) !important;
  }

  .locker-modal .close-modal-btn {
    top: 5px !important;
    right: 5px !important;
    font-size: 0.8rem !important;
    padding: 4px 6px !important;
  }

  .locker-modal .modal-content p {
    font-size: 0.85rem !important;
    margin: 5px 0 !important;
  }
}

/* Extremely small screens (Samsung A15 fix) */
@media (max-height: 650px) {
  .locker-modal iframe {
    height: calc(100vh - 200px) !important;
  }

  .locker-modal .modal-content {
    padding: 3px !important;
  }

  .locker-modal .close-modal-btn {
    top: 3px !important;
    right: 3px !important;
    font-size: 0.75rem !important;
  }
}
