@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ==========================================================================
   Modern Profile Page Design System & Layout Architecture
   ========================================================================== */

:root {
  --profile-bg: #f8fafc;
  --profile-surface: #ffffff;
  --profile-text-main: #0f172a;
  --profile-text-muted: #64748b;
  --profile-border: #e2e8f0;
  --profile-primary-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #312e81 70%, #4338ca 100%);
  --profile-login-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --profile-register-gradient: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  --profile-search-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --profile-radius-sm: 10px;
  --profile-radius-md: 16px;
  --profile-radius-lg: 24px;
  --profile-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03);
  --profile-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
  --profile-shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.1);
}

body.profile-page-body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
  background-color: var(--profile-bg) !important;
  color: var(--profile-text-main) !important;
  line-height: 1.5 !important;
  margin: 0;
  padding: 0;
}

/* Header Navbar Modernization */
.modern-app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.modern-app-header .logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Main Container Layout: Mobile (1 Column) vs Desktop (2 Columns) */
.profile-main-wrapper {
  padding-top: 80px;
  padding-bottom: 100px; /* Space for bottom menu on mobile */
  min-height: 100vh;
}

.profile-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 992px) {
  .profile-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1.75rem;
    align-items: start;
    padding: 0 1.5rem;
  }
  
  .profile-sidebar {
    position: sticky;
    top: 84px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
  }

  .profile-sidebar::-webkit-scrollbar {
    width: 4px;
  }
  .profile-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
  }

  .profile-feed {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }
}

@media (max-width: 991.98px) {
  .profile-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }
  
  .profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }

  .profile-feed {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }
}

/* Page Title Banner */
.profile-page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.profile-page-heading h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--profile-text-main);
  margin: 0;
  letter-spacing: -0.02em;
}

/* Digital Business Card (Visa Style Modernized) */
.digital-card {
  position: relative;
  background: var(--profile-primary-gradient);
  border-radius: var(--profile-radius-lg);
  padding: 1.5rem;
  color: #ffffff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.digital-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.25) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

.digital-card::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

.digital-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.digital-card-avatar-wrap {
  position: relative;
}

.digital-card-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  background: #ffffff;
}

.digital-card-qr-box {
  background: #ffffff;
  padding: 6px;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.digital-card-qr-box:hover {
  transform: scale(1.05);
}

.digital-card-qr-box img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  display: block;
}

.digital-card-info {
  margin-bottom: 1.25rem;
}

.digital-card-name {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #ffffff;
  margin-bottom: 0.35rem;
  text-transform: capitalize;
}

.digital-card-company {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.digital-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.modern-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none !important;
}

.modern-share-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.modern-share-btn ion-icon {
  font-size: 18px;
}

/* Action Buttons (Login / Register) */
.profile-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 0.25rem;
}

.btn-action-login {
  background: var(--profile-login-gradient) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  border-radius: var(--profile-radius-md) !important;
  padding: 0.75rem 1rem !important;
  text-align: center;
  border: none !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
  text-decoration: none !important;
  display: block;
}

.btn-action-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4) !important;
}

.btn-action-register {
  background: var(--profile-register-gradient) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  border-radius: var(--profile-radius-md) !important;
  padding: 0.75rem 1rem !important;
  text-align: center;
  border: none !important;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
  text-decoration: none !important;
  display: block;
}

.btn-action-register:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4) !important;
}

/* Accordion Section Modernization */
.modern-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.modern-accordion-item {
  background: var(--profile-surface);
  border-radius: var(--profile-radius-md);
  border: 1px solid var(--profile-border);
  box-shadow: var(--profile-shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.modern-accordion-item:hover {
  box-shadow: var(--profile-shadow-md);
}

.modern-accordion-header button {
  width: 100%;
  padding: 1rem 1.25rem;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 700;
  color: var(--profile-text-main);
  cursor: pointer;
  transition: background 0.2s ease;
}

.modern-accordion-header button:focus {
  outline: none;
}

.modern-accordion-header button::after {
  content: '';
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--profile-text-muted);
  border-bottom: 2px solid var(--profile-text-muted);
  transform: rotate(45deg);
  transition: transform 0.3s ease;
}

.modern-accordion-header button[aria-expanded="true"]::after {
  transform: rotate(-135deg);
}

.modern-accordion-body {
  padding: 0 1.25rem 1.25rem 1.25rem;
}

.about-contact-triggers {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn-whatsapp-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(37, 211, 102, 0.12);
  color: #16a34a !important;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 30px;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.btn-whatsapp-pill:hover {
  background: rgba(37, 211, 102, 0.25);
  transform: translateY(-1px);
}

.btn-email-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626 !important;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 30px;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.btn-email-pill:hover {
  background: rgba(239, 68, 68, 0.25);
  transform: translateY(-1px);
}

/* Modern Details Table */
.company-details-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
}

.company-details-table tr th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--profile-text-muted);
  padding: 0.6rem 0.5rem 0.6rem 0;
  border-bottom: 1px solid var(--profile-border);
  width: 32%;
}

