/* Custom Encoder Decoder Styles */
:root {
  --ced-theme-color: #4f46e5;
  --ced-theme-color-dark: #3730a3;
  --ced-theme-color-light: #a5b4fc;
  --ced-border-radius: 8px;
  --ced-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --ced-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Container */
.ced-container {
  max-width: 800px;
  margin: 1rem auto;
  padding: 0 1rem;
}

/* Card */
.ced-card {
  background: #ffffff;
  border-radius: var(--ced-border-radius);
  box-shadow: var(--ced-shadow);
  overflow: hidden;
  margin-bottom: 1rem;
}

.ced-card-header {
  background: linear-gradient(135deg, var(--ced-theme-color) 0%, var(--ced-theme-color-dark) 100%);
  color: white;
  padding: 10px;
  text-align: center;
}

.ced-card-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.ced-card-body {
  padding: 10px;
}

/* Icons */
.ced-icon {
  font-size: 1.1em;
}

/* Form Elements */
.ced-form-group {
  margin-bottom: 1rem;
}

.ced-form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #374151;
}

.ced-textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: var(--ced-border-radius);
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.ced-textarea:focus {
  outline: none;
  border-color: var(--ced-theme-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.ced-textarea.error {
  border-color: #ef4444;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* Buttons */
.ced-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: var(--ced-border-radius);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.ced-button-primary {
  background: var(--ced-theme-color);
  color: white;
}

.ced-button-primary:hover {
  background: var(--ced-theme-color-dark);
  transform: translateY(-1px);
  box-shadow: var(--ced-shadow-lg);
}

.ced-button-secondary {
  background: #6b7280;
  color: white;
}

.ced-button-secondary:hover {
  background: #4b5563;
  transform: translateY(-1px);
  box-shadow: var(--ced-shadow-lg);
}

.ced-button-copy {
  background: #059669;
  color: white;
  margin-top: 0.5rem;
}

.ced-button-copy:hover {
  background: #047857;
}

.ced-button-copy.copied {
  background: #10b981;
}

.ced-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.ced-button-icon {
  font-size: 1em;
}

/* Loading State */
.ced-loading {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.ced-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Result Container */
.ced-result-container {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid #f3f4f6;
}

.ced-result-container h3 {
  margin: 0 0 0.75rem 0;
  color: #059669;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
}

.ced-result-box {
  position: relative;
}

.ced-result {
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  min-height: 80px;
}

.ced-content-info {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #6b7280;
}

/* Timer Styles - Made Smaller */
.ced-timer {
  text-align: center;
  padding: 1rem 0;
}

.ced-timer-circle {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 1rem;
}

.ced-timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ced-timer-track {
  fill: none;
  stroke: #e5e7eb;
  stroke-width: 3;
}

.ced-timer-progress {
  fill: none;
  stroke: var(--ced-theme-color);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.ced-timer-count {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--ced-theme-color);
}

.ced-timer-message {
  color: #6b7280;
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 450px;
  margin: 0 auto;
}

/* Error Display */
.ced-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 0.75rem;
  border-radius: var(--ced-border-radius);
  margin-top: 0.75rem;
}

.ced-error-display {
  text-align: center;
  padding: 1rem;
}

.ced-error-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.ced-error-display h3 {
  color: #dc2626;
  margin: 0 0 0.75rem 0;
  font-size: 1.1rem;
}

.ced-error-display p {
  color: #6b7280;
  margin-bottom: 0.75rem;
  line-height: 1.5;
  font-size: 0.9rem;
}

/* Success Messages */
.ced-scroll-message {
  text-align: center;
  padding: 1rem;
}

.ced-success-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.ced-scroll-message h3 {
  color: #059669;
  margin: 0 0 0.75rem 0;
  font-size: 1.1rem;
}

.ced-scroll-indicator {
  margin: 1rem 0;
  padding: 0.75rem;
  background: #f0f9ff;
  border-radius: var(--ced-border-radius);
}

.ced-scroll-arrow {
  font-size: 1.25rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(-4px);
  }
}

.ced-scroll-btn {
  margin-top: 0.75rem;
}

/* Content Display */
.ced-content-display-container {
  margin-top: 1.5rem;
}

.ced-content-header {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.ced-content-intro {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f0fdf4;
  border-radius: var(--ced-border-radius);
  color: #166534;
  font-size: 0.9rem;
}

.ced-highlight {
  animation: highlight 2s ease-out;
}

@keyframes highlight {
  0% {
    background-color: #fef3c7;
  }
  100% {
    background-color: transparent;
  }
}

/* Admin Styles */
.ced-admin-wrap {
  background: #f9fafb;
  min-height: 100vh;
  padding: 2rem 0;
}

.ced-admin-container {
  max-width: 1000px;
  margin: 0 auto;
  background: white;
  border-radius: var(--ced-border-radius);
  box-shadow: var(--ced-shadow);
  overflow: hidden;
}

.ced-admin-section {
  padding: 2rem;
  border-bottom: 1px solid #e5e7eb;
}

.ced-admin-section:last-child {
  border-bottom: none;
}

.ced-admin-section h2 {
  margin: 0 0 1.5rem 0;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ced-form-row {
  margin-bottom: 1.5rem;
}

.ced-form-row label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #374151;
}

.ced-form-row input[type="text"],
.ced-form-row input[type="number"] {
  width: 100%;
  max-width: 400px;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: var(--ced-border-radius);
  font-size: 0.95rem;
}

.ced-form-row input[type="color"] {
  width: 60px;
  height: 40px;
  border: 1px solid #d1d5db;
  border-radius: var(--ced-border-radius);
  cursor: pointer;
}

.ced-color-preview {
  display: inline-block;
  width: 40px;
  height: 40px;
  border-radius: var(--ced-border-radius);
  margin-left: 1rem;
  border: 1px solid #d1d5db;
}

.ced-url-preview {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: #f3f4f6;
  border-radius: var(--ced-border-radius);
  font-family: monospace;
  font-size: 0.9rem;
}

.ced-shortcode-info {
  background: #f8fafc;
  padding: 1.5rem;
  border-radius: var(--ced-border-radius);
}

.ced-shortcode-info ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.ced-shortcode-info li {
  margin-bottom: 0.5rem;
}

.ced-shortcode-info code {
  background: #e5e7eb;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .ced-container {
    margin: 0.5rem auto;
    padding: 0 0.5rem;
  }

  .ced-card-body {
    padding: 10px;
  }

  .ced-card-header {
    padding: 10px;
  }

  .ced-card-header h2 {
    font-size: 1.1rem;
  }

  .ced-timer-circle {
    width: 80px;
    height: 80px;
  }

  .ced-timer-count {
    font-size: 1.5rem;
  }

  .ced-timer-message {
    font-size: 0.9rem;
  }

  .ced-button {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .ced-admin-section {
    padding: 1.5rem;
  }

  .ced-form-row input[type="text"],
  .ced-form-row input[type="number"] {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .ced-container {
    margin: 0.25rem auto;
  }

  .ced-card-body {
    padding: 8px;
  }

  .ced-timer-circle {
    width: 70px;
    height: 70px;
  }

  .ced-timer-count {
    font-size: 1.3rem;
  }

  .ced-timer-message {
    font-size: 0.85rem;
  }

  .ced-button {
    width: 100%;
    justify-content: center;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    font-size: 0.8rem;
  }
}

/* Print Styles */
@media print {
  .ced-button,
  .ced-timer,
  .ced-scroll-message {
    display: none !important;
  }

  .ced-card {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .ced-result {
    background: white !important;
    border: 1px solid #ccc !important;
  }
}
