/**
 * Album Frontend CSS
 * 
 * @package MinhTriCore
 * @subpackage Album
 * @since 1.0.0
 */

/* ======================================
   Album Gallery Styles
   ====================================== */

.album-gallery {
  margin: 20px 0;
  position: relative;
}

/* Grid Layout */
.album-gallery-grid {
  display: grid;
  gap: 15px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.album-gallery-grid.columns-2 {
  grid-template-columns: repeat(2, minmax(300px, 1fr));
}

.album-gallery-grid.columns-3 {
  grid-template-columns: repeat(3, minmax(250px, 1fr));
}

.album-gallery-grid.columns-4 {
  grid-template-columns: repeat(4, minmax(200px, 1fr));
}

.album-gallery-grid.columns-5 {
  grid-template-columns: repeat(5, minmax(180px, 1fr));
}

/* Gallery Items */
.album-gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  background: #f8f9fa;
  margin-bottom: 0;
}

.album-gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.album-gallery-item a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.album-gallery-item img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

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

/* Image Captions */
.album-gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 30px 15px 15px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  font-size: 0.9rem;
  line-height: 1.4;
}

.album-gallery-item:hover .album-gallery-caption {
  transform: translateY(0);
}

/* ======================================
   Masonry Layout
   ====================================== */

.album-gallery-masonry {
  column-count: 3;
  column-gap: 15px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.album-gallery-masonry .album-gallery-item {
  display: inline-block;
  width: 100%;
  margin-bottom: 15px;
  break-inside: avoid;
}

.album-gallery-masonry .album-gallery-item img {
  height: auto;
  min-height: 200px;
}

/* ======================================
   Slider Layout
   ====================================== */

.album-gallery-slider {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
}

.album-gallery-slides {
  display: flex;
  transition: transform 0.5s ease;
  will-change: transform;
}

.album-gallery-slide {
  min-width: 100%;
  position: relative;
  background: #000;
}

.album-gallery-slide img {
  width: 100%;
  height: 400px;
  object-fit: contain;
  display: block;
}

.album-gallery-slide .album-gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 30px 20px 20px;
  transform: translateY(0);
}

/* Slider Controls */
.album-gallery-controls {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  padding: 15px 20px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-size: 18px;
  z-index: 10;
}

.album-gallery-controls:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.album-gallery-controls:focus {
  outline: 2px solid #007cba;
  outline-offset: 2px;
}

.album-gallery-prev {
  left: 15px;
}

.album-gallery-next {
  right: 15px;
}

/* Slider Dots */
.album-gallery-dots {
  text-align: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.8);
}

.album-gallery-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  margin: 0 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.album-gallery-dot:hover,
.album-gallery-dot.active {
  background: white;
  transform: scale(1.2);
}

/* ======================================
   Album List Styles
   ====================================== */

.album-list {
  display: grid;
  gap: 30px;
  margin: 30px 0;
}

.album-list.columns-1 {
  grid-template-columns: 1fr;
}

