/* ================================
   CODETUDE WHATSAPP LINK - STYLES
   Cores oficiais do WhatsApp
   ================================ */

:root {
  --whatsapp-green: #25d366;
  --whatsapp-dark: #128c7e;
  --whatsapp-light: #dcf8c6;
  --whatsapp-bg: #ece5dd;
  --text-dark: #075e54;
  --text-gray: #667781;
  --border-color: #e9edef;
}

.codetude-whatsapp-generator {
  max-width: 900px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  padding: 20px;
}

/* Header */
.whatsapp-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 40px 30px;
  background: linear-gradient(
    135deg,
    var(--whatsapp-green) 0%,
    var(--whatsapp-dark) 100%
  );
  border-radius: 20px;
  color: white;
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.3);
}

.whatsapp-icon {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  backdrop-filter: blur(10px);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.whatsapp-header h1 {
  margin: 0 0 10px 0;
  font-size: 32px;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.whatsapp-header p {
  margin: 0;
  font-size: 18px;
  opacity: 0.95;
}

/* Main Card */
.whatsapp-card {
  background: white;
  border-radius: 20px;
  padding: 35px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  border: 1px solid var(--border-color);
}

/* Form */
.whatsapp-form {
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 15px;
}

.form-group label svg {
  stroke: var(--whatsapp-green);
}

/* Phone Input */
.phone-input-wrapper {
  display: flex;
  gap: 10px;
}

.country-select {
  width: 140px !important;
  padding: 14px 16px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}

.country-select:focus {
  outline: none;
  border-color: var(--whatsapp-green);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.phone-input {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 16px;
  transition: all 0.2s;
  font-family: "Courier New", monospace;
}

.phone-input:focus {
  outline: none;
  border-color: var(--whatsapp-green);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.phone-input::placeholder {
  color: #999;
}

/* Message Input */
.message-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  transition: all 0.2s;
  min-height: 100px;
}

.message-input:focus {
  outline: none;
  border-color: var(--whatsapp-green);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.input-hint {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-gray);
}

/* Generate Button */
.generate-btn {
  width: 100%;
  padding: 16px 30px;
  background: linear-gradient(
    135deg,
    var(--whatsapp-green) 0%,
    var(--whatsapp-dark) 100%
  );
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.5);
}

.generate-btn:active {
  transform: translateY(0);
}

.generate-btn svg {
  flex-shrink: 0;
}

/* Result Section */
.result-section {
  border-top: 2px solid var(--border-color);
  padding-top: 30px;
  animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 15px 20px;
  background: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 10px;
  color: #155724;
  font-weight: 600;
}

.result-header svg {
  stroke: #28a745;
  flex-shrink: 0;
}

/* Link Display */
.link-display {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.link-input {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid var(--whatsapp-green);
  border-radius: 12px;
  font-size: 14px;
  font-family: "Courier New", monospace;
  background: #f0fff4;
  color: var(--text-dark);
  font-weight: 600;
}

.link-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.copy-btn {
  width: 50px;
  height: 50px;
  background: var(--whatsapp-green);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.copy-btn:hover {
  background: var(--whatsapp-dark);
  transform: scale(1.05);
}

.copy-btn.copied {
  background: #28a745;
}

/* Action Buttons */
.action-buttons {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 10px;
}

.action-btn {
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.action-btn.primary {
  background: var(--whatsapp-green);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.action-btn.primary:hover {
  background: var(--whatsapp-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

.action-btn.secondary {
  background: white;
  color: var(--whatsapp-green);
  border: 2px solid var(--whatsapp-green);
}

.action-btn.secondary:hover {
  background: #f0fff4;
  border-color: var(--whatsapp-dark);
  color: var(--whatsapp-dark);
}

/* History Section */
.history-section {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  border: 1px solid var(--border-color);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border-color);
}

.history-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-header h3 svg {
  stroke: var(--whatsapp-green);
}

.clear-history-btn {
  padding: 8px 16px;
  background: #ffe5e5;
  color: #dc3545;
  border: 1px solid #ffd0d0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.clear-history-btn:hover {
  background: #ffd0d0;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 18px;
  background: #f8f9fa;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.history-item:hover {
  background: var(--whatsapp-light);
  border-color: var(--whatsapp-green);
  transform: translateX(5px);
}

.history-phone {
  font-family: "Courier New", monospace;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 15px;
}

.history-message {
  font-size: 13px;
  color: var(--text-gray);
  margin-top: 4px;
  max-width: 400px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-time {
  font-size: 12px;
  color: var(--text-gray);
}

.history-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-gray);
}

.history-empty svg {
  opacity: 0.3;
  margin-bottom: 15px;
}

/* Info Section */
.info-section {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
}

.info-section h3 {
  margin: 0 0 20px 0;
  font-size: 20px;
  color: var(--text-dark);
}

.info-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 30px;
}

.info-item {
  display: flex;
  gap: 15px;
  align-items: flex-start;
}

.info-number {
  width: 40px;
  height: 40px;
  background: var(--whatsapp-green);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.info-text strong {
  display: block;
  color: var(--text-dark);
  margin-bottom: 5px;
  font-size: 15px;
}

.info-text p {
  margin: 0;
  color: var(--text-gray);
  font-size: 14px;
  line-height: 1.6;
}

.info-tips {
  background: #f0fff4;
  border: 2px solid var(--whatsapp-light);
  border-radius: 12px;
  padding: 20px;
}

.info-tips h4 {
  margin: 0 0 15px 0;
  color: var(--text-dark);
  font-size: 16px;
}

.info-tips ul {
  margin: 0;
  padding-left: 25px;
}

.info-tips li {
  margin-bottom: 10px;
  color: var(--text-gray);
  line-height: 1.6;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
  .codetude-whatsapp-generator {
    padding: 15px;
  }

  .whatsapp-header {
    padding: 30px 20px;
  }

  .whatsapp-header h1 {
    font-size: 26px;
  }

  .whatsapp-card {
    padding: 25px 20px;
  }

  .phone-input-wrapper {
    flex-direction: column;
  }

  .country-select {
    width: 100%;
  }

  .action-buttons {
    grid-template-columns: 1fr;
  }

  .history-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .history-message {
    max-width: 100%;
  }
}

/* Loading State */
.generate-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.generate-btn.loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 10px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Tooltips */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 8px 12px;
  background: #333;
  color: white;
  font-size: 12px;
  white-space: nowrap;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* Success Animation */
@keyframes success {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.result-section.show {
  animation: success 0.5s ease-out;
}
