* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #1e1e1e;
  color: #fff;
  height: 100vh;
  display: flex;
  overflow: hidden;
  transition: background 0.3s ease-in-out;
}

.app {
  display: flex;
  width: 100%;
  height: 100%;
  animation: fadeIn 0.6s ease;
}

.sidebar {
  background-color: #252526;
  width: 220px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-right: 1px solid #333;
  transition: background 0.3s ease;
  border-radius: 0 12px 12px 0; /* Rounded right corners */
  animation: slideInLeft 0.5s ease;
}

.sidebar h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #61dafb;
  transition: color 0.3s;
}

.nav-btn {
  background: #333;
  border: none;
  padding: 0.75rem;
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  border-radius: 8px;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.7);
  width: 100vw;
  height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal {
  background: #2d2d2d;
  padding: 2rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 300px;
}

.modal input,
.modal select {
  padding: 0.5rem;
  border-radius: 6px;
  border: none;
  background: #1e1e1e;
  color: #fff;
}

.modal button {
  padding: 0.5rem;
  border: none;
  background: #61dafb;
  color: #000;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.modal button:hover {
  background: #4ec3e0;
}

.nav-btn:hover {
  background: #3a3a3a;
  transform: scale(1.03);
}

.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: 12px 0 0 0;
  overflow: hidden;
  animation: fadeIn 0.6s ease 0.2s both;
}

.toolbar {
  background-color: #2d2d2d;
  padding: 0.5rem;
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid #444;
  transition: background 0.3s;
  animation: slideDown 0.5s ease;
}

.tool-btn {
  background: #444;
  border: none;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: background 0.3s, transform 0.2s;
}

.tool-btn:hover {
  background: #555;
  transform: translateY(-2px);
}

.canvas {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #1a1a1a;
  transition: background 0.3s;
}

.edit-controls {
  background: #2b2b2b;
  padding: 0.5rem;
  display: flex;
  gap: 0.8rem;
  align-items: center;
  border-top: 1px solid #444;
  border-bottom: 1px solid #444;
  animation: slideDown 0.5s ease;
}

.edit-controls button {
  background: #444;
  border: none;
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

.edit-controls button:hover {
  background: #555;
  transform: translateY(-2px);
}

.edit-controls input[type="range"] {
  width: 100px;
}

#preview-area {
  aspect-ratio: 16 / 9;
  width: 100%;
  max-width: 960px; /* Half of 1920px to scale for visibility */
  background: #000;
  border: 2px solid #444;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  border-radius: 12px;
  transition: all 0.3s ease-in-out;
  animation: zoomIn 0.4s ease;
  position: relative;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.timeline {
  background-color: #2b2b2b;
  padding: 0.5rem;
  border-top: 1px solid #444;
  transition: background 0.3s;
  animation: slideUp 0.5s ease;
}

.timeline-bar {
  height: 60px;
  background: #1e1e1e;
  border: 1px solid #444;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.3s ease;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideInLeft {
  from { transform: translateX(-100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes zoomIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .sidebar {
    width: 100px;
    border-radius: 0;
  }

  .sidebar h1 {
    font-size: 1rem;
  }

  .nav-btn {
    font-size: 0.8rem;
    padding: 0.5rem;
  }

  .tool-btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
  }

  #preview-area {
    width: 95%;
    height: 50%;
  }
}
