/* =====================================
   Short Drama Website - Integrated Custom Styles File
   Contains: Font Configuration, UI Styles, Animation Effects, Layout Styles
   ===================================== */

/* ===== Font Configuration - IMDB Style ===== */
/* IMDB-like font configuration */
:root {
  --font-primary: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-secondary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

body {
  font-family: var(--font-primary);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Typography improvements - IMDB style */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* Navigation and UI elements */
nav, .nav, .menu {
  font-family: var(--font-primary);
  font-weight: 500;
}

/* Content text - Set normal font weight */
p, span, div {
  font-family: var(--font-primary);
  font-weight: 400; /* Set to normal weight */
}

/* Links should be normal weight unless specified */
a {
  font-family: var(--font-primary);
  font-weight: 400;
}

/* Button styling like IMDB */
button, .btn {
  font-family: var(--font-primary);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* IMDB-style font weights */
.font-light {
  font-weight: 300;
}

.font-regular {
  font-weight: 400;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

/* Specific improvements for readability */
.text-sm {
  font-size: 0.875rem;
  line-height: 1.4;
  font-weight: 400;
}

.text-base {
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 400;
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.5;
  font-weight: 400;
}

/* IMDB-style improvements */
.imdb-title {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.imdb-subtitle {
  font-weight: 500;
  opacity: 0.9;
}

.imdb-description {
  line-height: 1.7;
  font-weight: 400;
}

/* Rating and metadata styling */
.rating, .meta {
  font-weight: 500;
  font-size: 0.9rem;
}

/* Normal text weight for common elements */
li, td, th, label, input, textarea, select {
  font-weight: 400;
}

/* Ensure crisp text rendering on all devices */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Navigation and Page Layout Styles ===== */
#sticky-header {
    transition: transform 0.3s ease-in-out;
    transform: translateY(-100%);
}

#sticky-header.sticky {
    transform: translateY(0);
}

.neon-text {
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.2),
        0 0 16px rgba(255, 255, 255, 0.2), 0 0 24px rgba(255, 192, 203, 0.1),
        0 0 32px rgba(255, 105, 180, 0.1);
}

/* ===== Button Animation Effects ===== */
button[data-modal-target="trailer-modal"] svg {
    animation: pulse-play 1.5s infinite;
}

@keyframes pulse-play {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* ===== Search Results Styles ===== */
#search-results-desktop {
    max-width: 300px;
    overflow-x: hidden;
}

#search-results-mobile {
    max-width: 100%;
    overflow-x: hidden;
}

#search-results-desktop a,
#search-results-mobile a {
    text-decoration: none;
    color: inherit;
}

#search-results-desktop a:hover,
#search-results-mobile a:hover {
    background-color: #f3f4f6;
}

.dark #search-results-desktop a:hover,
.dark #search-results-mobile a:hover {
    background-color: #374151;
}

/* ===== Notification and Tooltip Styles ===== */
#toast-container > div {
    -moz-box-shadow: 0 0 2px #999999;
    -webkit-box-shadow: 0 0 2px #999999;
    box-shadow: 0 0 2px #999999;
}

[x-cloak] {
    display: none !important;
}

/* ===== Image Lazy Loading Styles ===== */
img.lozad {
    opacity: 0;
    transition: opacity 0.3s ease;
    object-fit: cover;
}

.lozad.loaded {
    opacity: 1;
}

/* Style du placeholder */
img.lozad[src*="data:image/svg"] {
    height: 100%;
}

/* Fade in animation for lazy loaded images */
.fade-in {
    opacity: 1 !important;
    transition: opacity 0.5s ease-in-out;
}

/* ===== Media Player Styles ===== */
@media screen and (max-width: 768px) {
    .plyr__volume input[type=range]{
        display: none;
    }
}

/* Video player common styles */
.video-player {
    max-height: 85vh;
    width: 100%;
    object-fit: contain;
}

/* Video container 16:9 aspect ratio */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

