/**
 * GuruTV - Professional Magazine Styles
 * Optimized for immersive magazine reading experience
 */

/* ============================================
   MAGAZINE LISTING VIEW
   ============================================ */

.magazine-listing-view {
   padding: 2rem 0 4rem 0;
   min-height: 100vh;
}

.magazine-header {
   text-align: center;
   margin-bottom: 3rem;
   padding: 2rem 1rem;
   background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
   border-radius: 24px;
   backdrop-filter: blur(10px);
}

.magazine-header h1 {
   font-size: 2.5rem;
   font-weight: 800;
   background: linear-gradient(135deg, #6366f1, #8b5cf6);
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   margin: 0 0 0.5rem 0;
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 1rem;
}

.magazine-header p {
   color: var(--color-text-muted);
   font-size: 1.1rem;
   margin: 0;
}

.magazine-grid {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
   gap: 2rem;
   margin-bottom: 3rem;
}

.magazine-card {
   background: rgba(255, 255, 255, 0.03);
   border-radius: 16px;
   overflow: hidden;
   cursor: pointer;
   transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
   border: 1px solid rgba(255, 255, 255, 0.1);
   backdrop-filter: blur(10px);
}

.magazine-card:hover {
   transform: translateY(-8px);
   box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
   border-color: rgba(99, 102, 241, 0.5);
}

.magazine-cover {
   position: relative;
   width: 100%;
   padding-bottom: 141.4%;
   /* A4 aspect ratio */
   background: linear-gradient(135deg, #1a1a2e, #16213e);
   overflow: hidden;
}

.magazine-cover img {
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   object-fit: cover;
}

.magazine-overlay {
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
   display: flex;
   align-items: center;
   justify-content: center;
   opacity: 0;
   transition: opacity 0.3s ease;
   font-size: 1.2rem;
   font-weight: 600;
   color: white;
   gap: 0.5rem;
}

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

.magazine-info {
   padding: 1.25rem;
}

.magazine-title {
   font-size: 1.1rem;
   font-weight: 700;
   color: var(--color-text);
   margin: 0 0 0.75rem 0;
   line-height: 1.4;
   display: -webkit-box;
   -webkit-line-clamp: 2;
   -webkit-box-orient: vertical;
   overflow: hidden;
}

.magazine-meta {
   display: flex;
   align-items: center;
   gap: 1rem;
   font-size: 0.85rem;
   color: var(--color-text-muted);
}

.magazine-meta span {
   display: flex;
   align-items: center;
   gap: 0.4rem;
}

.pagination-container {
   display: flex;
   justify-content: center;
   align-items: center;
   gap: 0.5rem;
   margin-top: 3rem;
}

.pagination-btn {
   padding: 0.75rem 1.25rem;
   background: rgba(255, 255, 255, 0.05);
   border: 1px solid rgba(255, 255, 255, 0.1);
   border-radius: 10px;
   color: var(--color-text);
   cursor: pointer;
   transition: all 0.2s ease;
   font-weight: 600;
}

.pagination-btn:hover:not(.active) {
   background: rgba(99, 102, 241, 0.2);
   border-color: rgba(99, 102, 241, 0.5);
   transform: translateY(-2px);
}

.pagination-btn.active {
   background: linear-gradient(135deg, #6366f1, #8b5cf6);
   color: white;
   border-color: transparent;
}

.pagination-ellipsis {
   color: var(--color-text-muted);
   padding: 0 0.5rem;
}

/* ============================================
   SINGLE MAGAZINE VIEW - HERO SECTION
   ============================================ */

.single-magazine-view {
   padding: 0;
   min-height: 100vh;
}

.magazine-hero {
   position: relative;
   padding: 3rem 0;
   background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(22, 33, 62, 0.95));
   border-bottom: 2px solid rgba(99, 102, 241, 0.3);
   overflow: hidden;
}

.magazine-hero::before {
   content: '';
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   background:
      radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
      radial-gradient(circle at 80% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
   pointer-events: none;
}

.magazine-hero-content {
   position: relative;
   display: grid;
   grid-template-columns: 400px 1fr;
   gap: 3rem;
   align-items: start;
   max-width: 1400px;
   margin: 0 auto;
   padding: 0 2rem;
}

.magazine-cover-showcase {
   position: sticky;
   top: 2rem;
}

.magazine-cover-image {
   width: 100%;
   border-radius: 16px;
   box-shadow:
      0 20px 60px rgba(0, 0, 0, 0.4),
      0 0 0 1px rgba(255, 255, 255, 0.1);
   transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
   animation: fadeInScale 0.6s ease-out;
}

@keyframes fadeInScale {
   from {
      opacity: 0;
      transform: scale(0.9) translateY(20px);
   }

   to {
      opacity: 1;
      transform: scale(1) translateY(0);
   }
}

.magazine-cover-image:hover {
   transform: scale(1.02) translateY(-4px);
   box-shadow:
      0 30px 80px rgba(0, 0, 0, 0.5),
      0 0 0 1px rgba(99, 102, 241, 0.3);
}

.magazine-hero-details {
   padding-top: 1rem;
}

.magazine-back-btn {
   display: inline-flex;
   align-items: center;
   gap: 0.5rem;
   padding: 0.75rem 1.5rem;
   background: rgba(255, 255, 255, 0.05);
   border: 1px solid rgba(255, 255, 255, 0.1);
   border-radius: 12px;
   color: var(--color-text);
   font-weight: 600;
   cursor: pointer;
   transition: all 0.2s ease;
   margin-bottom: 2rem;
}

.magazine-back-btn:hover {
   background: rgba(99, 102, 241, 0.2);
   border-color: rgba(99, 102, 241, 0.5);
   transform: translateX(-4px);
}

.single-magazine-title {
   font-size: 2.5rem;
   font-weight: 800;
   color: var(--color-text);
   margin: 0 0 1.5rem 0;
   line-height: 1.2;
   animation: fadeInUp 0.6s ease-out 0.1s both;
}

@keyframes fadeInUp {
   from {
      opacity: 0;
      transform: translateY(20px);
   }

   to {
      opacity: 1;
      transform: translateY(0);
   }
}

.magazine-metadata-grid {
   display: grid;
   grid-template-columns: auto;
   gap: 1rem;
   margin-bottom: 2rem;
   animation: fadeInUp 0.6s ease-out 0.2s both;
   max-width: 250px;
}

.metadata-card {
   background: rgba(255, 255, 255, 0.05);
   backdrop-filter: blur(10px);
   border: 1px solid rgba(255, 255, 255, 0.1);
   border-radius: 12px;
   padding: 1rem;
   display: flex;
   flex-direction: column;
   gap: 0.5rem;
}

.metadata-label {
   font-size: 0.75rem;
   text-transform: uppercase;
   letter-spacing: 0.05em;
   color: var(--color-text-muted);
   font-weight: 600;
}

.metadata-value {
   font-size: 1.1rem;
   font-weight: 700;
   color: var(--color-text);
   display: flex;
   align-items: center;
   gap: 0.5rem;
}

.magazine-keywords {
   margin-bottom: 2rem;
   animation: fadeInUp 0.6s ease-out 0.3s both;
}

.magazine-keywords h3 {
   font-size: 0.9rem;
   text-transform: uppercase;
   letter-spacing: 0.05em;
   color: var(--color-text-muted);
   margin: 0 0 0.75rem 0;
   font-weight: 600;
}

.keywords-list {
   display: flex;
   flex-wrap: wrap;
   gap: 0.5rem;
}

.keyword-badge {
   padding: 0.5rem 1rem;
   background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
   border: 1px solid rgba(99, 102, 241, 0.3);
   border-radius: 20px;
   color: var(--color-text);
   font-size: 0.85rem;
   font-weight: 600;
   transition: all 0.2s ease;
}

.keyword-badge:hover {
   background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.3));
   transform: translateY(-2px);
}

.magazine-share-section {
   animation: fadeInUp 0.6s ease-out 0.4s both;
}

.share-label {
   font-size: 0.9rem;
   text-transform: uppercase;
   letter-spacing: 0.05em;
   color: var(--color-text-muted);
   margin-bottom: 0.75rem;
   display: block;
   font-weight: 600;
}

.share-buttons {
   display: flex;
   gap: 0.75rem;
   flex-wrap: wrap;
}

.share-btn {
   width: 48px;
   height: 48px;
   border: none;
   border-radius: 12px;
   cursor: pointer;
   transition: all 0.2s ease;
   font-weight: 600;
   display: flex;
   align-items: center;
   justify-content: center;
   font-size: 1.2rem;
}

.share-btn:hover {
   transform: translateY(-3px);
   box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.share-btn.facebook {
   background: #1877f2;
   color: white;
}

.share-btn.twitter {
   background: #000000;
   color: white;
}

.share-btn.whatsapp {
   background: #25d366;
   color: white;
}

.share-btn.telegram {
   background: #0088cc;
   color: white;
}

.share-btn.copy {
   background: rgba(255, 255, 255, 0.1);
   color: var(--color-text);
   border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ============================================
   PDF VIEWER SECTION
   ============================================ */

.magazine-pdf-section {
   padding: 3rem 0;
   background: var(--color-background);
}

.magazine-pdf-container {
   max-width: 1400px;
   margin: 0 auto;
   padding: 0 2rem;
}

.pdf-viewer-header {
   display: flex;
   justify-content: space-between;
   align-items: center;
   margin-bottom: 2rem;
   padding: 1.5rem;
   background: rgba(255, 255, 255, 0.03);
   border-radius: 16px;
   border: 1px solid rgba(255, 255, 255, 0.1);
}

.pdf-viewer-title {
   font-size: 1.3rem;
   font-weight: 700;
   color: var(--color-text);
   display: flex;
   align-items: center;
   gap: 0.75rem;
}

.pdf-controls {
   display: flex;
   gap: 1rem;
}

.pdf-control-btn {
   padding: 0.75rem 1.5rem;
   background: rgba(255, 255, 255, 0.05);
   border: 1px solid rgba(255, 255, 255, 0.1);
   border-radius: 10px;
   color: var(--color-text);
   cursor: pointer;
   transition: all 0.2s ease;
   font-weight: 600;
   display: flex;
   align-items: center;
   gap: 0.5rem;
}

.pdf-control-btn:hover {
   background: linear-gradient(135deg, #6366f1, #8b5cf6);
   color: white;
   border-color: transparent;
   transform: translateY(-2px);
}

.pdf-viewer-wrapper {
   position: relative;
   border-radius: 16px;
   overflow: hidden;
   box-shadow:
      0 20px 60px rgba(0, 0, 0, 0.3),
      0 0 0 1px rgba(255, 255, 255, 0.1);
   background: #525659;
}

.magazine-pdf-frame {
   width: 100%;
   height: 900px;
   border: none;
   display: block;
}

/* Fullscreen Mode */
.pdf-fullscreen-overlay {
   position: fixed;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   background: rgba(0, 0, 0, 0.98);
   z-index: 10000;
   display: none;
   flex-direction: column;
   animation: fadeIn 0.3s ease;
}

.pdf-fullscreen-overlay.active {
   display: flex;
}

.pdf-fullscreen-header {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 1rem 2rem;
   background: rgba(0, 0, 0, 0.8);
   border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pdf-fullscreen-title {
   color: white;
   font-weight: 600;
   font-size: 1.1rem;
}

.pdf-fullscreen-close {
   padding: 0.75rem 1.5rem;
   background: rgba(220, 38, 38, 0.2);
   border: 1px solid rgba(220, 38, 38, 0.5);
   border-radius: 8px;
   color: white;
   cursor: pointer;
   transition: all 0.2s ease;
   font-weight: 600;
   display: flex;
   align-items: center;
   gap: 0.5rem;
}

.pdf-fullscreen-close:hover {
   background: #dc2626;
   transform: scale(1.05);
}

.pdf-fullscreen-content {
   flex: 1;
   overflow: hidden;
}

.pdf-fullscreen-frame {
   width: 100%;
   height: 100%;
   border: none;
}

/* ============================================
   RELATED MAGAZINES CAROUSEL
   ============================================ */

.related-magazines-section {
   padding: 4rem 0;
   background: linear-gradient(135deg, rgba(26, 26, 46, 0.5), rgba(22, 33, 62, 0.5));
}

.related-magazines-header {
   text-align: center;
   margin-bottom: 2rem;
}

.related-magazines-header h3 {
   font-size: 2rem;
   font-weight: 800;
   background: linear-gradient(135deg, #6366f1, #8b5cf6);
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   margin: 0 0 0.5rem 0;
}

.related-magazines-header p {
   color: var(--color-text-muted);
   font-size: 1rem;
}

.related-carousel-wrapper {
   position: relative;
   max-width: 1400px;
   margin: 0 auto;
   padding: 0 4rem;
}

.related-magazines-carousel {
   display: flex;
   gap: 2rem;
   overflow-x: auto;
   scroll-behavior: smooth;
   padding: 1rem 0;
   scrollbar-width: none;
}

.related-magazines-carousel::-webkit-scrollbar {
   display: none;
}

.related-magazine-card {
   flex: 0 0 280px;
   background: rgba(255, 255, 255, 0.03);
   border-radius: 16px;
   overflow: hidden;
   cursor: pointer;
   transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
   border: 1px solid rgba(255, 255, 255, 0.1);
}

.related-magazine-card:hover {
   transform: translateY(-8px);
   box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
   border-color: rgba(99, 102, 241, 0.5);
}

.related-thumb {
   position: relative;
   width: 100%;
   padding-bottom: 141.4%;
   background: linear-gradient(135deg, #1a1a2e, #16213e);
   overflow: hidden;
}

.related-thumb img {
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   object-fit: cover;
}

.related-thumb i {
   position: absolute;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
   font-size: 3rem;
   color: rgba(220, 38, 38, 0.5);
}

.related-info {
   padding: 1.25rem;
}

.related-info h4 {
   font-size: 1rem;
   font-weight: 700;
   color: var(--color-text);
   margin: 0 0 0.5rem 0;
   line-height: 1.4;
   display: -webkit-box;
   -webkit-line-clamp: 2;
   -webkit-box-orient: vertical;
   overflow: hidden;
}

.related-date {
   font-size: 0.85rem;
   color: var(--color-text-muted);
   display: flex;
   align-items: center;
   gap: 0.4rem;
}

.carousel-nav-btn {
   position: absolute;
   top: 50%;
   transform: translateY(-50%);
   width: 50px;
   height: 50px;
   border-radius: 50%;
   background: rgba(99, 102, 241, 0.9);
   border: none;
   color: white;
   cursor: pointer;
   transition: all 0.2s ease;
   display: flex;
   align-items: center;
   justify-content: center;
   font-size: 1.2rem;
   z-index: 10;
   box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.carousel-nav-btn:hover {
   background: #6366f1;
   transform: translateY(-50%) scale(1.1);
}

.carousel-nav-btn.prev {
   left: 0;
}

.carousel-nav-btn.next {
   right: 0;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
   .magazine-hero-content {
      grid-template-columns: 1fr;
      gap: 2rem;
   }

   .magazine-cover-showcase {
      position: relative;
      top: 0;
      max-width: 400px;
      margin: 0 auto;
   }

   .single-magazine-title {
      font-size: 2rem;
   }
}

@media (max-width: 768px) {
   .magazine-grid {
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 1.5rem;
   }

   .magazine-header h1 {
      font-size: 2rem;
   }

   .single-magazine-title {
      font-size: 1.75rem;
   }

   .magazine-metadata-grid {
      grid-template-columns: repeat(2, 1fr);
   }

   .magazine-pdf-frame {
      height: 600px;
   }

   .related-carousel-wrapper {
      padding: 0 3rem;
   }

   .pdf-controls {
      flex-direction: column;
      gap: 0.5rem;
   }

   .pdf-control-btn {
      width: 100%;
      justify-content: center;
   }
}

@media (max-width: 480px) {
   .magazine-hero {
      padding: 2rem 0;
   }

   .magazine-hero-content {
      padding: 0 1rem;
   }

   .magazine-cover-showcase {
      max-width: 100%;
   }

   .single-magazine-title {
      font-size: 1.5rem;
   }

   .metadata-card {
      padding: 0.75rem;
   }

   .share-buttons {
      justify-content: center;
   }

   .magazine-pdf-container {
      padding: 0 1rem;
   }

   .magazine-pdf-frame {
      height: 500px;
   }

   .related-carousel-wrapper {
      padding: 0 2rem;
   }

   .carousel-nav-btn {
      width: 40px;
      height: 40px;
      font-size: 1rem;
   }
}

/* Loading Spinner */
.loading-spinner {
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 0.75rem;
   padding: 3rem;
   font-size: 1.1rem;
   color: var(--color-text-muted);
}

.loading-spinner i {
   font-size: 2rem;
   color: #6366f1;
   animation: spin 1s linear infinite;
}

@keyframes spin {
   from {
      transform: rotate(0deg);
   }

   to {
      transform: rotate(360deg);
   }
}

/* No Results */
.no-results {
   text-align: center;
   padding: 4rem 2rem;
   color: var(--color-text-muted);
   font-size: 1.1rem;
}

.error {
   text-align: center;
   padding: 4rem 2rem;
   color: #dc2626;
   font-size: 1.1rem;
}