/**
 * Country Select & Phone Code for CF7
 * Author: Bharanidharan M
 * Pixel-perfect alignment, zero label gap, bulletproof dropdowns, and responsive admin UI.
 */

/* ==========================================================================
   1. Frontend Spacing & Form Input Shell
   ========================================================================== */

/* Neutralize any redundant space from <br> tags inside <label> */
label > br {
  margin: 0 !important;
  line-height: 0 !important;
}

span.wpcf7-form-control-wrap {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: normal !important;
}

/* Unified Input Shell (Using span to preserve phrasing context inside label/p) */
.cf7-country-input-wrap,
.cf7-country-select-wrap {
  position: relative;
  display: flex !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 46px !important;
  min-height: 46px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
  background-color: #ffffff !important;
  border: 1px solid #d1d5db !important;
  border-radius: 4px !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
  font-family: inherit;
  overflow: visible !important;
}

.cf7-country-input-wrap *,
.cf7-country-select-wrap * {
  box-sizing: border-box !important;
}

.cf7-country-input-wrap.is-open,
.cf7-country-select-wrap.is-open {
  z-index: 9999999 !important;
}

.cf7-country-input-wrap:focus-within,
.cf7-country-input-wrap.is-focused,
.cf7-country-select-btn:hover,
.cf7-country-select-btn:focus,
.cf7-country-select-wrap.is-open .cf7-country-select-btn {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

/* Flag & Dial Code Button */
.cf7-country-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  background: #f8fafc !important;
  border: none !important;
  border-right: 1px solid #e2e8f0 !important;
  border-radius: 3px 0 0 3px !important;
  padding: 0 12px !important;
  margin: 0 !important;
  height: 100% !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #334155 !important;
  cursor: pointer !important;
  user-select: none !important;
  transition: background-color 0.15s ease !important;
  outline: none !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  line-height: normal !important;
}

.cf7-country-btn:hover,
.cf7-country-btn:focus {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
}

.cf7-country-input-wrap.is-open .cf7-country-btn {
  background-color: #e2e8f0 !important;
}

/* Flag Icon */
.cf7-country-flag-icon {
  width: 22px !important;
  height: 15px !important;
  border-radius: 2px !important;
  object-fit: cover !important;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.35) !important;
  display: inline-block !important;
  vertical-align: middle !important;
  flex-shrink: 0 !important;
}

/* Dial Code Label */
.cf7-country-dial-code {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  letter-spacing: 0.2px !important;
}

/* Caret Arrow */
.cf7-country-arrow {
  display: inline-block !important;
  width: 0 !important;
  height: 0 !important;
  margin-left: 3px !important;
  vertical-align: middle !important;
  border-top: 4px solid #64748b !important;
  border-right: 4px solid transparent !important;
  border-left: 4px solid transparent !important;
  transition: transform 0.2s ease !important;
}

.cf7-country-input-wrap.is-open .cf7-country-arrow,
.cf7-country-select-wrap.is-open .cf7-country-arrow {
  transform: rotate(180deg) !important;
}

/* Phone Text Input */
.cf7-country-input-wrap input.cf7-country-phone-field,
.cf7-country-input-wrap input[type="tel"] {
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 100% !important;
  min-height: auto !important;
  border: none !important;
  border-radius: 0 3px 3px 0 !important;
  padding: 0 14px !important;
  margin: 0 !important;
  background: transparent !important;
  font-size: 15px !important;
  color: #1e293b !important;
  outline: none !important;
  box-shadow: none !important;
  line-height: normal !important;
}

.cf7-country-input-wrap input.cf7-country-phone-field::placeholder,
.cf7-country-input-wrap input[type="tel"]::placeholder {
  color: #94a3b8 !important;
  opacity: 1 !important;
}

/* Country Select Field Button */
.cf7-country-select-wrap {
  border: none !important;
  background: transparent !important;
}

.cf7-country-select-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  height: 46px !important;
  min-height: 46px !important;
  padding: 0 14px !important;
  background-color: #ffffff !important;
  border: 1px solid #d1d5db !important;
  border-radius: 4px !important;
  font-size: 15px !important;
  color: #1e293b !important;
  cursor: pointer !important;
  user-select: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
  outline: none !important;
  text-align: left !important;
  margin: 0 !important;
}

.cf7-country-select-content {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex: 1 1 auto !important;
  overflow: hidden !important;
}

.cf7-country-select-name {
  font-size: 14.5px !important;
  color: #1e293b !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* ==========================================================================
   2. Dropdown Popovers
   ========================================================================== */
.cf7-country-dropdown {
  position: absolute !important;
  top: calc(100% + 4px) !important;
  left: 0 !important;
  z-index: 99999999 !important;
  display: none !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.12) !important;
  overflow: hidden !important;
  animation: cf7CountryFadeIn 0.15s ease-out;
  box-sizing: border-box !important;
}

.cf7-country-input-wrap .cf7-country-dropdown {
  width: 320px !important;
  max-width: 95vw !important;
}

.cf7-country-select-wrap .cf7-country-dropdown {
  width: 100% !important;
  max-width: 100% !important;
}

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

.cf7-country-input-wrap.is-open .cf7-country-dropdown,
.cf7-country-select-wrap.is-open .cf7-country-dropdown {
  display: flex !important;
  flex-direction: column !important;
}

