/* ============================================
   OR-Tools Portal Homepage - Custom Styles
   ============================================ */

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Background Grid Pattern */
.bg-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(15, 23, 42, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -1;
  pointer-events: none;
}

/* Minimalist Navbar */
.navbar-portal {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
  transition: all 0.3s ease;
}

.navbar-portal .navbar-brand {
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 1.25rem;
}

.navbar-brand span {
  color: var(--text-primary);
}

/* Hero Section */
.hero-portal {
  padding: 6rem 0 4rem;
  text-align: center;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  background-color: var(--text-primary);
  border-radius: 50%;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero-title-gradient {
  background: linear-gradient(135deg, var(--accent-blue-light) 0%, #0080ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  display: inline-block;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.2rem;
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.6;
  font-weight: 400;
}

/* Portal Cards */
.portal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl);
  height: 100%;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: default;
  box-shadow: var(--shadow-md);
}

.portal-card.card-live {
  cursor: pointer;
}

.portal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-blue) 0%, #0080ff 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
}

.portal-card:hover::before {
  transform: scaleX(1);
}

.portal-card:hover {
  transform: translateY(-8px);
  background: var(--bg-card);
  border-color: var(--border-active);
  box-shadow: var(--shadow-xl);
  color: var(--text-primary);
  text-decoration: none;
}

.portal-card.card-live:hover {
  border-color: var(--border-active);
  background: var(--bg-card);
  box-shadow: var(--shadow-xl);
}

.card-thumbnail-wrap {
  width: 100%;
  height: 160px;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  flex-shrink: 0;
}

.card-thumbnail-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

@media (min-width: 992px) {
  .portal-card {
    flex-direction: column;
    height: 420px;
  }
}

.portal-card .card-body {
  padding: 2rem;
  z-index: 2;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 1rem;
  background: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.portal-card:hover .card-icon-wrap {
  background: #ffffff;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
  transform: scale(1.05);
}

.portal-card:hover .card-thumbnail-wrap img {
  transform: scale(1.05);
}

.portal-card .card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.portal-card .card-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  flex-grow: 1;
  margin-bottom: 1.5rem;
}

/* Badges */
.card-badge {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  z-index: 2;
}

.badge-live {
  background: #F6FFED;
  border: 1px solid #B7EB8F;
  color: #389E0D;
}

.badge-planned {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

/* Card Tags */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.card-tag {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

.portal-card:hover .card-tag {
  border-color: var(--border-active);
  color: var(--text-primary);
}

/* Buttons */
.btn-portal {
  border-radius: 0.75rem;
  padding: 0.6rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.btn-portal-primary {
  background: var(--text-primary);
  color: white;
  border: none;
}

.btn-portal-primary:hover {
  background: var(--text-secondary);
  transform: translateY(-2px);
  color: white;
}

.btn-portal-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.btn-portal-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-portal-disabled {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Footer */
.footer-portal {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0;
  margin-top: 6rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-portal a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-portal a:hover {
  color: var(--accent-blue-light);
}

/* Animations */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.15);
  }
}

@keyframes pulse-live {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
  }
  50% {
    opacity: 0.85;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.1);
  }
}

/* Responsive adjust */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  .hero-subtitle {
    font-size: 1.05rem;
  }
  .hero-portal {
    padding: 4rem 0 2rem;
  }
  .portal-card .card-body {
    padding: 1.5rem;
  }
}
