/* Gmail Aliases Magic Window - Professional Design */

.gmail-aliases-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gmail-aliases-modal.active {
  display: flex;
  opacity: 1;
}

.gmail-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.gmail-modal-container {
  position: relative;
  width: 85%;
  max-width: 900px;
  height: 80%;
  max-height: 650px;
  margin: auto;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
  from {
    transform: scale(0.8) translateY(50px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Header */
.gmail-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.gmail-header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.gmail-header-icon {
  font-size: 2rem;
  animation: sparkle 2s infinite;
}

.gmail-header-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.gmail-header-subtitle {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 0.25rem;
}

.gmail-modal-close {
  width: 50px;
  height: 50px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all 0.3s ease;
}

.gmail-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

/* Body */
.gmail-modal-body {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
}

/* Statistics Cards */
.gmail-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.gmail-stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 6px 15px rgba(102, 126, 234, 0.3);
  transition: transform 0.3s ease;
}

.gmail-stat-card:hover {
  transform: translateY(-5px);
}

.stat-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.stat-label {
  font-size: 0.875rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Input Section */
.gmail-input-section {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
}

.gmail-input-group {
  margin-bottom: 1.5rem;
}

.gmail-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.gmail-input {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f8fafc;
}

.gmail-input:focus {
  outline: none;
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Options Grid */
.gmail-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.gmail-option-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
  transition: all 0.3s ease;
}

.gmail-option-card:hover {
  border-color: #667eea;
  background: white;
}

.option-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.option-header i {
  color: #667eea;
  margin-right: 0.5rem;
}

.option-header span {
  font-weight: 600;
  color: #333;
}

.option-description {
  font-size: 0.875rem;
  color: #64748b;
}

/* Switch */
.gmail-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.gmail-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* Range Slider */
.gmail-range-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gmail-range {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #e2e8f0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.gmail-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.range-value {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  min-width: 50px;
  text-align: center;
}

/* Variations Controls */
.variations-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: #f8fafc;
  padding: 0.75rem;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
}

.variation-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.875rem;
}

.decrease-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.decrease-btn:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.increase-btn {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.increase-btn:hover {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

.variations-input {
  width: 80px;
  padding: 0.5rem 0.75rem;
  border: 2px solid #667eea;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  background: white;
  color: #333;
  transition: all 0.3s ease;
}

.variations-input:focus {
  outline: none;
  border-color: #5a67d8;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: #f8fafc;
}

/* Dark Mode for Variations Controls */
[data-theme="dark"] .variations-controls,
.dark-mode .variations-controls {
  background: #2d3748;
  border-color: #4a5568;
}

[data-theme="dark"] .variations-input,
.dark-mode .variations-input {
  background: #1a202c;
  border-color: #667eea;
  color: #e2e8f0;
}

[data-theme="dark"] .variations-input:focus,
.dark-mode .variations-input:focus {
  background: #2d3748;
  border-color: #5a67d8;
}

/* Generate Button */
.gmail-generate-btn {
  width: 100%;
  padding: 1.25rem 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 15px;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

.gmail-generate-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.gmail-generate-btn:hover::before {
  left: 100%;
}

.gmail-generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.btn-icon, .btn-sparkle {
  font-size: 1.25rem;
}

.btn-sparkle {
  font-size: 1rem;
  animation: rotate 2s linear infinite;
}

/* Generating State */
.gmail-generate-btn.generating {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  animation: pulse 1.5s infinite;
}

.gmail-generate-btn.generating:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* Results Section */
.gmail-results-section {
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.results-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.results-actions {
  display: flex;
  gap: 1rem;
}

.gmail-action-btn {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.gmail-action-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.gmail-results-grid {
  padding: 2rem;
  display: grid;
  gap: 1rem;
  max-height: 300px;
  overflow-y: auto;
}

.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.result-item:hover {
  background: white;
  border-color: #667eea;
  transform: translateX(5px);
}

.result-email {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: #1a202c;
  background: rgba(255, 255, 255, 0.8);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(102, 126, 234, 0.2);
}

.copy-btn {
  padding: 0.5rem;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.copy-btn:hover {
  background: #5a67d8;
  transform: scale(1.1);
}

/* Footer */
.gmail-modal-footer {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1rem 2rem;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
}

.heart {
  color: #ff6b6b;
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Dark Mode Support */
[data-theme="dark"] .gmail-modal-body,
.dark-mode .gmail-modal-body {
  background: rgba(30, 30, 30, 0.95);
  color: #e2e8f0;
}

[data-theme="dark"] .gmail-input-section,
.dark-mode .gmail-input-section {
  background: #2d3748;
  border: 1px solid #4a5568;
}

[data-theme="dark"] .gmail-input,
.dark-mode .gmail-input {
  background: #1a202c;
  border-color: #4a5568;
  color: #e2e8f0;
}

[data-theme="dark"] .gmail-input:focus,
.dark-mode .gmail-input:focus {
  background: #2d3748;
  border-color: #667eea;
}

[data-theme="dark"] .gmail-option-card,
.dark-mode .gmail-option-card {
  background: #2d3748;
  border-color: #4a5568;
}

[data-theme="dark"] .gmail-option-card:hover,
.dark-mode .gmail-option-card:hover {
  background: #374151;
  border-color: #667eea;
}

[data-theme="dark"] .gmail-results-section,
.dark-mode .gmail-results-section {
  background: #2d3748;
}

[data-theme="dark"] .result-item,
.dark-mode .result-item {
  background: #1a202c;
  border-color: #4a5568;
  color: #e2e8f0;
}

[data-theme="dark"] .result-item:hover,
.dark-mode .result-item:hover {
  background: #2d3748;
  border-color: #667eea;
}

[data-theme="dark"] .result-email,
.dark-mode .result-email {
  background: #2d3748;
  color: #e2e8f0;
  border-color: rgba(102, 126, 234, 0.4);
}

/* RTL Support */
[dir="rtl"] .gmail-modal-container {
  direction: rtl;
}

[dir="rtl"] .gmail-header-content {
  flex-direction: row-reverse;
}

[dir="rtl"] .gmail-label {
  flex-direction: row-reverse;
}

[dir="rtl"] .option-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .option-header i {
  margin-right: 0;
  margin-left: 0.5rem;
}

[dir="rtl"] .results-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .result-item {
  flex-direction: row-reverse;
}

[dir="rtl"] .footer-content {
  flex-direction: row-reverse;
}

/* Tablet Responsive */
@media (max-width: 1024px) {
  .gmail-modal-container {
    width: 90%;
    height: 85%;
    max-height: 600px;
  }
  
  .gmail-modal-header {
    padding: 1.25rem;
  }
  
  .gmail-header-title {
    font-size: 1.4rem;
  }
  
  .gmail-modal-body {
    padding: 1.25rem;
  }
  
  .gmail-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
  }
  
  .gmail-input-section {
    padding: 1.25rem;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .gmail-aliases-modal {
    z-index: 20000;
  }
  
  .gmail-modal-container {
    width: 95%;
    height: 90%;
    border-radius: 15px;
    max-height: none;
    z-index: 20001;
  }
  
  .gmail-modal-header {
    padding: 1.5rem;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .gmail-header-content {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .gmail-header-title {
    font-size: 1.5rem;
  }
  
  .gmail-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }
  
  [dir="rtl"] .gmail-modal-close {
    right: auto;
    left: 1rem;
  }
  
  .gmail-modal-body {
    padding: 1.25rem;
  }
  
  .gmail-stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .gmail-stat-card {
    padding: 1.25rem;
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  .gmail-input-section {
    padding: 1.5rem;
  }
  
  .gmail-options-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .gmail-option-card {
    padding: 1rem;
  }
  
  .results-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .results-actions {
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
  }
  
  .gmail-results-grid {
    padding: 1.5rem;
    max-height: 250px;
  }
  
  .result-item {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
  
  .copy-btn {
    align-self: center;
    width: 100%;
    max-width: 200px;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .gmail-modal-container {
    width: 100%;
    height: 100%;
    border-radius: 0;
    max-width: none;
    max-height: none;
  }
  
  .variations-controls {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
  }
  
  .variation-btn {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }
  
  .variations-input {
    width: 100%;
    max-width: 120px;
  }
  
  .gmail-modal-header {
    padding: 1rem;
  }
  
  .gmail-header-title {
    font-size: 1.25rem;
  }
  
  .gmail-header-subtitle {
    font-size: 0.875rem;
  }
  
  .gmail-modal-close {
    width: 35px;
    height: 35px;
    top: 0.75rem;
    right: 0.75rem;
  }
  
  [dir="rtl"] .gmail-modal-close {
    right: auto;
    left: 0.75rem;
  }
  
  .gmail-modal-body {
    padding: 1rem;
  }
  
  .gmail-stat-card {
    padding: 1rem;
  }
  
  .stat-number {
    font-size: 1.75rem;
  }
  
  .stat-icon {
    font-size: 1.5rem;
  }
  
  .gmail-input-section {
    padding: 1.25rem;
  }
  
  .gmail-input {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
  }
  
  .gmail-label {
    font-size: 0.875rem;
  }
  
  .gmail-generate-btn {
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }
  
  .gmail-results-grid {
    padding: 1rem;
    max-height: 200px;
  }
  
  .result-email {
    font-size: 0.8rem;
    word-break: break-all;
  }
  
  .gmail-modal-footer {
    padding: 0.75rem 1rem;
  }
  
  .footer-content {
    font-size: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Very Small Screens */
@media (max-width: 360px) {
  .gmail-header-title {
    font-size: 1.1rem;
  }
  
  .gmail-modal-body {
    padding: 0.75rem;
  }
  
  .gmail-input-section {
    padding: 1rem;
  }
  
  .gmail-stats-grid {
    gap: 0.75rem;
  }
  
  .gmail-stat-card {
    padding: 0.875rem;
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
  
  .gmail-generate-btn {
    padding: 0.875rem 1.25rem;
    font-size: 0.9rem;
  }
  
  .btn-text {
    display: none;
  }
  
  .gmail-generate-btn::after {
    content: "Generate";
    font-size: 0.9rem;
  }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .gmail-modal-container {
    height: 95%;
    overflow-y: auto;
  }
  
  .gmail-modal-header {
    padding: 1rem 1.5rem;
  }
  
  .gmail-header-title {
    font-size: 1.25rem;
  }
  
  .gmail-modal-body {
    padding: 1rem 1.5rem;
  }
  
  .gmail-stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
  
  .gmail-stat-card {
    padding: 1rem;
  }
  
  .stat-number {
    font-size: 1.75rem;
  }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .gmail-modal-container {
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
  }
  
  .gmail-stat-card {
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .gmail-aliases-modal,
  .gmail-modal-container,
  .gmail-stat-card,
  .result-item,
  .gmail-generate-btn,
  .copy-btn {
    animation: none !important;
    transition: none !important;
  }
  
  .gmail-icon,
  .magic-sparkle,
  .heart {
    animation: none !important;
  }
}

/* Print Styles */
@media print {
  .gmail-aliases-modal {
    display: none !important;
  }
}
