html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ==============================
   WINTER SKY - BAKEMATE THEME
   ============================== */

:root {
    --sky-blue: #DCEFFC;
    --snow-white: #F7FBFF;
    --ice-blue: #B8DDF3;
    --cloud-blue: #EAF3F8;
    --text-blue: #426780;
    --deep-blue: #315D7A;
}

/* Nền chung */
body {
    background-color: var(--snow-white);
    color: var(--text-blue);
    position: relative;
}

/* Thanh điều hướng */
.navbar {
    background-color: rgba(220, 239, 252, 0.96) !important;
    border-bottom: 1px solid #C5E1F2;
    box-shadow: 0 3px 12px rgba(93, 145, 177, 0.08);
}

.navbar .navbar-brand,
.navbar .nav-link {
    color: var(--deep-blue) !important;
    font-weight: 500;
}

.navbar .nav-link:hover {
    color: #75AFCF !important;
}

/* Tiêu đề */
h1, h2, h3 {
    color: var(--deep-blue);
}

/* Nút bấm */
.btn-primary {
    background-color: #8FC5E5;
    border-color: #8FC5E5;
    color: #183F59;
}

.btn-primary:hover {
    background-color: #6EADD3;
    border-color: #6EADD3;
    color: white;
}

/* Các khung nội dung */
.card {
    border: 1px solid #D8EAF5;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(93, 145, 177, 0.08);
}

/* Footer */
footer {
    background-color: #DCEFFC;
    color: var(--deep-blue) !important;
    border-top: 1px solid #C5E1F2 !important;
    padding: 18px 0;
    text-align: center;
    position: relative;
}

footer::before {
    content: "✿  ❄  ✿";
    display: block;
    color: #78ADD0;
    font-size: 17px;
    letter-spacing: 10px;
    margin-bottom: 8px;
}

/* ==============================
   SNOWFALL EFFECT
   ============================== */

.snowfall {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 9999;
}

.snowflake {
    position: absolute;
    top: -30px;
    color: #9CCDEB;
    opacity: 0.8;
    user-select: none;
    animation: snowfall linear infinite;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.9);
}

/* Vị trí, kích thước và tốc độ từng bông tuyết */
.snowflake:nth-child(1)  { left: 4%;  font-size: 14px; animation-duration: 11s; }
.snowflake:nth-child(2)  { left: 10%; font-size: 20px; animation-duration: 15s; animation-delay: -5s; }
.snowflake:nth-child(3)  { left: 17%; font-size: 12px; animation-duration: 12s; animation-delay: -8s; }
.snowflake:nth-child(4)  { left: 24%; font-size: 18px; animation-duration: 17s; animation-delay: -3s; }
.snowflake:nth-child(5)  { left: 31%; font-size: 13px; animation-duration: 13s; animation-delay: -9s; }
.snowflake:nth-child(6)  { left: 38%; font-size: 21px; animation-duration: 16s; animation-delay: -6s; }
.snowflake:nth-child(7)  { left: 45%; font-size: 15px; animation-duration: 12s; animation-delay: -2s; }
.snowflake:nth-child(8)  { left: 52%; font-size: 12px; animation-duration: 18s; animation-delay: -10s; }
.snowflake:nth-child(9)  { left: 59%; font-size: 19px; animation-duration: 14s; animation-delay: -4s; }
.snowflake:nth-child(10) { left: 66%; font-size: 13px; animation-duration: 11s; animation-delay: -7s; }
.snowflake:nth-child(11) { left: 73%; font-size: 17px; animation-duration: 16s; animation-delay: -2s; }
.snowflake:nth-child(12) { left: 80%; font-size: 12px; animation-duration: 13s; animation-delay: -9s; }
.snowflake:nth-child(13) { left: 87%; font-size: 20px; animation-duration: 15s; animation-delay: -5s; }
.snowflake:nth-child(14) { left: 94%; font-size: 14px; animation-duration: 12s; animation-delay: -6s; }

@keyframes snowfall {
    0% {
        transform: translate3d(0, -30px, 0) rotate(0deg);
    }
    50% {
        transform: translate3d(25px, 50vh, 0) rotate(180deg);
    }
    100% {
        transform: translate3d(-15px, 105vh, 0) rotate(360deg);
    }
}

/* Tôn trọng cài đặt giảm chuyển động của người dùng */
@media (prefers-reduced-motion: reduce) {
    .snowflake {
        animation: none;
        display: none;
    }
}

.footer-flowers {
    color: #79B4D6;
    font-size: 20px;
    letter-spacing: 8px;
    margin-bottom: 8px;
}

.footer-caption {
    color: #83A9C0;
    font-size: 12px;
    font-style: italic;
    margin-top: 6px;
}

/* ==============================
   HOME PAGE (HERO & GENRES)
   ============================== */

