/*
 * Vòng Quay May Mắn - Stylesheet
 * Author: VQMM Developer
 * Version: 1.0.0
 * Created: 2025-03-21
 */

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

/* Header & Navigation */
.navbar-brand img {
    transition: transform 0.3s ease;
}

.navbar-brand img:hover {
    transform: scale(1.05);
}

.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.navbar-brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

.nav-link:hover {
    transform: translateY(-2px);
}

ul#item-list, .result-table tbody {
    max-height: 250px;
    overflow: auto;
}

/* Cụ thể hóa và tăng cường style cho tbody#history */
tbody#history {
    display: block;
    max-height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
}

/* Đảm bảo các hàng trong bảng history vẫn hiển thị đúng */
.result-table thead, .result-table tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

/* Hiệu ứng hover cho hàng lịch sử */
tbody#history tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
    cursor: pointer;
}

/* Style cho thanh tìm kiếm */
.history-search-wrapper {
    position: relative;
    margin-bottom: 10px;
}

.history-search-wrapper input {
    padding-right: 40px;
    border-radius: 20px;
    border: 1px solid #ced4da;
    padding: 8px 15px;
    font-size: 0.9rem;
    width: 100%;
}

.history-search-wrapper .search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* Style cho bộ lọc và nút xóa */
.history-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.history-date-filter {
    flex: 1;
    margin-right: 10px;
}

.history-date-filter select {
    width: 100%;
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid #ced4da;
    font-size: 0.9rem;
}

.history-action-buttons {
    display: flex;
    gap: 8px;
}

.history-action-buttons button {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-action-buttons button i {
    margin-right: 4px;
}

/* Hiển thị khi không có kết quả tìm kiếm */
.no-results-message {
    padding: 15px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* Thiết lập responsive cho khung tìm kiếm/lọc */
@media (max-width: 576px) {
    .history-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .history-date-filter {
        width: 100%;
        margin-right: 0;
    }
    
    .history-action-buttons {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Wheel Section */
#wheel-container {
    position: relative;
    margin: 30px auto;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1; /* Ensure proper stacking for confetti */
}

#wheel {
    display: block;
    margin: 0 auto;
    width: 400px;
    height: 400px;
    box-sizing: content-box;
    border-radius: 50%;
    border: 8px solid #ff7f00;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

/* Pointer Container */
.pointer-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 10;
}

/* Wheel Pointer */
.wheel-pointer {
    margin-top: -5px; /* Điều chỉnh vị trí con trỏ */
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
    animation: pointer-pulse 1.5s infinite;
}

@keyframes pointer-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

#spin-btn {
    padding: 10px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s;
}

#spin-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* QR and Logo Section */
.qr-container, .logo-container {
    background-color: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    height: 100%;
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.qr-container:hover, .logo-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.qr-code, .sponsor-logo {
    margin: 15px auto;
    display: block;
    transition: transform 0.3s ease;
}

.qr-code:hover, .sponsor-logo:hover {
    transform: scale(1.03);
}

/* Partner Logos */
.partner-logo {
    max-width: 100%;
    height: auto;
    max-height: 70px;
    padding: 10px;
    filter: grayscale(20%);
    transition: all 0.3s ease;
}

.partner-logo:hover {
    filter: grayscale(0%);
    transform: scale(1.1);
}

/* Sponsors Carousel */
.sponsors-carousel {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 15px 0;
    background: white;
    margin: 0 auto;
    backface-visibility: hidden; /* Prevent flickering during animation */
}

/* Gradient overlays for fade effect */
.sponsors-gradient-left,
.sponsors-gradient-right {
    position: absolute;
    top: 0;
    width: 80px;
    height: 100%;
    z-index: 2;
    pointer-events: none; /* Allow clicks to pass through */
}

.sponsors-gradient-left {
    left: 0;
    background: linear-gradient(to right, white 20%, rgba(255, 255, 255, 0));
}

.sponsors-gradient-right {
    right: 0;
    background: linear-gradient(to left, white 20%, rgba(255, 255, 255, 0));
}

.sponsors-track {
    display: flex;
    width: 200%; /* Twice the width to create infinite loop illusion */
    animation: scroll 40s linear infinite; /* Adjusted to a bit slower for better readability */
    will-change: transform; /* Performance optimization */
    position: relative;
    z-index: 1;
}

.sponsor-item {
    flex: 0 0 calc(100% / 12); /* 12 items in total (6 original, 6 duplicated) */
    min-width: calc(100% / 12);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 15px;
    transform: translateZ(0); /* Force hardware acceleration */
}

.sponsor-item img {
    filter: grayscale(20%);
    transition: all 0.5s ease;
    max-height: 170px;
    width: auto;
    object-fit: cover;
    max-width: 100%;
}

.sponsor-item:hover img {
    filter: grayscale(0%);
    transform: scale(1.1);
}

@keyframes scroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%); /* Move to the half-way point */
    }
}

