/* ========================================
   Calculator Tools - Enhanced Styles
   Modern, attractive calculator interface
   ======================================== */

/* ========== CALCULATOR GRID LAYOUT ========== */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

@media (max-width: 640px) {
  .calc-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== INPUT GROUPS ========== */
.calc-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calc-input-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 6px;
}

.calc-input-group input[type="number"],
.calc-input-group input[type="date"],
.calc-input-group input[type="time"],
.calc-input-group input[type="text"],
.calc-input-group select {
  padding: 12px 16px;
  border: 2px solid #E4EAF2;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
  color: var(--navy);
  background: white;
  transition: all 0.3s ease;
}

.calc-input-group input:focus,
.calc-input-group select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(0, 201, 167, 0.1);
  transform: translateY(-1px);
}

.calc-input-group input:hover,
.calc-input-group select:hover {
  border-color: #C5D5E8;
}

.calc-input-group small {
  font-size: 0.8rem;
  color: #6B87A8;
  margin-top: 4px;
}

/* ========== BUTTON STYLES ========== */
.btn-calc {
  background: linear-gradient(135deg, var(--teal) 0%, #00A387 100%);
  color: white;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 16px 40px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 201, 167, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-calc::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-calc:hover::before {
  width: 300px;
  height: 300px;
}

.btn-calc:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 201, 167, 0.4);
}

.btn-calc:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 201, 167, 0.3);
}

/* ========== RESULT CARDS ========== */
.calc-result-card {
  background: linear-gradient(135deg, #F7F9FC 0%, #E8F4FD 100%);
  border: 2px solid rgba(0, 201, 167, 0.1);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(11, 30, 61, 0.08);
  position: relative;
  overflow: hidden;
}

.calc-result-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 201, 167, 0.05) 0%, transparent 70%);
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.calc-result-card h3 {
  font-size: 1.1rem;
  color: var(--navy);
  margin-bottom: 16px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.calc-result-big {
  font-size: 3rem;
  font-weight: 800;
  color: var(--teal);
  margin: 16px 0;
  position: relative;
  z-index: 1;
  text-shadow: 0 4px 12px rgba(0, 201, 167, 0.2);
  line-height: 1.2;
}

.calc-result-label {
  font-size: 0.95rem;
  color: #6B87A8;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* ========== RESULT ITEMS GRID ========== */
.calc-result-item {
  background: white;
  border: 2px solid #E4EAF2;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.3s ease;
}

.calc-result-item:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 201, 167, 0.15);
}

.calc-result-item .calc-result-label {
  font-size: 0.85rem;
  color: #6B87A8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calc-result-item .calc-result-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
}

/* ========== MODE BUTTONS ========== */
.mode-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  background: transparent;
  color: #6B7280;
  position: relative;
}

.mode-btn.active {
  background: white;
  color: var(--teal);
  box-shadow: 0 4px 12px rgba(0, 201, 167, 0.15);
}

.mode-btn:not(.active):hover {
  background: rgba(255, 255, 255, 0.5);
  color: var(--navy);
}

/* ========== ENHANCED TEXT EDITOR ========== */
.text-editor {
  width: 100%;
  min-height: 200px;
  padding: 20px;
  border: 2px solid #E4EAF2;
  border-radius: 12px;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  transition: all 0.3s ease;
  background: white;
}

.text-editor:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(0, 201, 167, 0.1);
}

.text-editor::placeholder {
  color: #C5D5E8;
}

/* ========== INFO BOXES ========== */
.calc-info-box {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  border-left: 4px solid #F59E0B;
  border-radius: 12px;
  padding: 20px;
  margin: 24px 0;
}

.calc-info-box h4 {
  color: #92400E;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.calc-info-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.calc-info-box li {
  color: #78350F;
  font-size: 0.9rem;
  line-height: 1.7;
  padding-left: 24px;
  position: relative;
  margin-bottom: 8px;
}

.calc-info-box li::before {
  content: '•';
  position: absolute;
  left: 8px;
  font-weight: 700;
  color: #F59E0B;
}

/* ========== SUCCESS BOXES ========== */
.calc-success-box {
  background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
  border-left: 4px solid #10B981;
  border-radius: 12px;
  padding: 20px;
  margin: 24px 0;
}