.album-list.columns-2 {
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.album-list.columns-3 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.album-list.columns-4 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.album-list-item {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.album-list-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.album-list-thumbnail {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.album-list-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.album-list-item:hover .album-list-thumbnail img {
  transform: scale(1.05);
}

.album-list-no-image {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  font-size: 2rem;
}

.album-list-content {
  padding: 20px;
}

.album-list-title {
  margin: 0 0 15px;
  font-size: 1.3rem;
}

.album-list-title a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.album-list-title a:hover {
  color: #007cba;
}

.album-list-excerpt {
  color: #666;
  line-height: 1.6;
  margin-bottom: 15px;
}

.album-list-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: #888;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

/* ======================================
   Loading States
   ====================================== */

.album-loading {
  text-align: center;
  padding: 40px;
  color: #666;
}

.album-loading::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #007cba;
  border-radius: 50%;
  border-top-color: transparent;
  animation: album-spin 1s linear infinite;
  margin-right: 10px;
  vertical-align: middle;
}

@keyframes album-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ======================================
   Error States
   ====================================== */

.album-error {
  text-align: center;
  padding: 40px;
  color: #dc3545;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  margin: 20px 0;
}

/* ======================================
   Responsive Design
   ====================================== */

@media (max-width: 1024px) {
  .album-gallery-masonry {
    column-count: 2;
  }

  .album-list.columns-3,
  .album-list.columns-4 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .album-gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2px;
  }

  .album-gallery-masonry {
    column-count: 1;
  }

  /* .album-gallery-item img {
    height: 200px;
  } */

  .album-gallery-slide img {
    height: 250px;
  }

  .album-gallery-controls {
    padding: 10px 15px;
    font-size: 16px;
  }

  .album-gallery-prev {
    left: 10px;
  }

  .album-gallery-next {
    right: 10px;
  }

  .album-list {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  .album-list-content {
    padding: 15px;
  }

  .album-list-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  /* .album-gallery-item img {
    height: 180px;
  } */

  .album-gallery-slide img {
    height: 200px;
  }

  .album-gallery-caption {
    padding: 20px 10px 10px;
    font-size: 0.8rem;
  }

  .album-gallery-controls {
    padding: 8px 12px;
    font-size: 14px;
  }

  .album-gallery-dot {
    width: 10px;
    height: 10px;
    margin: 0 4px;
  }
}

/* ======================================
   Album Archive & Taxonomy Shared Styles
   ====================================== */

/* Container */
.album-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Headers */
.album-header {
  text-align: center;
  padding: 20px;
  margin-bottom: 40px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
}

.album-header .header-title {
  font-size: 2.5rem;
  color: #333;
  margin: 0;
  font-weight: 700;
}

.album-header .header-description {
  font-size: 1.2rem;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.album-header .header-meta {
  color: #888;
  font-size: 1rem;
  margin-top: 15px;
}

/* Navigation */
.album-navigation {
  margin-bottom: 40px;
  padding: 25px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

.album-nav-container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  align-items: flex-start;
}

.album-nav-group {
  flex: 1;
}

.album-nav-group.sort-group {
  flex: 0;
  min-width: 300px;
}

.album-nav-label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.album-nav-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.album-nav-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #f8f9fa;
  color: #495057;
  text-decoration: none;
  border-radius: 20px;
  font-size: 14px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.album-nav-button .nav-count {
  font-size: 12px;
  opacity: 0.8;
}

.album-nav-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #f8f9fa;
  color: #495057;
  text-decoration: none;
  border-radius: 25px;
  transition: all 0.3s ease;
  font-size: 14px;
}

.album-nav-button:hover,
.album-nav-button.active,
.album-nav-all:hover {
  background: #007cba;
  color: white;
}

/* Results Info */
.album-results-info {
  margin-bottom: 25px;
  color: #666;
  font-size: 0.95rem;
}

/* Albums Grid */
.albums-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 60px;
}

.album-item {
  margin: 0;
}

.album-card {
  background: white;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

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

.album-thumbnail {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
}

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

.album-card:hover .album-thumbnail img {
  transform: scale(1.1);
}

.album-no-image {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  font-size: 3rem;
}

.album-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.3) 60%,
    rgba(0, 0, 0, 0.8) 100%
  );
  display: flex;
  align-items: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.album-card:hover .album-overlay {
  opacity: 1;
}

.album-overlay-content {
  color: white;
  width: 100%;
}

.album-card .album-overlay .album-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 8px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  color: #fff;
}

.album-overlay .album-count,
.album-overlay .album-date {
  display: block;
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 4px;
}

