* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body { 
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
  text-align: center; 
  padding: 20px; 
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: rgba(255,255,255,0.95);
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

h2 {
  color: #2c3e50;
  margin-bottom: 20px;
  font-size: 2rem;
}

/* Main Content Layout */
.main-content {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 25px;
  align-items: start;
}

/* Preview Section */
.preview-section {
  display: flex;
  flex-direction: column;
}

.preview-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  margin: 20px auto;
  border-radius: 10px;
  overflow: hidden;
  border: 3px solid #34495e;
}

.preview-container img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: translate(-50%, -50%) scale(1); 
  opacity: 0;
  transition: opacity 1s ease-in-out, transform 10s ease-in-out;
}

.preview-container img.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1); 
}

.captions {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  background: rgba(0,0,0,0.8);
  color: white;
  font-size: 20px;
  border-radius: 10px;
  max-width: 90%;
  z-index: 10;
  line-height: 1.4;
  backdrop-filter: blur(5px);
}

.highlight { 
  color: #ffeb3b; 
  font-weight: bold; 
  text-shadow: 0 0 10px rgba(255,235,59,0.5);
}

/* Basic Controls */
.basic-controls { 
  margin-top: 25px; 
  padding: 20px;
  background: rgba(52, 152, 219, 0.1);
  border-radius: 10px;
}

.voice-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  align-items: center;
  margin: 15px 0;
}

.color-size-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

select, button, input, textarea { 
  margin: 8px; 
  padding: 12px; 
  border: 2px solid #bdc3c7;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s;
}

textarea {
  width: 100%;
  max-width: 800px;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
}

select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

/* Button Styles */
button {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 600;
  min-width: 120px;
  transition: all 0.3s;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

button:active {
  transform: translateY(0);
}

.btn-play { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.btn-pause { background: linear-gradient(135deg, #f39c12, #e67e22); }
.btn-resume { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.btn-stop { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.btn-control { 
  min-width: auto; 
  padding: 10px 15px;
  font-size: 14px;
}

/* Controls Panel */
.controls-panel {
  background: rgba(241, 242, 246, 0.8);
  border-radius: 10px;
  padding: 20px;
  height: fit-content;
  max-height: 80vh;
  overflow-y: auto;
  border: 2px solid #dfe6e9;
}

.panel-section {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #bdc3c7;
}

.panel-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.panel-section h3 {
  color: #2c3e50;
  margin-bottom: 15px;
  font-size: 1.2rem;
  text-align: left;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 15px;
  text-align: left;
}

.control-group label {
  font-weight: 600;
  color: #34495e;
  font-size: 14px;
}

.control-group input[type="range"] {
  width: 100%;
  margin: 5px 0;
}

.control-group input[type="number"] {
  width: 100%;
  padding: 8px;
}

.effect-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Effect Buttons */
.effect-btn {
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
  color: white;
  border: none;
  padding: 12px 18px;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  font-size: 14px;
  font-weight: 600;
  width: 100%;
}

.effect-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.effect-btn.active {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  box-shadow: 0 0 15px rgba(46, 204, 113, 0.5);
}

.snow-btn {
  background: linear-gradient(135deg, #bdc3c7, #ecf0f1);
  color: #2c3e50;
}

.snow-btn.active {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  box-shadow: 0 0 15px rgba(52, 152, 219, 0.5);
}

/* Status Indicators */
.status {
  margin-top: 15px;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}

.status-indicator {
  padding: 10px;
  margin: 5px 0;
  background: rgba(52, 152, 219, 0.1);
  border-radius: 6px;
  font-size: 13px;
  text-align: left;
  border-left: 4px solid #3498db;
}

.warning {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.1) !important;
  border-left-color: #e74c3c;
}

.success {
  color: #27ae60;
  background: rgba(39, 174, 96, 0.1) !important;
  border-left-color: #27ae60;
}

.status-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Special Effects */
.effect {
  position: absolute;
  pointer-events: none;
  z-index: 5;
}

/* Bubbles Effect */
.bubble {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: bubbleFloat 4s ease-in-out forwards;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
}

/* Hearts Effect */
.heart {
  color: #e74c3c;
  font-size: 24px;
  animation: heartFloat 5s ease-in-out forwards;
  text-shadow: 0 0 10px rgba(231, 76, 60, 0.7);
}

/* Ribbons Effect */
.ribbon {
  width: 4px;
  height: 15px;
  background: currentColor;
  position: absolute;
  animation: ribbonFloat 3s ease-out forwards;
  border-radius: 2px;
}

.ribbon::before, .ribbon::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: inherit;
  border-radius: inherit;
}

.ribbon::before {
  transform: rotate(45deg);
}

.ribbon::after {
  transform: rotate(-45deg);
}

/* Snow Effect */
.snowflake {
  position: absolute;
  background: white;
  border-radius: 50%;
  animation: snowFall 8s linear forwards;
  filter: blur(0.5px);
  opacity: 0.9;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.snowflake.small {
  width: 3px;
  height: 3px;
}

.snowflake.medium {
  width: 5px;
  height: 5px;
}

.snowflake.large {
  width: 7px;
  height: 7px;
}

.snowflake.xlarge {
  width: 10px;
  height: 10px;
}

/* Animations */
@keyframes bubbleFloat {
  0% {
    transform: translateY(0) rotate(0deg) scale(0.5);
    opacity: 0;
  }
  10% {
    opacity: 1;
    transform: translateY(-20px) rotate(0deg) scale(1);
  }
  90% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-100px) rotate(360deg) scale(0.5);
    opacity: 0;
  }
}

@keyframes heartFloat {
  0% {
    transform: translateY(0) rotate(0deg) scale(0.5);
    opacity: 0;
  }
  20% {
    opacity: 1;
    transform: translateY(-30px) rotate(0deg) scale(1.2);
  }
  80% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-120px) rotate(360deg) scale(0.5);
    opacity: 0;
  }
}

@keyframes ribbonFloat {
  0% {
    transform: translateY(0) rotate(0deg) scale(0);
    opacity: 0;
  }
  20% {
    transform: translateY(-10px) rotate(180deg) scale(1);
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translateY(-80px) rotate(720deg) scale(0);
    opacity: 0;
  }
}

@keyframes snowFall {
  0% {
    transform: translateY(-10px) translateX(0px) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(100vh) translateX(20px) rotate(360deg);
    opacity: 0;
  }
}

/* Telegram color palette for ribbons */
.telegram-blue { color: #0088cc; }
.telegram-green { color: #34ba7c; }
.telegram-yellow { color: #ffc107; }
.telegram-orange { color: #ff9800; }
.telegram-red { color: #f44336; }
.telegram-purple { color: #9c27b0; }
.telegram-pink { color: #e91e63; }
.telegram-cyan { color: #00bcd4; }

/* Responsive Design */
@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
  }
  
  .controls-panel {
    max-height: none;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 15px;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .preview-container {
    aspect-ratio: 16/9;
  }
  
  .captions {
    font-size: 16px;
    padding: 8px 16px;
  }
  
  textarea {
    width: 95%;
  }
  
  .effect-btn {
    padding: 10px 15px;
    font-size: 12px;
    margin: 5px;
  }
  
  .voice-controls {
    flex-direction: column;
  }
  
  .playback-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}