/* Modern Kaspi Calculator - Adapty Style */

/* CSS Variables for consistent theming */
:root {
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --secondary-color: #8b5cf6;
  --accent-color: #06b6d4;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --text-dark: #1f2937;
  --text-medium: #4b5563;
  --text-light: #6b7280;
  --background-light: #f9fafb;
  --background-white: #ffffff;
  --border-color: #e5e7eb;
  --border-radius: 12px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Reset and Base Styles */
.kaspi-calculator-modern * {
  box-sizing: border-box;
}

.kaspi-calculator-modern {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  color: var(--text-dark);
  line-height: 1.6;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

/* Header Section */
.calculator-header {
  text-align: center;
  margin-bottom: 3rem;
  color: white;
}

.calculator-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.calculator-header p {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* Main Calculator Content */
.calculator-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  background: var(--background-white);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow-xl);
}

/* Left Panel - Form */
.calculator-left {
  padding-right: 1rem;
}

.form-section {
  margin-bottom: 2rem;
}

.form-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-section h3:before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 2px;
}

/* Form Layout */
.form-row {
  margin-bottom: 1.5rem;
}

.form-row.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

/* Input Styles */
.form-group input,
.form-group select {
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.2s ease;
  background: var(--background-white);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-with-suffix {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-suffix input {
  flex: 1;
  padding-right: 3rem;
}

.input-with-suffix .suffix {
  position: absolute;
  right: 1rem;
  color: var(--text-medium);
  font-weight: 500;
  pointer-events: none;
}

.form-group small {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

/* Checkbox Styles */
.checkbox-label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.5rem 0;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  position: relative;
  transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark:after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
  font-size: 12px;
}

/* Tire Options */
.tire-options {
  background: var(--background-light);
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  border: 1px solid var(--border-color);
}

/* Buttons */
.btn-calculate {
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
}

.btn-calculate:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-calculate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Lead Form Section */
.lead-form-section {
  background: linear-gradient(135deg, var(--background-light), #ffffff);
  padding: 2rem;
  border-radius: var(--border-radius);
  border: 2px solid var(--border-color);
  margin-top: 2rem;
}

.lead-form-section h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.lead-form-section p {
  color: var(--text-medium);
  margin-bottom: 1.5rem;
}

.btn-submit-lead {
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--success-color), #059669);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
}

.btn-submit-lead:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Right Panel - Results */
.calculator-right {
  padding-left: 1rem;
  border-left: 1px solid var(--border-color);
}

.results-panel {
  position: sticky;
  top: 2rem;
}

.results-header {
  text-align: center;
  margin-bottom: 2rem;
}

.results-header h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.results-header p {
  color: var(--text-medium);
  font-size: 0.9rem;
}

/* Results Content */
.calculation-results {
  min-height: 400px;
}

.initial-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light);
}

.initial-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.initial-state h4 {
  color: var(--text-medium);
  margin-bottom: 0.5rem;
}

/* Results Grid */
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.result-card {
  background: var(--background-white);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.result-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.result-card h4 {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-medium);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.result-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.result-card.profit .result-value {
  color: var(--success-color);
}

.result-card.loss .result-value {
  color: var(--error-color);
}

.result-description {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Breakdown Table */
.breakdown-section {
  margin-top: 2rem;
}

.breakdown-section h4 {
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.breakdown-table th,
.breakdown-table td {
  padding: 0.75rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.breakdown-table th {
  font-weight: 600;
  color: var(--text-dark);
  background: var(--background-light);
}

.breakdown-table .total-row {
  font-weight: 600;
  background: var(--background-light);
}

/* Recommendations */
.recommendations-section {
  margin-top: 2rem;
}

.recommendations-section h4 {
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.recommendation {
  background: var(--background-light);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border-left: 4px solid var(--primary-color);
}

.recommendation h5 {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.recommendation p {
  font-size: 0.875rem;
  color: var(--text-medium);
  margin-bottom: 0.5rem;
}

.recommendation .action {
  font-size: 0.75rem;
  color: var(--primary-color);
  font-weight: 500;
}

/* FAQ Section */
.faq-section {
  margin-top: 4rem;
  background: var(--background-white);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
}

.faq-section h3 {
  font-size: 1.75rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--text-dark);
}

.faq-item {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.faq-question:hover {
  color: var(--primary-color);
}

.faq-question h4 {
  font-weight: 500;
  margin: 0;
  font-size: 1rem;
}

.faq-toggle {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
  transition: transform 0.2s ease;
}

.faq-item.active .faq-toggle {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 0 1rem 0;
  display: none;
}

.faq-item.active .faq-answer {
  display: block;
}

.faq-answer p {
  color: var(--text-medium);
  line-height: 1.6;
}

/* CTA Section */
.cta-section {
  margin-top: 4rem;
  text-align: center;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 3rem 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
}

.cta-section h3 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.cta-section p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.btn-cta {
  display: inline-block;
  padding: 1rem 2rem;
  background: white;
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-spinner {
  text-align: center;
  color: white;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

/* Error Notification */
.error-notification {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 1001;
  background: var(--error-color);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  animation: slideIn 0.3s ease;
}

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

.error-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.error-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  margin-left: auto;
}

/* Success Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1002;
}

.modal-content {
  background: white;
  border-radius: var(--border-radius);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  margin: 0;
  font-weight: 600;
  color: var(--text-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
}

.modal-body {
  padding: 2rem 1.5rem;
  text-align: center;
}

.success-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.modal-body p {
  color: var(--text-medium);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn-primary,
.btn-secondary {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  text-decoration: none;
}

.btn-secondary {
  background: var(--background-light);
  color: var(--text-dark);
}

.btn-secondary:hover {
  background: var(--border-color);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .calculator-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .calculator-right {
    border-left: none;
    border-top: 1px solid var(--border-color);
    padding-left: 0;
    padding-top: 2rem;
  }
  
  .results-panel {
    position: static;
  }
}

@media (max-width: 768px) {
  .kaspi-calculator-modern {
    padding: 1rem;
  }
  
  .calculator-header h1 {
    font-size: 2rem;
  }
  
  .calculator-header p {
    font-size: 1rem;
  }
  
  .calculator-content {
    padding: 1.5rem;
  }
  
  .form-row.two-cols {
    grid-template-columns: 1fr;
  }
  
  .results-grid {
    grid-template-columns: 1fr;
  }
  
  .faq-section,
  .cta-section {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .calculator-header h1 {
    font-size: 1.75rem;
  }
  
  .calculator-content {
    padding: 1rem;
  }
  
  .modal-content {
    margin: 1rem;
    width: calc(100% - 2rem);
  }
  
  .modal-actions {
    flex-direction: column;
  }
} 