/* ASCII2Unicode Enhanced Converter Styles */
/* Intel Corporate Design Enhancement */
/* Version 2.0.0.0 Build 00001 */

/* ========================================
   Converter-Specific Enhancements
======================================== */

/* Enhanced Input/Output Styling */
.text-input,
.text-output {
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 1rem;
  line-height: 1.8;
  letter-spacing: 0.025em;
  background: #475569 !important;
  color: #ffffff !important;
  border: 2px solid #64748b;
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  transition: none;
  position: relative;
  overflow-y: auto;
  resize: vertical;
  min-height: 400px;
  max-height: 700px;
}

.text-input:focus,
.text-input:hover,
.text-input:active {
  background: #475569 !important;
  color: #ffffff !important;
  border-color: #64748b;
  box-shadow: none;
  outline: none;
}

.text-output {
  background: #475569 !important;
  color: #ffffff !important;
  border-color: #64748b;
}

.text-output:focus,
.text-output:hover,
.text-output:active,
.text-output[readonly] {
  background: #475569 !important;
  color: #ffffff !important;
  border-color: #64748b;
  box-shadow: none;
  outline: none;
}

/* Ensure output background stays consistent after conversion */
#output-box {
  background: #475569 !important;
  color: #ffffff !important;
}

#output-box:focus,
#output-box:hover,
#output-box:active,
#output-box[readonly] {
  background: #475569 !important;
  color: #ffffff !important;
  border-color: #64748b;
  box-shadow: none;
  outline: none;
}

/* Kannada Text Styling */
.text-input,
.text-output {
  /* Enhanced Kannada font support */
  font-family: 'Noto Sans Kannada', 'Tunga', 'Kedage', 'JetBrains Mono', monospace;
}

/* Character Counter Enhancement */
.character-count {
  position: absolute;
  bottom: 8px;
  right: 12px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--intel-silver-200);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--intel-silver-600);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.character-count:hover {
  background: rgba(255, 255, 255, 1);
  border-color: var(--intel-blue-300);
  color: var(--intel-blue-700);
}

/* Enhanced Convert Button */
.convert-btn {
  background: linear-gradient(135deg, var(--intel-blue-600) 0%, var(--intel-blue-700) 50%, var(--intel-blue-800) 100%);
  border: none;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: 
    0 8px 25px rgba(59, 130, 246, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.convert-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s ease;
}

.convert-btn:hover {
  transform: scale(1.08) rotate(5deg);
  box-shadow: 
    0 12px 35px rgba(59, 130, 246, 0.4),
    0 6px 16px rgba(0, 0, 0, 0.15);
}

.convert-btn:hover::before {
  left: 100%;
}

.convert-btn:active {
  transform: scale(0.95);
}

.convert-btn.processing {
  animation: pulse 1.5s infinite;
  pointer-events: none;
}

.convert-btn.processing i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Success/Error States */
.convert-btn.success {
  background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
  animation: successPulse 0.6s ease-out;
}

.convert-btn.error {
  background: linear-gradient(135deg, var(--error-color) 0%, #dc2626 100%);
  animation: errorShake 0.6s ease-out;
}

@keyframes successPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Enhanced Action Buttons */
.btn {
  position: relative;
  overflow: hidden;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all var(--transition-normal);
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::after {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--intel-blue-600), var(--intel-blue-700));
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--intel-blue-700), var(--intel-blue-800));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--intel-silver-600), var(--intel-silver-700));
  box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, var(--intel-silver-700), var(--intel-silver-800));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(100, 116, 139, 0.4);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--intel-blue-600);
  color: var(--intel-blue-600);
  position: relative;
  z-index: 1;
}

.btn-outline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: var(--intel-blue-600);
  transition: width var(--transition-normal);
  z-index: -1;
}

.btn-outline:hover::before {
  width: 100%;
}

.btn-outline:hover {
  color: white;
  border-color: var(--intel-blue-600);
  transform: translateY(-2px);
}

