/**
 * Premium Modals Styles
 * 
 * Styles for upgrade modal and account code redemption modal
 */

/* Modal Overlay */
.premium-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 1rem;
}

.premium-modal-overlay.show {
  opacity: 1;
}

.premium-modal-overlay.loading {
  pointer-events: none;
  opacity: 0.8;
}

/* Modal Container */
.premium-modal {
  background: white;
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.premium-modal-overlay.show .premium-modal {
  transform: scale(1);
}

/* Modal Header */
.premium-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.premium-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
}

.modal-close-btn {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: #6b7280;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  color: #111827;
}

/* Modal Content */
.premium-modal-content {
  padding: 1.5rem;
}

/* Premium Benefits Section */
.premium-benefits-section {
  margin-bottom: 2rem;
}

.premium-benefits-section h3 {
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.premium-benefits-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.premium-benefits-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0;
  color: #374151;
}

.premium-benefits-list li svg {
  flex-shrink: 0;
  margin-top: 0.125rem;
  color: #10b981;
}

/* Pricing Plans */
.pricing-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.pricing-plan {
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem 1rem;
  text-align: center;
  transition: all 0.2s;
  position: relative;
}

.pricing-plan:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.pricing-plan.featured {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #3b82f6;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.plan-header h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.plan-price {
  margin-bottom: 0.5rem;
}

.price-amount {
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
}

.price-period {
  font-size: 0.875rem;
  color: #6b7280;
}

.plan-savings {
  font-size: 0.875rem;
  color: #10b981;
  font-weight: 600;
  margin-top: 0.25rem;
}

.plan-select-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 1rem;
}

.plan-select-btn:hover {
  background: #2563eb;
}

.plan-select-btn:active {
  transform: scale(0.98);
}

/* Modal Footer */
.premium-modal-footer {
  border-top: 1px solid #e5e7eb;
  padding-top: 1.5rem;
  text-align: center;
}

.account-code-note {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0 0 1rem 0;
  line-height: 1.5;
}

/* Account Code Modal Specific Styles */
.account-code-modal {
  max-width: 500px;
}

.account-code-instructions {
  margin-bottom: 1.5rem;
}

.account-code-instructions p {
  margin: 0 0 0.5rem 0;
  color: #374151;
  line-height: 1.5;
}

.device-limit-note {
  font-size: 0.875rem;
  color: #6b7280;
}

.account-code-input-section {
  margin-bottom: 1rem;
}

.account-code-input-section label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #111827;
}

.account-code-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: border-color 0.2s;
}

.account-code-input:focus {
  outline: none;
  border-color: #3b82f6;
}

.account-code-input:disabled {
  background: #f3f4f6;
  cursor: not-allowed;
}

.input-hint {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

/* Error and Success Messages */
.account-code-error,
.account-code-success {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.account-code-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.account-code-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.account-code-success svg {
  flex-shrink: 0;
  color: #10b981;
  margin-top: 0.125rem;
}

.account-code-success strong {
  display: block;
  margin-bottom: 0.25rem;
}

.account-code-success p {
  margin: 0.25rem 0;
}

.device-count {
  font-size: 0.75rem;
  color: #059669;
  font-weight: 600;
}

/* Action Buttons */
.account-code-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.account-code-actions button {
  flex: 1;
}

.btn-primary {
  padding: 0.75rem 1.5rem;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover:not(:disabled) {
  background: #2563eb;
}

.btn-primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 0.75rem 1.5rem;
  background: white;
  color: #374151;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: #9ca3af;
  background: #f9fafb;
}

.btn-link {
  background: none;
  border: none;
  color: #3b82f6;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.5rem;
}

.btn-link:hover {
  color: #2563eb;
}

/* Account Code Help */
.account-code-help {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.account-code-help p {
  margin: 0 0 0.5rem 0;
  color: #6b7280;
  font-size: 0.875rem;
}

.account-code-help p:first-child {
  font-weight: 600;
  color: #111827;
}

/* Responsive Design */
@media (max-width: 640px) {
  .premium-modal {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .pricing-plans {
    grid-template-columns: 1fr;
  }
  
  .account-code-actions {
    flex-direction: column;
  }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
  .premium-modal {
    background: #1f2937;
  }
  
  .premium-modal-header {
    border-bottom-color: #374151;
  }
  
  .premium-modal-header h2 {
    color: #f9fafb;
  }
  
  .modal-close-btn {
    color: #9ca3af;
  }
  
  .modal-close-btn:hover {
    color: #f9fafb;
  }
  
  .premium-benefits-section h3,
  .plan-header h4,
  .price-amount,
  .account-code-input-section label {
    color: #f9fafb;
  }
  
  .premium-benefits-list li,
  .account-code-instructions p {
    color: #d1d5db;
  }
  
  .pricing-plan {
    border-color: #374151;
    background: white;
  }
  
  .pricing-plan:hover {
    border-color: #3b82f6;
  }
  
  .pricing-plan.featured {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  }
  
  .price-period {
    color: #6b7280;
  }
  
  .account-code-input {
    background: #111827;
    border-color: #374151;
    color: #f9fafb;
  }
  
  .account-code-input:focus {
    border-color: #3b82f6;
  }
  
  .btn-secondary {
    background: #374151;
    color: #f9fafb;
    border-color: #4b5563;
  }
  
  .btn-secondary:hover {
    background: #4b5563;
    border-color: #6b7280;
  }
  
  .premium-modal-footer,
  .account-code-help {
    border-top-color: #374151;
  }
}