/* Album Card Content */
.album-card-content {
  padding: 25px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.album-card-title {
  margin: 0 0 15px;
  font-size: 1.4rem;
  line-height: 1.3;
}

.album-card-title a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.album-card-title a:hover {
  color: #007cba;
}

.album-card-excerpt {
  color: #666;
  line-height: 1.6;
  margin-bottom: 20px;
  flex: 1;
}

.album-card-meta {
  margin-top: auto;
}

.album-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-size: 0.9rem;
  color: #888;
}

.album-date,
.album-count {
  display: flex;
  align-items: center;
  gap: 6px;
}

.album-concepts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.album-concept-tag {
  padding: 4px 12px;
  background: #f8f9fa;
  color: #495057;
  text-decoration: none;
  border-radius: 15px;
  font-size: 13px;
  transition: all 0.3s ease;
}

.album-concept-tag:hover {
  background: #007cba;
  color: white;
}

/* Hover Overlay for Archive */
.album-hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 124, 186, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.album-card:hover .album-hover-overlay {
  opacity: 1;
}

.album-hover-content {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
}

/* Empty State */
.album-empty {
  text-align: center;
  padding: 80px 20px;
}

.album-empty-content {
  max-width: 400px;
  margin: 0 auto;
}

.album-empty-content .dashicons {
  font-size: 5rem;
  color: #ddd;
  margin-bottom: 25px;
}

.album-empty-content h3 {
  font-size: 1.8rem;
  color: #666;
  margin-bottom: 15px;
}

.album-empty-content p {
  color: #999;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 25px;
}

.album-empty-content .button {
  display: inline-block;
  padding: 12px 24px;
  background: #007cba;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.3s ease;
}

.album-empty-content .button:hover {
  background: #005a87;
}

/* Pagination */
.album-pagination {
  text-align: center;
  margin: 60px 0;
}

.album-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  padding: 5px 15px;
  margin: 0 2px;
  text-decoration: none;
  color: #666;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.album-pagination .page-numbers:hover,
.album-pagination .page-numbers.current {
  background: #007cba;
  color: white;
  border-color: #007cba;
}

.album-pagination .page-numbers.dots {
  background: transparent;
  border: none;
  color: #999;
}

.album-pagination .page-numbers.dots:hover {
  background: transparent;
  transform: none;
}

/* ======================================
   Archive Specific Styles
   ====================================== */

.album-archive-container .album-header .header-title {
  font-size: 2.5rem;
}

.album-archive-container .album-header .header-description {
  font-size: 1.2rem;
}

/* ======================================
   Responsive Design
   ====================================== */

@media (max-width: 1024px) {
  .albums-grid {
    grid-template-columns: repeat(auto-fill, auto);
    gap: 25px;
  }

  .album-nav-container {
    flex-direction: column;
    gap: 20px;
  }

  .album-nav-group {
    min-width: auto;
  }
}

