/* apps/text-converter.css */

/* Global font definition */
.text-converter-title,
.text-converter-intro,
.text-converter-card {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* Title & intro */
.text-converter-title {  
  font-size: clamp(1.8rem, 3vw, 2.4rem);  
  letter-spacing: -.5px;  
  margin: 0 0 .75rem;  
  font-weight: 600;
}

.text-converter-intro {  
  margin-top: 0;  
  margin-bottom: 1.75rem;  
  font-size: .95rem;  
  color: #6b7280;  
  max-width: 62ch;  
}

body.dark-mode .text-converter-intro {  
  color: #b4b4b4;  
}

/* Card Container */
.text-converter-card {
  position: relative;
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(245,245,247,.9));
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 20px;
  padding: clamp(1rem, 2vw, 2rem);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.1), 0 0 0 1px rgba(0,0,0,0.03) inset;
  overflow: hidden;
  animation: textConverterFadeIn .6s ease forwards;
}

body.dark-mode .text-converter-card {
  background: linear-gradient(135deg, rgba(46,46,46,.9), rgba(28,28,28,.85));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,0.03) inset;
}

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

/* Textarea */
.text-converter-textarea {
  width: 100%;
  min-height: 160px;
  padding: 1.1rem 1.2rem;
  background: #f5f5f7;
  color: #1d1d1f;
  border: 1px solid #d2d2d7;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.6;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  resize: vertical;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  margin-bottom: 1.15rem;
}

.text-converter-textarea:hover {
  border-color: #b8b8bb;
  background: #ffffff;
}

.text-converter-textarea:focus {
  outline: none;
  border-color: #0071e3;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0,113,227,0.12);
}

.text-converter-textarea::placeholder {
  color: #86868b;
  font-weight: 400;
  opacity: 0.8;
}

body.dark-mode .text-converter-textarea {
  background: #1a1a1a;
  color: #f0f0f0;
  border: 1px solid #333333;
}

body.dark-mode .text-converter-textarea:hover {
  border-color: #444444;
  background: #1d1d1d;
}

body.dark-mode .text-converter-textarea:focus {
  border-color: #01e6cd;
  background: #1f1f1f;
  box-shadow: 0 0 0 3px rgba(1,230,205,0.12);
}

body.dark-mode .text-converter-textarea::placeholder {
  color: #777777;
}

/* Buttons Grid */
.text-converter-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* Base Button Style */
.text-converter-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  background: transparent;
  color: #6b7280;
  border: 1px solid #d2d2d7;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.text-converter-btn:hover {
  background: #f5f5f7;
  border-color: #0071e3;
  color: #0071e3;
}

body.dark-mode .text-converter-btn {
  color: #999;
  border: 1px solid #3d3d3d;
}

body.dark-mode .text-converter-btn:hover {
  background: rgba(1, 230, 205, 0.1);
  border-color: #01e6cd;
  color: #01e6cd;
}

.text-converter-btn .material-icons {
  font-size: 0.9rem;
  opacity: 0.7;
}

.text-converter-btn:hover .material-icons {
  opacity: 1;
}

.text-converter-btn:active {
  transform: scale(0.98);
}

/* Primary action buttons (Copy & Clear) */
.text-converter-btn.copy {
  background: #0071e3;
  color: #ffffff;
  border: 1px solid #0071e3;
  font-weight: 600;
}

.text-converter-btn.copy:hover {
  background: #0077ed;
}

.text-converter-btn.clear {
  background: #f5f5f7;
  color: var(--text-color);
  border: 1px solid #d2d2d7;
}

.text-converter-btn.clear:hover {
  background: #e5e5ea;
}

body.dark-mode .text-converter-btn.copy {
  background: #02d7bf;
  color: #0b2824;
  border: 1px solid #06665b;
}

body.dark-mode .text-converter-btn.copy:hover {
  background: #04e4ca;
}

body.dark-mode .text-converter-btn.clear {
  background: #2a2a2a;
  border: 1px solid #3d3d3d;
}

body.dark-mode .text-converter-btn.clear:hover {
  background: #333333;
}

/* Action buttons container */
.text-converter-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.text-converter-actions .text-converter-btn {
  flex: 1;
  max-width: 200px;
}

/* Character count */
.text-converter-info {
  text-align: right;
  color: #86868b;
  font-size: 0.8rem;
  margin-top: 0.5rem;
  padding: 0 0.5rem;
  letter-spacing: 0.3px;
}

body.dark-mode .text-converter-info {
  color: #6f6f6f;
}

/* Responsive */
@media (max-width: 600px) {
  .text-converter-card {
    padding: 1.5rem;
  }

  .text-converter-buttons {
    grid-template-columns: 1fr;
  }

  .text-converter-actions {
    flex-direction: column;
  }

  .text-converter-actions .text-converter-btn {
    max-width: 100%;
  }
}