.company-details-table tr td {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--profile-text-main);
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--profile-border);
}

.company-details-table tr:last-child th,
.company-details-table tr:last-child td {
  border-bottom: none;
}

/* Search Card & Filter Form */
.search-filter-card {
  background: var(--profile-surface);
  border-radius: var(--profile-radius-md);
  padding: 1.25rem;
  border: 1px solid var(--profile-border);
  box-shadow: var(--profile-shadow-sm);
  width: 100%;
}

.search-form-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  flex-wrap: nowrap;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  width: 100%;
}

.search-input-icon {
  position: absolute !important;
  left: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: var(--profile-text-muted) !important;
  font-size: 1.35rem !important;
  pointer-events: none !important;
  z-index: 10 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#search.modern-search-input,
.modern-search-input {
  width: 100% !important;
  height: 48px !important;
  padding-left: 44px !important;
  padding-right: 16px !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  border-radius: var(--profile-radius-sm) !important;
  border: 1px solid #cbd5e1 !important;
  background: #f8fafc !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  color: var(--profile-text-main) !important;
  line-height: normal !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
  margin: 0 !important;
}

#search.modern-search-input:focus,
.modern-search-input:focus {
  outline: none !important;
  background: #ffffff !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

#suggestions,
.suggestion-box,
.modern-suggestion-box {
  position: absolute !important;
  top: calc(100% + 6px) !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 1050 !important;
  background: #ffffff !important;
  border: 1px solid var(--profile-border) !important;
  border-radius: var(--profile-radius-sm) !important;
  box-shadow: var(--profile-shadow-lg) !important;
  max-height: 240px !important;
  overflow-y: auto !important;
}

.suggestion-item {
  padding: 0.75rem 1rem !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  color: var(--profile-text-main) !important;
  cursor: pointer !important;
  border-bottom: 1px solid #f1f5f9 !important;
  transition: background 0.15s ease !important;
}

.suggestion-item:last-child {
  border-bottom: none !important;
}

.suggestion-item:hover {
  background: #f1f5f9 !important;
  color: #2563eb !important;
}

.search-action-btns {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-search-submit {
  height: 48px !important;
  padding: 0 1.5rem !important;
  background: var(--profile-search-gradient) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  border-radius: var(--profile-radius-sm) !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
}

.btn-search-submit:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4) !important;
}

.btn-search-clear {
  height: 48px !important;
  padding: 0 1.25rem !important;
  background: #f1f5f9 !important;
  color: #64748b !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  border-radius: var(--profile-radius-sm) !important;
  border: 1px solid #cbd5e1 !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  margin: 0 !important;
}

.btn-search-clear:hover {
  background: #e2e8f0 !important;
  color: #334155 !important;
}

@media (max-width: 576px) {
  .search-form-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-action-btns {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  
  .btn-search-submit,
  .btn-search-clear {
    width: 100% !important;
  }
}

/* Feed Grid Container (For profile_events.php) */
.events-feed-grid {
  display: grid;
  gap: 1.25rem;
  width: 100%;
}

@media (min-width: 768px) {
  .events-feed-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 767.98px) {
  .events-feed-grid {
    grid-template-columns: 1fr;
  }
}

/* Event & Product Cards (`profile_events.php`) */
.modern-event-card {
  background: var(--profile-surface);
  border-radius: var(--profile-radius-md);
  border: 1px solid var(--profile-border);
  box-shadow: var(--profile-shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.modern-event-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--profile-shadow-lg);
}

.event-card-media {
  position: relative;
  width: 100%;
  height: 180px;
  background: #0f172a;
  overflow: hidden;
}

.event-card-media img, 
.event-card-media iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
}

.category-badge-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f472b6;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.event-card-body {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.event-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--profile-text-main);
  line-height: 1.35;
  margin: 0 0 0.5rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-card-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--profile-text-muted);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.event-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
}

.btn-card-reserve {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%) !important;
  color: #ffffff !important;
  font-size: 0.825rem !important;
  font-weight: 700 !important;
  padding: 0.45rem 0.9rem !important;
  border-radius: 8px !important;
  border: none !important;
  cursor: pointer;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.btn-card-reserve:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.btn-card-view {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%) !important;
  color: #ffffff !important;
  font-size: 0.825rem !important;
  font-weight: 700 !important;
  padding: 0.45rem 0.9rem !important;
  border-radius: 8px !important;
  border: none !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-card-view:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}

.btn-card-share {
  background: #f1f5f9 !important;
  color: #dc2626 !important;
  padding: 0.45rem 0.6rem !important;
  border-radius: 8px !important;
  border: 1px solid #e2e8f0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
}

.btn-card-share:hover {
  background: #fee2e2 !important;
}

.btn-card-share ion-icon {
  font-size: 20px;
}

/* Loading Spinner Modernization */
.feed-loading-box {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--profile-text-muted);
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.feed-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e2e8f0;
  border-top-color: #4f46e5;
  border-radius: 50%;
  animation: feedSpin 0.8s linear infinite;
}

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