/* ===== Swiper Carousel Styles ===== */
.trending-dramas {
    margin-left: auto;
    margin-right: auto;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.swiper-button-prev,
.swiper-button-next {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    box-shadow: 1px 4px 10px 0 rgba(42, 44, 50, .16);
    background-color: #fff;
    color: #757A84;
    font-weight: 700;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    color: #FA320A;
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 16px;
}

.swiper-slide-duplicate .description,
.swiper-slide-duplicate .title,
.swiper-slide .description,
.swiper-slide .title {
  display: block;
  opacity: 0;
  transition: 0.5s ease 0.5s;
}

.swiper-slide-duplicate-active .description,
.swiper-slide-duplicate-active .title,
.swiper-slide-active .description,
.swiper-slide-active .title {
  opacity: 1;
}

.swiper-slide-duplicate-active .title,
.swiper-slide-active .title {
  margin-bottom: 0.5rem;
  font-size: 24px;
  color: #fff;
  transition: opacity 0.5s ease 0.5s;
}

.swiper-slide-duplicate-active .description,
.swiper-slide-active .description {
  font-size: 16px;
  color: #fff;
  transition: opacity 0.5s ease 0.75s;
}

/* ===== Image Gallery Styles ===== */
.gallery-top {
  height: 55vh;
}

@media screen and (max-width: 768px) {
  .gallery-top {
    height: 40vh;
  }
}

.gallery-thumbs {
  height: 55vh;
}

.gallery-thumbs .swiper-wrapper {
  flex-direction: row;
}

@media (min-width: 480px) {
  .gallery-thumbs .swiper-wrapper {
    flex-direction: column;
  }
}

.gallery-thumbs .swiper-slide {
  width: 25%;
  flex-flow: row nowrap;
  height: 100%;
  opacity: 0.75;
  cursor: pointer;
}

@media (min-width: 480px) {
  .gallery-thumbs .swiper-slide {
    flex-flow: column nowrap;
    width: 100%;
  }
}

.gallery-thumbs .swiper-slide-thumb-active {
  opacity: 1;
}

.gallery-thumbs .swiper-slide-thumb-active .drama-title{
    color: #dc2626;
    font-weight: bold;
}

.gallery-thumbs .swiper-slide-thumb-active .drama-summary{
    color: #2a2c32;
}

/* ===== Shadow and Background Styles ===== */
.shadow-sm{
    box-shadow: rgba(28, 28, 30, 0.06) 0px 0px 28px 0px;
    -webkit-box-shadow: rgba(28, 28, 30, 0.06) 0px 0px 28px 0px;
}

/* Background image styles */
.bg-login {
    background-image: url('/assets/images/bg_login.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.bg-placeholder {
    background-color: #3434358a;
}

.bg-gray-placeholder {
    background-color: #f3f4f6;
}

/* ===== Rating and Progress Bar Styles ===== */
.rating-display {
    font-size: 1rem;
    font-weight: 400;
}

/* Progress bar styles */
.progress-bar-custom {
    height: 2.5px;
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* ===== Text Truncation Utility Classes ===== */
.line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.line-clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

/* ===== Scrollbar Styles ===== */
.scrollbar-none {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.scrollbar-none::-webkit-scrollbar {
    display: none;
}

/* Thumbnail container styles */
.thumbnail-slider-container {
    height: calc(100% - 30px);
    overflow: hidden;
}

/* ===== Form and Input Styles ===== */
.form-control-custom {
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control-custom:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.25);
}

/* ===== Modal and Popup Styles ===== */
.modal-content-custom {
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ===== Hide/Show Utility Classes ===== */
.hidden-custom {
    display: none !important;
}

.block-custom {
    display: block !important;
}

/* ===== File Preview Styles ===== */
.thumbnail-preview {
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.thumbnail-preview:hover {
    opacity: 0.8;
}

/* Image preview */
.image-preview {
    max-height: 400px;
    max-width: 100%;
    object-fit: contain;
}

/* Video preview */
.video-preview {
    max-height: 400px;
    max-width: 100%;
}

/* ===== Loading Indicator ===== */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Card and Layout Styles ===== */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ===== Admin Panel Special Styles ===== */
.admin-preview-container {
    max-height: 400px;
    overflow-y: auto;
}

.admin-color-preview {
    width: 40px;
    height: 40px;
    border-radius: 0.375rem;
    border: 2px solid #e5e7eb;
}

.admin-image-preview {
    height: 120px;
    object-fit: cover;
    border-radius: 0.375rem;
}

/* File manager styles */
.file-manager-input {
    max-width: 350px;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none;
    }
    
    .mobile-full-width {
        width: 100%;
    }
}

@media (min-width: 769px) {
    .desktop-hidden {
        display: none;
    }
}

/* ===== Print Styles ===== */
@media print {
    .no-print {
        display: none !important;
    }
}

/* ===== Accessibility Styles ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus style improvements */
.focus-visible:focus {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

/* Fix Swiper Container Width Issue */
.flex-1.relative {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden;
}

.hero-slider {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.hero-slider .swiper-wrapper {
    width: 100% !important;
    transform: translate3d(0px, 0px, 0px) !important;
}

.hero-slider .swiper-slide {
    width: 100% !important;
    flex-shrink: 0 !important;
    display: block !important;
}

/* Hero Slider Navigation */
.hero-nav-btn {
    background: rgba(0, 0, 0, 0.6) !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    margin-top: -20px !important;
    color: white !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(4px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    z-index: 10 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    position: absolute !important;
}

.hero-nav-btn:hover {
    background: rgba(0, 0, 0, 0.8) !important;
    color: rgb(220, 38, 38) !important;
    transform: scale(1.1);
    border-color: rgba(220, 38, 38, 0.3);
}

.hero-nav-btn:after {
    font-size: 14px !important;
    font-weight: 600 !important;
}

.hero-slider .swiper-slide {
    pointer-events: none;
}

.hero-slider .swiper-slide-active {
    pointer-events: auto !important;
    z-index: 10 !important;
}

.hero-slider .swiper-slide:not(.swiper-slide-active) {
    pointer-events: none !important;
    z-index: 1 !important;
}

.hero-slider.swiper-container-fade .swiper-slide {
    pointer-events: none;
}

.hero-slider.swiper-container-fade .swiper-slide-active {
    pointer-events: auto;
}

/* Ensure arrow buttons are not blocked by other elements */
.swiper-button-next.hero-nav-btn {
    right: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.swiper-button-prev.hero-nav-btn {
    left: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Ensure arrow icons are visible */
.hero-nav-btn:after {
    position: static !important;
    line-height: 1 !important;
}

/* Thumbnail Container */
.thumbnail-slider-container::-webkit-scrollbar {
    width: 4px;
}

.thumbnail-slider-container::-webkit-scrollbar-track {
    background: transparent;
}

.thumbnail-slider-container::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 2px;
}

.thumbnail-slider-container::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .thumbnail-slider-container {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 12px;
        padding-bottom: 8px;
    }
    
    .thumbnail-item {
        flex-shrink: 0;
        width: 280px;
    }
    
    .space-y-3 {
        display: flex;
        gap: 12px;
    }
    
    .space-y-3 > * + * {
        margin-top: 0;
    }
}

@media (max-width: 768px) {
    .hero-nav-btn {
        width: 35px !important;
        height: 35px !important;
        margin-top: -17px !important;
    }
    
    .hero-nav-btn:after {
        font-size: 12px !important;
    }
}

/* Utility Classes */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Enhanced animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-slider .swiper-slide-active .max-w-md > * {
    animation: slideIn 0.6s ease-out forwards;
}

/* Loading state */
.swiper-container.swiper-container-initialized .swiper-slide:not(.swiper-slide-visible) img {
    filter: blur(2px);
    transition: filter 0.3s ease;
}

.swiper-container.swiper-container-initialized .swiper-slide.swiper-slide-visible img {
    filter: none;
}

.explore-dropdown {
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.explore-dropdown a {
    transition: all 0.15s ease-in-out;
}

.explore-dropdown a:hover {
    background-color: #f8fafc;
    color: #1f2937;
    padding-left: 1.25rem;
}

.dropdown-arrow {
    transition: transform 0.2s ease-in-out;
}

.dropdown-open .dropdown-arrow {
    transform: rotate(180deg);
}

@media (max-width: 1024px) {
    .mobile-explore-menu {
        background-color: rgba(0, 0, 0, 0.05);
        border-left: 3px solid #3b82f6;
    }
}

/* Active thumbnail styling */
[data-slide].active {
    background: white !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aspect-\[4\/3\] {
    aspect-ratio: 4 / 3;
}