/* Styles dành cho chức năng đăng nhập/đăng ký và hiệu ứng */

/* Auth Modal Styles */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: none;
    z-index: 1000;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.auth-container {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 450px;
    margin: 2rem;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    animation: modalFadeIn 0.5s forwards;
}

.auth-modal.active .auth-container {
    transform: translateY(0);
}

.auth-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.auth-tabs {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-tab {
    font-weight: 600;
    color: var(--text-medium);
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.auth-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.auth-close {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-medium);
    transition: color 0.2s ease;
}

.auth-close:hover {
    color: var(--primary);
}

.auth-body {
    padding: 2rem;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: formFadeIn 0.3s forwards;
}

.auth-form h3 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--primary);
}

/* User dropdown styles */
.user-menu {
    position: relative;
}

.user-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: background-color 0.2s ease;
}

.user-name:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--white);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius);
    min-width: 180px;
    z-index: 10;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: all 0.3s ease;
}

.user-dropdown.active {
    opacity: 1;
    transform: translateY(5px);
    pointer-events: all;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.user-dropdown-item:hover {
    background-color: var(--gray-100);
    color: var(--primary);
}

.user-dropdown-item i {
    font-size: 1.25rem;
    color: var(--primary);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--gray-200);
    margin: 0.5rem 0;
}

/* Advanced Footer Styles */
.footer {
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-light), var(--accent), var(--primary-light));
    background-size: 200% 100%;
    animation: gradientMove 3s linear infinite;
}

.footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--white);
    transition: width 0.3s ease;
}

.footer a:hover::after {
    width: 100%;
}

/* Ripple effect for buttons */
.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

/* Animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes formFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Fade-in animation for sections */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animation classes for cards */
.card-hidden {
    opacity: 0;
    transform: translateY(30px);
}

.card-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Cart modal with improved animation */
.cart-modal {
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-modal.active {
    opacity: 1;
}

.cart-container {
    animation: slideIn 0.3s forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Product hover effects */
.product-card {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.product-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-light);
    z-index: 1;
}

.product-image img {
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

/* Modern form inputs */
input, select, textarea {
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.25);
}

/* Payment Success Modal */
.payment-success-modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.payment-success-modal.show {
    opacity: 1;
    visibility: visible;
}

.payment-success-modal .modal-content {
    background-color: #fff;
    margin: auto;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 500px;
    text-align: center;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.payment-success-modal.show .modal-content {
    transform: translateY(0);
}

.payment-success-modal .close-button {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #aaa;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
}

.payment-success-modal .close-button:hover,
.payment-success-modal .close-button:focus {
    color: #333;
    text-decoration: none;
    cursor: pointer;
}

.payment-success-modal .success-icon {
    font-size: 70px;
    color: #28a745; /* Green color for success */
    margin-bottom: 20px;
}

.payment-success-modal h2 {
    font-size: 2.2em;
    color: #333;
    margin-bottom: 15px;
}

.payment-success-modal p {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 30px;
}

.payment-success-modal .btn-primary {
    padding: 12px 30px;
    font-size: 1.1em;
    border-radius: 5px;
}