/* ================================
   Atomic Structure & Periodic Trends
   Improved Moderate CSS Design
================================ */

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body Styling */
body {
  background: linear-gradient(135deg, #0f172a, #111827, #1e293b);
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  text-align: center;
  min-height: 100vh;
  overflow-x: hidden;
  padding: 20px;
}

/* Main Container */
.container {
  max-width: 1000px;
  margin: auto;
  padding: 25px;
}

/* Header */
.page-header {
  margin-bottom: 30px;
}

h1 {
  font-size: 2.8rem;
  margin-bottom: 10px;
  color: #ffffff;
  text-shadow: 0 0 12px rgba(0, 255, 255, 0.8);
}

.subtitle {
  font-size: 1rem;
  color: #cbd5e1;
  max-width: 700px;
  margin: auto;
  line-height: 1.6;
}

/* Canvas Section */
.canvas-container {
  margin: 25px auto;
  background: linear-gradient(145deg, #001f3f, #003566);
  border-radius: 18px;
  padding: 15px;
  box-shadow:
    0 0 20px rgba(0, 255, 255, 0.25),
    0 0 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  transition: transform 0.3s ease;
}

.canvas-container:hover {
  transform: translateY(-3px);
}

/* Canvas */
canvas {
  width: 100%;
  max-width: 650px;
  height: 400px;
  display: block;
  margin: auto;
  border-radius: 12px;
  background: #000814;
}

/* Control Buttons */
.control-buttons {
  margin-top: 20px;
}

/* Shared Button Style */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: linear-gradient(135deg, #007bff, #0056b3);
  color: #ffffff;

  padding: 12px 18px;
  border: none;
  border-radius: 12px;

  margin: 8px;
  cursor: pointer;

  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;

  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Hover Effect */
.button:hover {
  transform: translateY(-2px) scale(1.03);
  background: linear-gradient(135deg, #0096ff, #0047ab);
  box-shadow: 0 0 15px rgba(0, 153, 255, 0.6);
}

/* Active Click */
.button:active {
  transform: scale(0.97);
}

/* Button Grid */
.button-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 25px;
}

/* Special Buttons */
.primary-btn {
  background: linear-gradient(135deg, #00c853, #009624);
}

.primary-btn:hover {
  background: linear-gradient(135deg, #00e676, #00b248);
}

.secondary-btn {
  background: linear-gradient(135deg, #ff9800, #ef6c00);
}

.secondary-btn:hover {
  background: linear-gradient(135deg, #ffb300, #ff6f00);
}

.home-btn {
  background: linear-gradient(135deg, #8e24aa, #5e35b1);
}

.home-btn:hover {
  background: linear-gradient(135deg, #ab47bc, #7e57c2);
}

/* Back Button */
.back-button {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;

  background: linear-gradient(135deg, #ff4444, #cc0000);
  z-index: 1000;
}

.back-button:hover {
  background: linear-gradient(135deg, #ff6666, #ff0000);
}

/* Section Styling */
.resource-section {
  margin-top: 40px;
}

.resource-section h2 {
  margin-bottom: 20px;
  font-size: 2rem;
  color: #38bdf8;
}

/* Feedback Popup */
.feedback-popup {
  position: fixed;
  top: 50%;
  left: 50%;

  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 500px;

  background: rgba(15, 23, 42, 0.98);
  padding: 25px;

  border-radius: 20px;
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.3);

  z-index: 2000;
}

/* Hide Popup */
.hidden {
  display: none;
}

/* Feedback Card */
.feedback-card h2 {
  margin-bottom: 12px;
  color: #38bdf8;
}

.feedback-card p {
  color: #cbd5e1;
  margin-bottom: 15px;
  line-height: 1.5;
}

/* Textarea */
textarea {
  width: 100%;
  padding: 12px;

  border-radius: 12px;
  border: 1px solid #334155;

  background: #0f172a;
  color: white;

  font-size: 1rem;
  resize: vertical;

  outline: none;
  margin-top: 10px;
}

/* Focus Effect */
textarea:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

/* Feedback Buttons */
.feedback-buttons {
  margin-top: 18px;
}

/* iFrame Styling */
iframe {
  width: 100%;
  height: 400px;

  border: none;
  border-radius: 15px;

  margin-top: 20px;
  background: #0f172a;
}

/* Responsive Design */
@media (max-width: 768px) {

  h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  canvas {
    height: 300px;
  }

  .button {
    width: 100%;
    max-width: 300px;
  }

  .button-grid {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {

  body {
    padding: 10px;
  }

  h1 {
    font-size: 1.7rem;
  }

  canvas {
    height: 250px;
  }

  .feedback-popup {
    padding: 18px;
  }
}