/* ===== FEATURES CSS - New Features ===== */
/* Covers: Profile Expansion, Sidebar Company Name, Notification Bell, Site Templates */

/* ===== 1. PROFILE EXPANSION - Meu Plano ===== */

/* Legacy .plano-card kept for backwards compat; v2 overrides below */
.plano-card {
  background: linear-gradient(135deg, #0f2744 0%, #1a3a5c 100%);
  border-radius: 20px;
  padding: 28px 28px 22px;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.06);
}

/* V2 enhanced card */
.plano-card-v2 {
  background: linear-gradient(145deg, #0c2240 0%, #163657 55%, #1d4470 100%);
  border: 1px solid rgba(255,255,255,0.08);
}

/* Decorative glow orbs */
.plano-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.plano-orb-1 {
  width: 260px;
  height: 260px;
  top: -80px;
  right: -60px;
  background: radial-gradient(circle, rgba(200,168,75,0.18) 0%, transparent 65%);
}
.plano-orb-2 {
  width: 160px;
  height: 160px;
  bottom: -40px;
  left: 20px;
  background: radial-gradient(circle, rgba(100,160,255,0.1) 0%, transparent 60%);
}

/* Top row: plan identity + action button */
.plano-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.plano-identity { flex: 1; min-width: 0; }

.plano-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 10px;
}
.plano-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Badges */
.plano-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.plano-badge-basic  { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.8); border: 1px solid rgba(255,255,255,0.18); }
.plano-badge-pro    { background: linear-gradient(135deg, #c8a84b, #e8c96a); color: #0c2240; box-shadow: 0 2px 10px rgba(200,168,75,0.4); }
.plano-badge-enterprise { background: linear-gradient(135deg, #ffd700, #ff9f00); color: #1a1a1a; box-shadow: 0 2px 10px rgba(255,180,0,0.4); }

/* Status pill */
.plano-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #2ecc71;
  background: rgba(46,204,113,0.12);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(46,204,113,0.25);
}
.plano-status::before { display: none; }
.plano-status-active  { color: #2ecc71; }
.plano-status-inactive { color: #e74c3c; background: rgba(231,76,60,0.12); border-color: rgba(231,76,60,0.25); }

/* Price */
.plano-price-row {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 14px;
}
.plano-price-currency {
  font-size: 16px;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  line-height: 1;
}
.plano-price-amount {
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
  color: #fff;
}
.plano-price-period {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  margin-left: 2px;
}

/* Manage plan button */
.plano-btn-upgrade {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  background: linear-gradient(135deg, #c8a84b, #e0b840);
  color: #0c2240;
  border: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(200,168,75,0.35);
  flex-shrink: 0;
}
.plano-btn-upgrade:hover {
  background: linear-gradient(135deg, #d4b455, #f0ca50);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(200,168,75,0.5);
}
.plano-btn-downgrade {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.75);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.15);
  transition: all 0.2s;
}
.plano-btn-downgrade:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* Horizontal rule inside card */
.plano-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 20px 0 16px;
  position: relative;
  z-index: 1;
}

/* Feature pills */
.plano-features,
.plano-features-v2 {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 1;
  margin-bottom: 20px;
}
.plano-feature-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
}
.plano-feature-item svg { width: 16px; height: 16px; color: var(--gold); flex-shrink: 0; }
.plano-feature-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  transition: background 0.15s;
}
.plano-feature-tag svg { color: #c8a84b; }
.plano-feature-tag:hover { background: rgba(255,255,255,0.12); }

/* Usage stats section */
.plano-usage-section {
  position: relative;
  z-index: 1;
  background: rgba(0,0,0,0.18);
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.06);
}
.plano-usage-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 12px;
}
.plano-usage-row {
  margin-bottom: 10px;
}
.plano-usage-row:last-child { margin-bottom: 0; }
.plano-usage-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.plano-usage-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  font-weight: 500;
}
.plano-usage-count {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  font-variant-numeric: tabular-nums;
}