.hero-banner {
    background: linear-gradient(135deg, #1c3d52 0%, #2f5f7e 50%, #5694bc 100%);
    box-shadow: 0 16px 36px rgba(28, 61, 82, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
}

.hero-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.15), transparent 60%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.genre-card {
    background: #ffffff;
    border: 1px solid #dcebf5;
    transition: all 0.28s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.genre-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(49, 93, 122, 0.14) !important;
    border-color: #8fc5e5 !important;
    background: #f7fbff;
}

.genre-card .genre-icon {
    transition: transform 0.3s ease;
}

.genre-card:hover .genre-icon {
    transform: scale(1.2);
}

.movie-new-badge {
    background: rgba(25, 135, 84, 0.88);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 5px 9px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}


/* Brand Logo */
.brand-logo {
    transition: transform 0.3s ease;
    display: inline-block;
}

.navbar-brand:hover .brand-logo {
    transform: rotate(-10deg) scale(1.15);
}

/* Page Header */
.page-title-section {
    text-align: center;
    padding: 1.5rem 0 2rem;
}

.page-title-section h2 {
    font-weight: 700;
    color: var(--deep-blue);
    margin-bottom: 0.35rem;
}

.page-subtitle {
    color: #6c8fa3;
    font-size: 0.95rem;
}

/* Movie Card Box */
.movie-card {
    background: #ffffff;
    border: 1px solid #dcebf5;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1),
                box-shadow 0.3s cubic-bezier(0.165, 0.84, 0.44, 1),
                border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.movie-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px rgba(49, 93, 122, 0.16) !important;
    border-color: #8fc5e5;
}

/* Movie Poster Image Box - Đảm bảo kích thước đồng đều 100% */
.movie-poster-box {
    position: relative;
    width: 100%;
    height: 280px;
    background: #eaf3f8;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.movie-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.movie-card:hover .movie-poster {
    transform: scale(1.06);
}

/* Badges on Poster */
.movie-genre-badge {
    background: rgba(49, 93, 122, 0.88);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-weight: 500;
    font-size: 0.75rem;
    padding: 5px 11px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.movie-rated-badge {
    background: rgba(220, 53, 69, 0.88);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 5px 9px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Card Body Content */
.movie-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    text-align: center;
    flex-grow: 1;
}

.movie-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--deep-blue);
    margin-bottom: 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.movie-meta {
    font-size: 0.82rem;
    color: #7997aa;
    margin-bottom: 0.5rem;
}

.movie-price-tag {
    display: inline-block;
    background: #fff6e5;
    color: #d97706;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px dashed #fbd38d;
    margin-bottom: 0.65rem;
}

.movie-summary-text {
    font-size: 0.86rem;
    color: #5c7f95;
    line-height: 1.4;
    min-height: 2.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

/* Card Action Buttons */
.movie-card-actions {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #edf4f9;
}

.btn-buy-movie {
    background: linear-gradient(135deg, #74b4db 0%, #478ebd 100%);
    border: none;
    color: #ffffff !important;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 10px;
    transition: all 0.25s ease;
    box-shadow: 0 3px 8px rgba(71, 142, 189, 0.25);
}

.btn-buy-movie:hover {
    background: linear-gradient(135deg, #5ba4d1 0%, #35759e 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(71, 142, 189, 0.35);
}

.btn-buy-movie:active {
    transform: scale(0.97);
}

/* Action button micro-interactions */
.movie-actions-group .btn {
    border-radius: 8px;
    font-size: 0.82rem;
    padding: 4px 10px;
    transition: all 0.2s ease;
}

.movie-actions-group .btn:hover {
    transform: translateY(-2px);
}

.movie-actions-group .btn:active {
    transform: scale(0.95);
}

/* =========================================
   SEARCH & FILTER BAR RESPONSIVE
   ========================================= */

.filter-search-card {
    background: #ffffff;
    border: 1px solid #dcebf5;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(49, 93, 122, 0.06);
    padding: 1.25rem;
}

.search-input-box {
    max-width: 560px;
    margin: 0 auto;
}

.genre-filter-scroll {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.genre-pill-btn {
    white-space: nowrap;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 16px;
    transition: all 0.2s ease;
    text-decoration: none;
    flex-shrink: 0;
}

.genre-pill-btn:hover {
    transform: translateY(-2px);
}

@media (max-width: 767.98px) {
    .filter-search-card {
        padding: 1rem;
        border-radius: 16px;
    }

    .genre-filter-scroll {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }

    .genre-filter-scroll::-webkit-scrollbar {
        display: none;
    }

    .genre-pill-btn {
        padding: 5px 13px;
        font-size: 0.82rem;
    }
}

/* =========================================
   RESPONSIVE OPTIMIZATION (MOBILE & TABLET)
   ========================================= */

@media (max-width: 767.98px) {
    .page-title-section {
        padding: 1rem 0 1.25rem;
    }

    .page-title-section h2 {
        font-size: 1.35rem;
    }

    .movie-poster-box {
        height: 250px;
    }

    .movie-card-body {
        padding: 1rem;
    }

    .card {
        border-radius: 14px;
    }

    .table th, .table td {
        white-space: nowrap;
    }
}

@media (max-width: 575.98px) {
    .movie-poster-box {
        height: 230px;
    }

    .movie-title {
        font-size: 1.05rem;
    }

    .movie-price-tag {
        font-size: 0.95rem;
        padding: 3px 10px;
    }

    .navbar-brand {
        font-size: 0.88rem !important;
    }
}
