/* Dev Sayılar Modal System - 2025 */

/* Modal Container */
.dev-sayilar-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.dev-sayilar-modal.active {
  opacity: 1;
  visibility: visible;
}

/* Modal Content */
.modal-content {
  width: 95vw;
  height: 90vh;
  max-width: 1200px;
  background: white;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease-out;
}

.dark .modal-content {
  background: #1f2937;
  color: white;
}

@keyframes modalSlideIn {
  from {
    transform: scale(0.9) translateY(50px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Header */
.modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
}

.dark .modal-header {
  background: #111827;
  border-bottom-color: #374151;
}

.header-left {
  flex: 1;
}

.operation-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
}

.dark .operation-title {
  color: #f9fafb;
}

.operation-description {
  font-size: 1rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.dark .operation-description {
  color: #9ca3af;
}

.operation-formula {
  font-family: 'JetBrains Mono', 'Monaco', monospace;
  font-size: 0.875rem;
  color: #4f46e5;
  background: rgba(79, 70, 229, 0.1);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border-left: 3px solid #4f46e5;
}

.dark .operation-formula {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
  border-left-color: #6366f1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.digit-count-badge {
  background: #10b981;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

.close-modal-btn {
  background: #ef4444;
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.close-modal-btn:hover {
  background: #dc2626;
  transform: scale(1.05);
}

/* Controls */
.modal-controls {
  padding: 1rem 2rem;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.dark .modal-controls {
  background: #1f2937;
  border-bottom-color: #374151;
}

.control-button {
  padding: 0.75rem 1.25rem;
  background: #6366f1;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.control-button:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}

.control-button.secondary {
  background: #6b7280;
}

.control-button.secondary:hover {
  background: #4b5563;
}

.control-button.success {
  background: #10b981;
}

.control-button.success:hover {
  background: #059669;
}

/* Number Display Container */
.number-display-container {
  flex: 1;
  overflow-y: auto;
  background: white;
}

.dark .number-display-container {
  background: #1f2937;
}

/* Number Sections */
.number-section {
  padding: 2rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark .number-section {
  border-bottom-color: #374151;
}

.number-section:last-child {
  border-bottom: none;
}

.section-header {
  display: flex;
  justify-content: between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dark .section-title {
  color: #f9fafb;
}

.section-badge {
  font-size: 0.75rem;
  background: #e5e7eb;
  color: #374151;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.dark .section-badge {
  background: #374151;
  color: #d1d5db;
}

/* Number Content */
.number-content {
  font-family: 'JetBrains Mono', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.8;
  color: #374151;
  background: #f9fafb;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  max-height: 300px;
  overflow-y: auto;
  word-break: break-all;
  user-select: all;
}

.dark .number-content {
  background: #111827;
  color: #d1d5db;
  border-color: #374151;
}

/* Number Chunks for Better Readability */
.number-chunk {
  display: inline;
  padding: 0.1rem 0.2rem;
  margin: 0.05rem;
  border-radius: 3px;
  transition: all 0.2s ease;
}

.number-chunk:hover {
  background: rgba(99, 102, 241, 0.1);
  cursor: pointer;
}

.chunk-separator {
  color: #6b7280;
  font-weight: 300;
  margin: 0 0.5rem;
  user-select: none;
}

.chunk-separator::after {
  content: '|';
}

/* Result Section Styling */
.result-section .number-content {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #166534;
}

.dark .result-section .number-content {
  background: #052e16;
  border-color: #16a34a;
  color: #bbf7d0;
}

.verification-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #dcfce7;
  color: #166534;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  margin-top: 1rem;
}

.dark .verification-badge {
  background: #052e16;
  color: #22c55e;
}

/* Loading States */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 0.5rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  color: #6b7280;
  font-style: italic;
}

/* Copy Success Animation */
.copy-success {
  background: #10b981 !important;
  color: white !important;
  transform: scale(1.05);
}

/* Notification */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  z-index: 10001;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  animation: slideInRight 0.3s ease-out;
}

.notification.success {
  background: #10b981;
}

.notification.error {
  background: #ef4444;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .modal-content {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
  
  .modal-header {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
  }
  
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
  
  .operation-title {
    font-size: 1.25rem;
  }
  
  .operation-formula {
    font-size: 0.75rem;
    overflow-x: auto;
  }
  
  .modal-controls {
    padding: 0.75rem 1rem;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .control-button {
    width: 100%;
    justify-content: center;
    padding: 1rem;
  }
  
  .number-section {
    padding: 1rem;
  }
  
  .number-content {
    padding: 1rem;
    font-size: 12px;
    max-height: 250px;
  }
  
  .notification {
    top: 10px;
    right: 10px;
    left: 10px;
    text-align: center;
  }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
  .modal-content {
    width: 90vw;
    height: 85vh;
  }
  
  .number-content {
    font-size: 13px;
    max-height: 280px;
  }
}