.calc-success-box h4 {
  color: #065F46;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.calc-success-box p {
  color: #047857;
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.6;
}

/* ========== CALENDAR VIEW (for ovulation calculator) ========== */
.calc-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.calc-calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  cursor: default;
}

.calc-calendar-day:hover {
  transform: scale(1.05);
}

/* ========== SLIDER ENHANCEMENTS ========== */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #E4EAF2 0%, #E4EAF2 100%);
  outline: none;
  transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal) 0%, #00A387 100%);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 201, 167, 0.3);
  border: 3px solid white;
  transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 6px 16px rgba(0, 201, 167, 0.4);
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal) 0%, #00A387 100%);
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 4px 12px rgba(0, 201, 167, 0.3);
}

/* ========== LOADING STATE ========== */
.calc-loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== COPY BUTTON ENHANCEMENTS ========== */
.btn-copy {
  background: white;
  color: var(--teal);
  border: 2px solid var(--teal);
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-copy:hover {
  background: var(--teal);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 201, 167, 0.2);
}

.btn-copy.copied {
  background: #10B981;
  border-color: #10B981;
  color: white;
}

/* ========== DOWNLOAD BUTTON ENHANCEMENTS ========== */
.btn-download {
  background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
  color: white;
  font-weight: 600;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

/* ========== PROGRESS BAR ========== */
.calc-progress-bar {
  width: 100%;
  height: 8px;
  background: #E4EAF2;
  border-radius: 4px;
  overflow: hidden;
  margin: 16px 0;
}

.calc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal) 0%, #00ddb7 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* ========== TOOLTIP ========== */
.calc-tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

.calc-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.calc-tooltip:hover::after {
  opacity: 1;
}

/* ========== BADGE STYLES ========== */
.calc-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calc-badge-success {
  background: #D1FAE5;
  color: #065F46;
}

.calc-badge-warning {
  background: #FEF3C7;
  color: #92400E;
}

.calc-badge-info {
  background: #DBEAFE;
  color: #1E40AF;
}

/* ========== COMPARISON CARDS ========== */
.calc-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.calc-comparison-card {
  background: white;
  border: 2px solid #E4EAF2;
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.calc-comparison-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--teal) 0%, #00A387 100%);
}

.calc-comparison-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(11, 30, 61, 0.12);
}

.calc-comparison-card h4 {
  font-size: 1rem;
  color: #6B87A8;
  margin-bottom: 16px;
  font-weight: 600;
}

.calc-comparison-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
}

/* ========== MOBILE OPTIMIZATIONS ========== */
@media (max-width: 640px) {
  .calc-result-big {
    font-size: 2.5rem;
  }
  
  .calc-result-item .calc-result-value {
    font-size: 1.25rem;
  }
  
  .btn-calc {
    width: 100%;
    padding: 14px 32px;
  }
  
  .calc-comparison-grid {
    grid-template-columns: 1fr;
  }
  
  .calc-grid {
    gap: 16px;
  }
  
  .mode-btn {
    padding: 10px 16px;
    font-size: 0.9rem;
  }
}

/* ========== ANIMATIONS ========== */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.calc-animate-in {
  animation: slideInUp 0.5s ease forwards;
}

/* Stagger animation for result items */
.calc-result-item:nth-child(1) { animation-delay: 0.1s; }
.calc-result-item:nth-child(2) { animation-delay: 0.2s; }
.calc-result-item:nth-child(3) { animation-delay: 0.3s; }
.calc-result-item:nth-child(4) { animation-delay: 0.4s; }
.calc-result-item:nth-child(5) { animation-delay: 0.5s; }
.calc-result-item:nth-child(6) { animation-delay: 0.6s; }

/* ========== GLASSMORPHISM EFFECT ========== */
.calc-glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(11, 30, 61, 0.1);
}

/* ========== GRADIENT TEXT ========== */
.calc-gradient-text {
  background: linear-gradient(135deg, var(--teal) 0%, #00A387 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========== ICON BUTTONS ========== */
.calc-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #E4EAF2;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.2rem;
}

.calc-icon-btn:hover {
  border-color: var(--teal);
  background: rgba(0, 201, 167, 0.1);
  transform: scale(1.1);
}