/* Pause animation on hover with smooth transition */
.sponsors-carousel:hover .sponsors-track {
    animation-play-state: paused;
}

/* For devices that support it, use a smoother animation timing function */
@supports (animation-timing-function: cubic-bezier(0.1, 0, 0.9, 1)) {
    .sponsors-track {
        animation-timing-function: linear; /* Keep linear for most consistent scrolling */
    }
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .sponsor-item {
        flex: 0 0 calc(100% / 8); /* 4 visible at a time on tablets */
        min-width: calc(100% / 8);
    }
    
    .sponsors-track {
        animation-duration: 35s; /* Slightly faster on tablets */
    }
    
    .sponsors-gradient-left,
    .sponsors-gradient-right {
        width: 60px; /* Narrower gradients on smaller screens */
    }
}

@media (max-width: 768px) {
    .sponsor-item {
        flex: 0 0 calc(100% / 6); /* 3 visible at a time on smaller tablets */
        min-width: calc(100% / 6);
    }
    
    .sponsors-track {
        animation-duration: 30s; /* Even faster on smaller screens */
    }
    
    .sponsor-item img {
        max-height: 60px;
    }
    
    .sponsors-gradient-left,
    .sponsors-gradient-right {
        width: 40px;
    }
    
    /* Tăng tốc độ trên thiết bị di động */
    @keyframes scroll {
        from { transform: translateX(0); }
        to { transform: translateX(-50%); }
    }
}

@media (max-width: 576px) {
    .sponsor-item {
        flex: 0 0 calc(100% / 4); /* 2 visible at a time on mobile */
        min-width: calc(100% / 4);
    }
    
    .sponsors-track {
        animation-duration: 25s; /* Fastest on mobile */
    }
    
    .sponsor-item img {
        max-height: 50px;
    }
    
    .sponsors-gradient-left,
    .sponsors-gradient-right {
        width: 30px; /* Even narrower gradients on very small screens */
    }
}

/* Footer Icons Section */
.footer-icons-section {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.footer-content ul {
    margin-bottom: 0;
}

.footer-content li {
    display: inline-block;
    padding: 0 10px;
    transition: transform 0.3s ease;
}

.footer-content li:hover {
    transform: translateY(-5px);
}

.footer-content img {
    max-height: 50px;
    width: auto;
}

.footer-img-wow {
    animation: pulse-wow 2.5s infinite;
}

@keyframes pulse-wow {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Card Styles */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* List Group Styles */
.list-group-item {
    border-left: none;
    border-right: none;
    padding: 0.75rem 1.25rem;
    transition: background-color 0.2s;
}

.list-group-item:first-child {
    border-top: none;
}

.list-group-item:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.remove-item {
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
}

.remove-item:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Table Styles */
.table th {
    background-color: #f8f9fa;
    font-weight: 500;
}

.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

/* Rules Section */
#rules .card-header {
    border-radius: 10px 10px 0 0;
}

#rules ol {
    padding-left: 1.5rem;
}

#rules li {
    margin-bottom: 0.75rem;
}

#rules li:last-child {
    margin-bottom: 0;
}

/* Footer Styles */
footer {
    background-color: #f8f9fa;
    color: #212529;
}

footer h5 {
    font-weight: 600;
    margin-bottom: 1.2rem;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #0d6efd;
    text-decoration: underline;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #e9ecef;
    color: #495057;
    transition: all 0.3s;
}

.social-icons a:hover {
    background-color: #0d6efd;
    color: white;
}

.payment-methods img {
    transition: all 0.3s;
}

.payment-methods img:hover {
    transform: scale(1.1);
}

.app-download {
    text-align: center;
}