@media (max-width: 768px) {
  .album-overlay {
    padding: 10px;
  }

  .album-container {
    padding: 0 15px;
  }

  .album-header .header-title {
    font-size: 2.5rem;
  }

  .concept-archive-container .album-header .header-title {
    font-size: 2rem;
  }

  .album-header .header-description {
    font-size: 1.1rem;
  }

  .album-navigation {
    padding: 20px;
  }

  .concept-archive-container .album-navigation {
    display: none;
  }

  .album-single .album-navigation .album-nav-previous,
  .album-single .album-navigation .album-nav-next {
    display: none;
  }
  .album-single .album-navigation .album-nav-links {
    justify-content: center;
  }

  .albums-grid,
  .concept-archive-container .albums-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
  }

  .album-card-content {
    padding: 20px;
  }

  .album-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .concept-archive-container .album-nav-container {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .concept-archive-container .album-nav-all {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .album-single .album-header {
    padding: 5px 0 30px !important;
  }

  .album-header .header-title {
    font-size: 2rem;
  }

  .concept-archive-container .album-header .header-title {
    font-size: 1.4rem;
  }

  .album-header {
    padding: 40px 20px;
  }

  .album-nav-buttons {
    justify-content: center;
  }

  .album-card-title {
    font-size: 1.2rem;
  }

  .album-header .header-description {
    font-size: 1rem;
  }
  .album-card .album-overlay .album-title {
    font-size: 1rem;
  }
  .album-overlay .album-count,
  .album-overlay .album-date {
    font-size: 0.8rem;
  }
}

/* ======================================
   Single Album Page Styles
   ====================================== */

/* Single Album Header Overrides */
.album-single .album-header {
  background: none;
  border-radius: 0;
  padding: 40px 0px 30px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: flex-start;
  text-align: left;
  flex-direction: column;
}

.album-single .album-header .album-thumbnail {
  flex: 0 0 30%;
  max-width: 500px;
}

/* Single Album Meta */
.album-single .album-meta {
  margin-bottom: 20px;
  font-size: 14px;
  color: #666;
}

.album-single .album-meta-label {
  font-weight: 600;
  margin-right: 8px;
}

.album-single .album-concepts,
.album-single .album-date,
.album-single .album-tags {
  margin: 10px 0;
  align-items: center;
  justify-content: flex-start;
}

.album-single .album-header .album-title {
  font-size: 2.5rem;
  margin: 15px 0 15px;
  color: #333;
  line-height: 1.2;
}

.album-single .album-excerpt {
  font-size: 1.1rem;
  color: #666;
  max-width: 800px;
  margin: 0 auto 20px;
  line-height: 1.6;
}

/* Single Album Content */
.album-single .album-content {
  margin-bottom: 50px;
}

.album-single .album-description {
  max-width: 800px;
  margin: 0 auto 40px;
  font-size: 1rem;
  line-height: 1.7;
  color: #333;
}

.album-single .album-gallery-section {
  margin: 40px 0;
}

.album-single .album-no-image {
  padding: 60px 20px;
  border-radius: 8px;
}

.album-single .album-nav-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.album-single .album-nav-link {
  text-decoration: none;
  color: #333;
  transition: color 0.3s ease;
}

.album-single .album-nav-link:hover {
  color: #007cba;
}

.album-single .album-nav-previous,
.album-single .album-nav-next {
  flex: 1;
}

.album-single .album-nav-next {
  text-align: right;
}

.album-single .album-nav-back {
  text-align: center;
}

.album-single .album-nav-direction {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 5px;
}

.album-single .album-nav-title {
  display: block;
  font-weight: 600;
}

/* Single Album Related Albums */
.album-single .album-related {
  margin-top: 50px;
}

.album-single .album-related-title {
  text-align: center;
  margin-bottom: 30px;
  font-size: 1.8rem;
  color: #333;
}

/* Single Album Responsive Design */
@media (max-width: 768px) {
  .album-single .album-title {
    font-size: 2rem;
  }

  .album-single .album-nav-links {
    gap: 15px;
  }

  .album-single .album-nav-previous,
  .album-single .album-nav-next {
    text-align: center;
  }
}

@media screen and (min-width: 768px) {
  .album-single .album-header {
    flex-direction: row;
  }
  .album-single .album-header .album-thumbnail {
    margin-right: 30px;
  }
  .album-single .album-header .album-title {
    margin: 0 0 15px;
  }
}

@media screen and (min-width: 1024px) {
  .album-single .album-header .album-thumbnail {
    flex: 0 0 50%;
    max-width: 500px;
  }
}

/* ======================================
   Print Styles
   ====================================== */

@media print {
  .album-gallery-controls,
  .album-gallery-dots,
  .album-navigation,
  .album-pagination {
    display: none;
  }

  .album-gallery-item,
  .album-card {
    break-inside: avoid;
    margin-bottom: 20px;
  }

  .album-gallery-caption,
  .album-overlay {
    position: static;
    background: #f8f9fa;
    color: #333;
    padding: 10px;
    transform: none;
    opacity: 1;
  }
}