/* Progress track + fill */
.plano-limit-bar { margin-top: 16px; }
.plano-limit-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.plano-limit-label {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  min-width: 80px;
}
.plano-limit-track {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.1);
  border-radius: 99px;
  overflow: hidden;
}
.plano-limit-fill {
  height: 100%;
  background: linear-gradient(90deg, #c8a84b, #e8c96a);
  border-radius: 99px;
  transition: width 0.7s cubic-bezier(0.4,0,0.2,1);
}
.plano-limit-value {
  font-size: 12px;
  color: rgba(255,255,255,0.9);
  min-width: 56px;
  text-align: right;
}

/* ===== 2. SIDEBAR COMPANY NAME ===== */
.sidebar-company-name {
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar-company-name svg {
  width: 14px;
  height: 14px;
  color: var(--gold);
  flex-shrink: 0;
}

/* ===== 3. NOTIFICATION BELL ===== */
.notif-bell-wrap {
  position: relative;
  cursor: pointer;
}
.notif-bell-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  border: none;
}
.notif-bell-btn:hover {
  background: #f0f4ff;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(26,58,92,0.15);
}
.notif-bell-btn svg {
  width: 20px;
  height: 20px;
}
.notif-bell-btn.has-unread {
  color: var(--accent-orange);
}
.notif-badge-count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  background: var(--accent-red);
  color: #fff;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--surface);
  line-height: 1;
}
.notif-badge-count:empty {
  display: none;
}