.bottom-footer {
    background: black;
    padding: 20px 0;
    background-image: url(https://file.hstatic.net/200000264467/file/footer-background_a6405e16a18c49c4a06da201efb22013.png);
    background-size: contain;
    background-position: right;
    background-repeat: no-repeat;
}

.bottom-footer p {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Win Animation */
@keyframes celebrate {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.celebrating {
    animation: celebrate 0.5s ease-in-out;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    #wheel {
        width: 300px;
        height: 300px;
        border-width: 6px;
    }
    
    .qr-container, .logo-container {
        margin-bottom: 15px;
        padding: 15px;
    }
    
    .payment-methods img {
        max-height: 35px !important;
    }
    
    .footer-content img {
        max-height: 40px;
    }
    
    .col-md-6 {
        margin-bottom: 20px;
    }
    
    .card {
        margin-bottom: 20px;
    }
    
    /* Thêm khoảng cách cho phần rules */
    #rules ol {
        padding-left: 1.2rem;
    }
    
    /* Điều chỉnh kích thước logo trong footer */
    .col-md-6.text-md-end {
        text-align: center !important;
        align-items: center !important;
        margin-top: 15px;
    }
}

@media (max-width: 576px) {
    #wheel {
        width: 250px;
        height: 250px;
        border-width: 5px;
    }
    
    #spin-btn {
        font-size: 1rem;
        padding: 8px 20px;
    }
    
    h4 {
        font-size: 1.3rem;
    }
    
    h5 {
        font-size: 1.1rem;
    }
    
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .card-header {
        padding: 0.75rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .wheel-pointer {
        width: 25px;
        height: 35px;
    }
    
    /* Cải thiện thanh điều hướng mobile */
    .navbar-brand img {
        height: 40px;
    }
    
    /* Giảm padding của các section */
    .py-4 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    /* Cải thiện phần payment methods */
    .payment-methods {
        justify-content: center;
    }
    
    /* Cải thiện khoảng cách giữa các section */
    .mt-5 {
        margin-top: 2rem !important;
    }
    
    /* Footer icons cải thiện */
    .footer-content li {
        margin: 0 5px 10px;
    }
    
    /* Partner logos */
    .partner-logo {
        max-height: 50px !important;
    }
}

@media (max-width: 991px) {
    .navbar-brand {
        position: relative;
        left: auto;
        transform: none;
        margin: 0 auto;
    }
    
    .navbar-collapse {
        text-align: center;
        margin-top: 15px;
    }
    
    /* Điều chỉnh layout nút quay và danh sách */
    .row > .col-md-6 {
        max-width: 100%;
    }
    
    /* Cải thiện kích thước app download */
    .app-download {
        max-width: 100px;
    }
    
    /* Căn giữa phần logo và thương hiệu trên mobile */
    .text-md-end {
        display: flex;
        justify-content: center;
        margin-top: 1rem;
    }
}

/* Fix lỗi overflow trên mobile */
html, body {
    overflow-x: hidden;
    width: 100%;
}

/* Tùy chỉnh hiển thị trên màn hình siêu nhỏ */
@media (max-width: 400px) {
    #wheel {
        width: 220px;
        height: 220px;
        border-width: 4px;
    }
    
    #spin-btn {
        font-size: 0.9rem;
        padding: 6px 15px;
    }
    
    .payment-methods img {
        max-height: 30px !important;
        margin-right: 8px !important;
    }
}

/* SweetAlert Fullscreen Styles */
.swal-fullscreen-popup {
    border-radius: 0 !important;
    padding: 20px !important;
    background-color: rgba(255, 255, 255, 0.95) !important;
    max-width: 100% !important;
    margin: 0 !important;
    height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    border: none !important;
    box-shadow: none !important;
}

.swal-fullscreen-title {
    font-size: 2.5rem !important;
    margin-bottom: 30px !important;
    font-weight: bold !important;
    color: #FF6384 !important;
}

.swal-fullscreen-content {
    font-size: 1.5rem !important;
    margin-bottom: 30px !important;
    color: #333 !important;
}

.swal-fullscreen-content b {
    font-size: 2rem !important;
    color: #FF6384 !important;
    font-weight: bold !important;
    display: block !important;
    margin: 20px 0 !important;
}

.swal-fullscreen-button {
    font-size: 1.2rem !important;
    padding: 12px 40px !important;
    border-radius: 0 !important;
    background-color: #36A2EB !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.3s ease !important;
}

.swal-fullscreen-button:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3) !important;
    background-color: #2F95D0 !important;
}

/* Responsive fixes for fullscreen popup */
@media (max-width: 768px) {
    .swal-fullscreen-title {
        font-size: 2rem !important;
        margin-bottom: 20px !important;
    }
    
    .swal-fullscreen-content {
        font-size: 1.2rem !important;
    }
    
    .swal-fullscreen-content b {
        font-size: 1.6rem !important;
        margin: 15px 0 !important;
    }
    
    .swal-fullscreen-button {
        font-size: 1rem !important;
        padding: 10px 30px !important;
    }
}

@media (max-width: 576px) {
    .swal-fullscreen-title {
        font-size: 1.8rem !important;
        margin-bottom: 15px !important;
    }
    
    .swal-fullscreen-content {
        font-size: 1rem !important;
    }
    
    .swal-fullscreen-content b {
        font-size: 1.4rem !important;
        margin: 10px 0 !important;
    }
} 