/* Enhanced Checkbox Styling */
.modern-checkbox {
  appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--intel-silver-300);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modern-checkbox:hover {
  border-color: var(--intel-blue-400);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modern-checkbox:checked {
  background: linear-gradient(135deg, var(--intel-blue-600), var(--intel-blue-700));
  border-color: var(--intel-blue-600);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.modern-checkbox:checked::after {
  content: '✓';
  color: white;
  font-size: 14px;
  font-weight: bold;
  position: absolute;
  animation: checkmark 0.3s ease-in-out;
}

@keyframes checkmark {
  0% { transform: scale(0) rotate(45deg); }
  50% { transform: scale(1.2) rotate(45deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Enhanced Panel Styling */
.converter-panel {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--intel-silver-200);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all var(--transition-normal);
  position: relative;
}

.converter-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--intel-blue-600), var(--intel-blue-400), var(--accent-color));
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.converter-panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  border-color: var(--intel-blue-300);
}

.converter-panel:hover::before {
  opacity: 1;
}

.panel-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--intel-silver-200);
  position: relative;
}

.panel-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--intel-silver-800);
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.panel-title i {
  color: var(--intel-blue-600);
  font-size: 1rem;
}

.panel-subtitle {
  font-size: 0.875rem;
  color: var(--intel-silver-600);
  margin: 0;
  font-weight: 400;
}

/* Loading Animation */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--intel-silver-200);
  border-top: 4px solid var(--intel-blue-600);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Toast Notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  border-left: 4px solid var(--success-color);
  padding: var(--spacing-md) var(--spacing-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
}

.toast.show {
  transform: translateX(0);
}

.toast.error {
  border-left-color: var(--error-color);
}

.toast.warning {
  border-left-color: var(--warning-color);
}

.toast i {
  font-size: 1.25rem;
}

.toast.success i {
  color: var(--success-color);
}

.toast.error i {
  color: var(--error-color);
}

.toast.warning i {
  color: var(--warning-color);
}

/* Responsive Enhancements */
@media (max-width: 1024px) {
  .converter-container {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  
  .conversion-arrow {
    order: 2;
    justify-self: center;
  }
  
  .convert-btn {
    width: 60px;
    height: 60px;
  }
  
  .convert-text {
    display: none;
  }
  
  .text-input,
  .text-output {
    min-height: 350px;
  }
}

@media (max-width: 768px) {
  .converter-section {
    padding: var(--spacing-md);
    margin: 0 -var(--spacing-sm);
    border-radius: var(--radius-md);
  }
  
  .text-input,
  .text-output {
    min-height: 300px;
    font-size: 0.9rem;
    padding: var(--spacing-md);
    background: #475569 !important;
    color: #ffffff !important;
  }
  
  .text-input:focus,
  .text-input:hover,
  .text-input:active {
    background: #475569 !important;
    color: #ffffff !important;
    box-shadow: none;
    outline: none;
  }
  
  .text-output:focus,
  .text-output:hover,
  .text-output:active,
  #output-box:focus,
  #output-box:hover,
  #output-box:active {
    background: #475569 !important;
    color: #ffffff !important;
    box-shadow: none;
    outline: none;
  }
  
  .action-controls {
    flex-direction: column;
    gap: var(--spacing-md);
  }
  
  .action-buttons {
    width: 100%;
    justify-content: center;
  }
  
  .btn {
    flex: 1;
    min-width: 0;
  }
}

/* Print Styles */
@media print {
  .conversion-arrow,
  .action-controls,
  .character-count {
    display: none;
  }
  
  .converter-panel {
    box-shadow: none;
    border: 1px solid #000;
  }
  
  .text-input,
  .text-output {
    border: 1px solid #000;
    background: white;
    min-height: auto;
    height: auto;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .converter-panel {
    border: 2px solid #000;
  }
  
  .text-input,
  .text-output {
    border: 2px solid #000;
    background: white;
  }
  
  .convert-btn {
    background: #000;
    color: white;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .convert-btn,
  .converter-panel,
  .btn {
    transition: none;
    animation: none;
  }
  
  .convert-btn:hover {
    transform: none;
  }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
  .converter-panel {
    background: var(--intel-silver-800);
    border-color: var(--intel-silver-600);
  }
  
  .panel-header {
    background: var(--intel-silver-700);
    border-bottom-color: var(--intel-silver-600);
  }
  
  .text-input,
  .text-output {
    background: var(--intel-silver-700);
    border-color: var(--intel-silver-600);
    color: var(--intel-silver-100);
  }
  
  .panel-title {
    color: var(--intel-silver-100);
  }
  
  .panel-subtitle {
    color: var(--intel-silver-300);
  }
}