/* Notification Dropdown */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-height: 480px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: 1100;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: notifDropIn 0.2s ease;
}
.notif-dropdown.open {
  display: flex;
}
@keyframes notifDropIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.notif-dropdown-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.notif-dropdown-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.notif-dropdown-markall {
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}
.notif-dropdown-markall:hover {
  background: var(--bg);
}
.notif-dropdown-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notif-dropdown-tab {
  flex: 1;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.notif-dropdown-tab:hover {
  color: var(--primary);
  background: var(--bg);
}
.notif-dropdown-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.notif-dropdown-tab .tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  background: var(--accent-red);
  color: #fff;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
  padding: 0 4px;
  margin-left: 4px;
}
.notif-dropdown-list {
  flex: 1;
  overflow-y: auto;
  max-height: 340px;
}
.notif-dropdown-item {
  padding: 12px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid var(--border);
}
.notif-dropdown-item:last-child {
  border-bottom: none;
}
.notif-dropdown-item:hover {
  background: var(--bg);
}
.notif-dropdown-item.unread {
  background: #f0f5ff;
}
.notif-dropdown-item.unread:hover {
  background: #e8efff;
}
.notif-dd-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-dd-icon svg {
  width: 18px;
  height: 18px;
}
.notif-dd-icon-app { background: #e8f0fe; color: var(--primary); }
.notif-dd-icon-agenda { background: #d4f8e4; color: var(--accent-green); }
.notif-dd-icon-finance { background: #fff3d4; color: var(--accent-orange); }
.notif-dd-body { flex: 1; min-width: 0; }
.notif-dd-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-dd-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-dd-time {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
}
.notif-dd-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 6px;
}
.notif-dropdown-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  flex-shrink: 0;
}
.notif-dropdown-footer a {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.notif-dropdown-footer a:hover {
  text-decoration: underline;
}
.notif-dropdown-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
}
.notif-dropdown-empty svg {
  width: 48px;
  height: 48px;
  color: var(--border);
  margin-bottom: 12px;
}
.notif-dropdown-empty p {
  font-size: 14px;
  margin-bottom: 4px;
}
.notif-dropdown-empty small {
  font-size: 12px;
  color: var(--text-light);
}

/* ===== 4. SITE TEMPLATES ===== */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.template-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
}
.template-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.template-card.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold), var(--shadow-md);
}
.template-card.selected::after {
  content: 'Selecionado';
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--gold);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 2;
}
.template-preview {
  height: 200px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.template-preview-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.template-preview-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.template-preview-header-logo {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: rgba(255,255,255,0.9);
}
.template-preview-header-nav {
  display: flex;
  gap: 12px;
  margin-left: auto;
}
.template-preview-header-nav span {
  width: 20px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.5);
}
.template-preview-hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
}
.template-preview-hero-text {
  text-align: center;
  color: #fff;
}
.template-preview-hero-text h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.template-preview-hero-text p {
  font-size: 9px;
  opacity: 0.8;
}
.template-preview-properties {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
}
.template-preview-prop {
  flex: 1;
  height: 40px;
  border-radius: 4px;
  background: rgba(255,255,255,0.15);
}
.template-info {
  padding: 16px;
}
.template-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.template-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.template-tag {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  margin-top: 8px;
}
.template-tag-free { background: #d4f8e4; color: #1a7a45; }
.template-tag-pro { background: #e8d4f8; color: #5a1a7a; }
.template-tag-enterprise { background: #fff3d4; color: #9a6700; }

/* Template Domain Section */
.domain-section {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px;
  margin-top: 24px;
}
.domain-input-group {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 12px;
}
.domain-input-prefix {
  padding: 12px 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.domain-input {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
}
.domain-input:focus {
  border-color: var(--primary);
}
.domain-input-suffix {
  padding: 12px 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Property Publish Cards */
.publish-property-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  transition: all 0.2s;
}
.publish-property-card:hover {
  box-shadow: var(--shadow);
}
.publish-prop-img {
  width: 120px;
  height: 90px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f0f4f8, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.publish-prop-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.publish-prop-img svg {
  width: 32px;
  height: 32px;
  color: var(--text-light);
}
.publish-prop-info {
  flex: 1;
  min-width: 0;
}
.publish-prop-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.publish-prop-address {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.publish-prop-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}
.publish-prop-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  align-items: flex-end;
}
.publish-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.publish-btn-site {
  background: var(--primary);
  color: #fff;
}
.publish-btn-site:hover {
  background: var(--primary-light);
}
.publish-btn-portal {
  background: var(--bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.publish-btn-portal:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.publish-btn-published {
  background: #d4f8e4;
  color: #1a7a45;
  cursor: default;
}

/* Portal Modal */
.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.portal-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}
.portal-card:hover {
  border-color: var(--primary);
  background: #f0f4ff;
}
.portal-card.published {
  border-color: var(--accent-green);
  background: #d4f8e4;
}
.portal-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}
.portal-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.portal-status {
  font-size: 11px;
  color: var(--text-secondary);
}
.portal-status.published {
  color: var(--accent-green);
  font-weight: 600;
}

/* ===== UPGRADE MODAL ===== */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}
.plan-option {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}
.plan-option:hover {
  border-color: var(--primary);
}
.plan-option.current {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(200,168,75,0.08), rgba(200,168,75,0.03));
}
.plan-option-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.plan-option-price {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
}
.plan-option-price span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.plan-option-features {
  text-align: left;
  font-size: 12px;
  color: var(--text-secondary);
}
.plan-option-features div {
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.plan-option-features svg {
  width: 14px;
  height: 14px;
  color: var(--accent-green);
  flex-shrink: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .notif-dropdown {
    width: calc(100vw - 32px);
    right: -60px;
    max-height: 400px;
  }
  .templates-grid {
    grid-template-columns: 1fr;
  }
  .plans-grid {
    grid-template-columns: 1fr;
  }
  .portal-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .plano-features {
    grid-template-columns: 1fr;
  }
  .publish-property-card {
    flex-direction: column;
  }
  .publish-prop-img {
    width: 100%;
    height: 120px;
  }
  .publish-prop-actions {
    flex-direction: row;
    align-items: center;
  }
}

/* Opportunity notification icon */
.notif-dd-icon-opportunity { background: #fef3c7; color: #d97706; }
