/* ============================================
   OPTRONIX v3.0 - Project Panel Component
   ============================================ */

/* Panel Backdrop */
.project-panel-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 10, 0.3);  /* Reduced from 0.85 to 0.3 - less dark */
  /* backdrop-filter: blur(8px); */    /* Removed - no blur */
  /* -webkit-backdrop-filter: blur(8px); */
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.project-panel-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Main Panel Container */
.project-panel {
  position: fixed;
  top: 0;
  right: -550px;
  width: 100%;
  max-width: 550px;
  height: 100vh;
  background: linear-gradient(135deg, 
    rgba(18, 18, 18, 0.98) 0%, 
    rgba(26, 26, 26, 0.98) 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.6);
  z-index: 9999;
  overflow-y: auto;
  overflow-x: hidden;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.project-panel.active {
  right: 0;
}

/* Custom Scrollbar */
.project-panel::-webkit-scrollbar {
  width: 6px;
}

.project-panel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

.project-panel::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 3px;
}

.project-panel::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}

/* Close Button */
.panel-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.panel-close-btn:hover {
  background: rgba(123, 126, 242, 0.15);
  border-color: var(--primary);
  transform: rotate(90deg);
}

.panel-close-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--text);
  stroke-width: 2;
  stroke-linecap: round;
}

/* Hero Image Section */
.panel-hero-image {
  position: relative;
  width: 100%;
  height: 320px;
  overflow: hidden;
  background: linear-gradient(135deg, 
    rgba(123, 126, 242, 0.1) 0%, 
    rgba(126, 217, 87, 0.1) 100%
  );
}

.panel-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.panel-hero-image img.loaded {
  opacity: 1;
}

.panel-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 140px;
  background: linear-gradient(to top, 
    rgba(18, 18, 18, 0.98) 0%, 
    transparent 100%
  );
  display: flex;
  align-items: flex-end;
  padding: 28px;
}

.panel-location-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(123, 126, 242, 0.12);
  border: 1px solid var(--primary);
  border-radius: 24px;
  font-size: 0.95rem;
  color: var(--primary-light);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.panel-location-badge .fi {
  font-size: 1.2em;
}

/* Panel Content */
.panel-content {
  padding: 36px 32px 40px;
}

.panel-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

/* Client Section */
.panel-client {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.panel-client-logo {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: linear-gradient(135deg, 
    rgba(123, 126, 242, 0.15) 0%, 
    rgba(126, 217, 87, 0.15) 100%
  );
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
}

.panel-client-info h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
}

.panel-client-info p {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

/* Stats Grid */
.panel-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.panel-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 16px;
  transition: all 0.3s ease;
}

.panel-stat:hover {
  background: var(--card-hover);
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 4px 16px var(--shadow-hover);
}

.panel-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 6px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.panel-stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 500;
}

/* Description Section */
.panel-description {
  margin-bottom: 28px;
}

.panel-description h4 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

.panel-description p {
  color: var(--text-light);
  line-height: 1.75;
  margin: 0 0 14px;
  font-size: 0.95rem;
  opacity: 0.95;
}

.panel-description p:last-child {
  margin-bottom: 0;
}

.panel-description ul {
  margin: 14px 0;
  padding-left: 24px;
  color: var(--text-light);
  opacity: 0.95;
}

.panel-description li {
  margin-bottom: 10px;
  line-height: 1.7;
  font-size: 0.95rem;
}

/* Tags Section */
.panel-tags {
  margin-bottom: 32px;
}

.panel-tags h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.panel-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.panel-tag {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(123, 126, 242, 0.12);
  border: 1px solid var(--primary);
  border-radius: 24px;
  font-size: 0.85rem;
  color: var(--primary-light);
  font-weight: 500;
  transition: all 0.3s ease;
  letter-spacing: 0.3px;
}

.panel-tag:hover {
  background: rgba(123, 126, 242, 0.2);
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

/* CTA Section */
.panel-cta {
  margin-top: 36px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.panel-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 32px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: 10px;
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(123, 126, 242, 0.25);
  letter-spacing: 0.3px;
}

.panel-cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(123, 126, 242, 0.4);
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}

.panel-cta-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Loading State */
.panel-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.panel-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: panelSpin 0.8s linear infinite;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
  .project-panel {
    max-width: 100%;
    right: -100%;
  }
  
  .panel-hero-image {
    height: 260px;
  }
  
  .panel-content {
    padding: 28px 24px 36px;
  }
  
  .panel-title {
    font-size: 1.65rem;
  }
  
  .panel-stats {
    grid-template-columns: 1fr;
  }
  
  .panel-stat-value {
    font-size: 1.75rem;
  }
  
  .panel-close-btn {
    top: 16px;
    right: 16px;
  }
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
  .project-panel,
  .project-panel-backdrop,
  .panel-close-btn,
  .panel-stat,
  .panel-tag,
  .panel-cta-btn {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
