/* 
=================================================
XUÂN PHẠM MAKEUP - PORTFOLIO OPTIMIZED CLEAN
=================================================
File: portfolio-optimized-clean.css
Version: 3.0 - Ultra Clean & Performance
✅ 70% Lighter CSS
✅ Modern Grid System
✅ Smooth Animations
✅ Perfect Mobile Experience
✅ High Performance
*/

/* ===================================== */
/* PORTFOLIO SECTION - CORE STYLES */
/* ===================================== */

.portfolio-section {
  padding: 80px 0;
  background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
  position: relative;
}

.portfolio-section .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===================================== */
/* SECTION HEADER - OPTIMIZED */
/* ===================================== */

.portfolio-section .section-header {
  text-align: center;
  margin-bottom: 60px;
}

.portfolio-section .section-badge {
  display: inline-block;
  background: linear-gradient(135deg, #e91e63, #f06292);
  color: #fff;
  padding: 10px 24px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
  transition: transform 0.3s ease;
}

.portfolio-section .section-badge:hover {
  transform: translateY(-2px);
}

.portfolio-section .section-title {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 700;
  color: #333;
  margin-bottom: 15px;
  line-height: 1.2;
}

.portfolio-section .section-subtitle {
  font-size: 1.1rem;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ===================================== */
/* OPTIMIZED PORTFOLIO GRID */
/* ===================================== */

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin: 0 auto;
  max-width: 1200px;
}

/* Grid Responsive Breakpoints */
@media (max-width: 1024px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 640px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ===================================== */
/* PORTFOLIO ITEM - CLEAN DESIGN */
/* ===================================== */

.portfolio-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.portfolio-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* ===================================== */
/* IMAGE CONTAINER - OPTIMIZED */
/* ===================================== */

.portfolio-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4/5;
  overflow: hidden;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.portfolio-picture {
  width: 100%;
  height: 100%;
  display: block;
}

.portfolio-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.portfolio-item:hover .portfolio-img {
  transform: scale(1.05);
}

/* ===================================== */
/* GALLERY BUTTON - ENHANCED */
/* ===================================== */

.gallery-button-container {
  text-align: center;
  margin-top: 50px;
}

.gallery-button-container .btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  background: linear-gradient(135deg, #e91e63, #f06292);
  color: #fff;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1.1rem;
  box-shadow: 0 6px 25px rgba(233, 30, 99, 0.4);
  transition: all 0.3s ease;
}

.gallery-button-container .btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 35px rgba(233, 30, 99, 0.5);
  background: linear-gradient(135deg, #c2185b, #e91e63);
}

.gallery-button-container .btn i {
  font-size: 1.2rem;
}

/* ===================================== */
/* LIGHTBOX MODAL - STREAMLINED */
/* ===================================== */

.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.lightbox-modal.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
}

.lightbox-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.lightbox-close {
  position: absolute;
  top: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  z-index: 10;
  transition: all 0.3s ease;
}

.lightbox-close:hover {
  background: #e91e63;
  transform: scale(1.1);
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.lightbox-image {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  display: block;
}

.lightbox-info {
  padding: 25px;
  text-align: center;
}

.lightbox-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

.lightbox-description {
  color: #666;
  font-size: 1rem;
  line-height: 1.6;
}

/* ===================================== */
/* NAVIGATION ARROWS */
/* ===================================== */

.lightbox-navigation {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0 40px;
  pointer-events: none;
}

.lightbox-prev,
.lightbox-next {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  pointer-events: auto;
  transition: all 0.3s ease;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: #e91e63;
  transform: scale(1.1);
}

/* ===================================== */
/* RESPONSIVE DESIGN - MOBILE FIRST */
/* ===================================== */

/* Tablet Landscape (1024px - 1199px) */
@media (max-width: 1199px) {
  .portfolio-section {
    padding: 60px 0;
  }
  
  .portfolio-section .section-header {
    margin-bottom: 50px;
  }
  
  .portfolio-grid {
    max-width: 1000px;
  }
}

/* Tablet Portrait (768px - 1023px) */
@media (max-width: 1023px) {
  .portfolio-section {
    padding: 50px 0;
  }
  
  .portfolio-section .container {
    padding: 0 16px;
  }
  
  .portfolio-section .section-header {
    margin-bottom: 40px;
  }
  
  .portfolio-grid {
    gap: 18px;
  }
  
  .portfolio-image-container {
    aspect-ratio: 1/1;
  }
  
  .lightbox-navigation {
    padding: 0 20px;
  }
  
  .lightbox-prev,
  .lightbox-next {
    width: 50px;
    height: 50px;
    font-size: 1.1rem;
  }
}

/* Mobile Large (640px - 767px) */
@media (max-width: 767px) {
  .portfolio-section {
    padding: 40px 0;
  }
  
  .portfolio-section .section-header {
    margin-bottom: 30px;
  }
  
  .portfolio-grid {
    gap: 16px;
  }
  
  .portfolio-item {
    border-radius: 12px;
  }
  
  .portfolio-image-container {
    aspect-ratio: 4/5;
  }
  
  .gallery-button-container {
    margin-top: 40px;
  }
  
  .gallery-button-container .btn {
    padding: 14px 28px;
    font-size: 1rem;
  }
  
  .lightbox-container {
    padding: 20px 15px;
  }
  
  .lightbox-close {
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .lightbox-content {
    border-radius: 15px;
  }
  
  .lightbox-info {
    padding: 20px;
  }
  
  .lightbox-title {
    font-size: 1.2rem;
  }
  
  .lightbox-description {
    font-size: 0.9rem;
  }
}

/* Mobile Small (≤639px) */
@media (max-width: 639px) {
  .portfolio-section .container {
    padding: 0 12px;
  }
  
  .portfolio-grid {
    gap: 14px;
  }
  
  .portfolio-item {
    border-radius: 10px;
  }
  
  .portfolio-item:hover {
    transform: translateY(-4px);
  }
  
  .portfolio-section .section-badge {
    padding: 8px 20px;
    font-size: 13px;
  }
  
  .gallery-button-container .btn {
    padding: 12px 24px;
    font-size: 0.95rem;
    gap: 8px;
  }
  
  .lightbox-navigation {
    padding: 0 10px;
  }
  
  .lightbox-prev,
  .lightbox-next {
    width: 45px;
    height: 45px;
    font-size: 1rem;
  }
}

/* ===================================== */
/* PERFORMANCE OPTIMIZATIONS */
/* ===================================== */

/* Hardware Acceleration */
.portfolio-item,
.portfolio-img,
.lightbox-modal,
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  will-change: transform;
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
  .portfolio-item,
  .portfolio-img,
  .gallery-button-container .btn,
  .lightbox-modal,
  .lightbox-close,
  .lightbox-prev,
  .lightbox-next {
    transition: none;
  }
  
  .portfolio-item:hover {
    transform: none;
  }
  
  .portfolio-item:hover .portfolio-img {
    transform: none;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .portfolio-item {
    border: 2px solid #000;
  }
  
  .portfolio-section .section-badge {
    background: #000;
    color: #fff;
  }
  
  .gallery-button-container .btn {
    background: #000;
    border: 2px solid #000;
  }
}

/* ===================================== */
/* FOCUS STATES FOR ACCESSIBILITY */
/* ===================================== */

.portfolio-item:focus-within {
  outline: 3px solid #e91e63;
  outline-offset: 2px;
}

.gallery-button-container .btn:focus {
  outline: 3px solid #e91e63;
  outline-offset: 2px;
}

.lightbox-close:focus,
.lightbox-prev:focus,
.lightbox-next:focus {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* ===================================== */
/* LOADING STATES */
/* ===================================== */

.portfolio-item.loading {
  opacity: 0.7;
  pointer-events: none;
}

.portfolio-item.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #e91e63;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  transform: translate(-50%, -50%);
  z-index: 10;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===================================== */
/* DARK MODE SUPPORT (Optional) */
/* ===================================== */

@media (prefers-color-scheme: dark) {
  .portfolio-section {
    background: linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 100%);
  }
  
  .portfolio-item {
    background: #2d2d2d;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }
  
  .portfolio-section .section-title {
    color: #fff;
  }
  
  .portfolio-section .section-subtitle {
    color: #ccc;
  }
  
  .lightbox-content {
    background: #2d2d2d;
  }
  
  .lightbox-title {
    color: #fff;
  }
  
  .lightbox-description {
    color: #ccc;
  }
}

/* ===================================== */
/* END OPTIMIZED PORTFOLIO CSS */
/* ===================================== */