.cf7-country-search-wrap {
  display: block !important;
  padding: 8px 10px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  background-color: #f8fafc !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

.cf7-country-search-input {
  width: 100% !important;
  max-width: 100% !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 12px !important;
  font-size: 13.5px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px !important;
  background-color: #ffffff !important;
  color: #1e293b !important;
  outline: none !important;
  margin: 0 !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  line-height: 36px !important;
}

.cf7-country-search-input:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15) !important;
}

.cf7-country-list {
  display: block !important;
  margin: 0 !important;
  padding: 4px 0 !important;
  max-height: 240px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  background-color: #ffffff !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

.cf7-country-list::-webkit-scrollbar {
  width: 6px;
}

.cf7-country-list::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 3px;
}

.cf7-country-item {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 8px 14px !important;
  cursor: pointer !important;
  font-size: 14px !important;
  color: #334155 !important;
  background: #ffffff !important;
  transition: background-color 0.12s ease !important;
  user-select: none !important;
  box-sizing: border-box !important;
  width: 100% !important;
  line-height: normal !important;
  text-align: left !important;
  text-decoration: none !important;
}

.cf7-country-item:hover,
.cf7-country-item.is-highlighted {
  background-color: #eff6ff !important;
  color: #1d4ed8 !important;
}

.cf7-country-item.is-selected {
  background-color: #e0f2fe !important;
  color: #0369a1 !important;
  font-weight: 600 !important;
}

.cf7-country-item-flag {
  width: 22px !important;
  height: 15px !important;
  border-radius: 2px !important;
  object-fit: cover !important;
  flex-shrink: 0 !important;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.25) !important;
  display: inline-block !important;
}

.cf7-country-item-name {
  flex: 1 1 auto !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 14px !important;
  color: inherit !important;
}

.cf7-country-item-code {
  font-weight: 600 !important;
  color: #64748b !important;
  font-size: 13px !important;
  margin-left: auto !important;
  flex-shrink: 0 !important;
}

.cf7-country-item:hover .cf7-country-item-code,
.cf7-country-item.is-selected .cf7-country-item-code {
  color: #2563eb !important;
}

.cf7-country-no-results {
  display: block !important;
  padding: 14px !important;
  font-size: 13.5px !important;
  color: #94a3b8 !important;
  text-align: center !important;
  background: #ffffff !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

/* ==========================================================================
   3. Enterprise Admin Dashboard Styling
   ========================================================================== */
.cf7-admin-container {
  max-width: 980px;
  margin: 20px 20px 40px 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  box-sizing: border-box;
}

.cf7-page-header {
  margin-bottom: 18px;
}

.cf7-page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 4px 0;
}

.cf7-version-pill {
  font-size: 11px;
  font-weight: 600;
  background: #e2e8f0;
  color: #475569;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 8px;
}

.cf7-author-credit {
  font-size: 13.5px;
  color: #64748b;
  margin: 0;
}

/* High-Converting Promotional Banner */
.cf7-plugin-promo-banner {
  background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 22px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.cf7-promo-badge {
  display: inline-block;
  background: #2563eb;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.cf7-plugin-promo-banner h2 {
  font-size: 17px;
  font-weight: 700;
  color: #1e3a8a;
  margin: 0 0 6px 0;
}

.cf7-plugin-promo-banner p {
  color: #3b82f6;
  font-size: 13.5px;
  margin: 0 0 14px 0;
}

/* Visual Flags Showcase */
.cf7-flags-showcase {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.cf7-flag-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: #334155;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.cf7-flag-tag img {
  width: 18px;
  height: 12px;
  border-radius: 2px;
  object-fit: cover;
}

.cf7-flag-tag-more {
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
  padding: 4px 8px;
}

/* Tabs Navigation */
.cf7-tabs-nav {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 20px;
}

.cf7-tab-link {
  display: inline-flex;
  align-items: center;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 6px 6px 0 0;
  transition: all 0.15s ease;
}

.cf7-tab-link:hover {
  color: #1e293b;
  background-color: #f8fafc;
}

.cf7-tab-link.is-active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  background-color: #ffffff;
}

/* Code Box */
.cf7-code-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 16px;
  font-family: monospace;
  font-size: 13.5px;
  color: #0f172a;
  margin: 8px 0;
}

/* Quiet Professional Footer */
.cf7-admin-footer {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  font-size: 12.5px;
  color: #64748b;
  text-align: center;
}

@media (max-width: 782px) {
  .cf7-plugin-promo-banner {
    flex-direction: column-reverse !important;
    align-items: center !important;
  }
  .cf7-promo-logo-wrap {
    margin-bottom: 12px;
  }
}

/* Plugin Information & Modal Display */
.cf7-modal-intro-logo {
  width: 72px !important;
  height: 72px !important;
  max-width: 72px !important;
  max-height: 72px !important;
  border-radius: 14px !important;
  float: left !important;
  margin: 2px 18px 14px 0 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  object-fit: cover !important;
  display: block !important;
}

#section-screenshots img {
  display: block;
  max-width: 100% !important;
  height: auto !important;
  border-radius: 8px !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
  margin-top: 10px !important;
  margin-bottom: 24px !important;
}

#section-screenshots li {
  margin-bottom: 28px !important;
  padding-bottom: 20px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  list-style-type: none !important;
}

#section-screenshots ol {
  padding-left: 0 !important;
}

