/* User Authentication & Shopping UI Styles */

/* ===== HEADER UPDATES ===== */
.auth-buttons {
    display: flex;
    gap: 10px;
}

.signup-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #D84A6B 100%);
    color: white !important;
}

.signup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 21, 56, 0.3);
}

.user-account {
    position: relative;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-primary, #333);
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.user-dropdown a:last-child {
    border-bottom: none;
    color: #e74c3c;
}

.user-dropdown a:hover {
    background: #f8f9fa;
    padding-left: 25px;
}

.user-dropdown i {
    font-size: 16px;
    width: 20px;
}

/* ===== AUTH MODALS ===== */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.auth-modal.active {
    opacity: 1;
    visibility: visible;
}

.auth-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.4s ease;
    position: relative;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-auth {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.close-auth:hover {
    color: #e74c3c;
    transform: rotate(90deg);
}

.auth-header {
    text-align: center;
    padding: 50px 40px 30px;
    border-bottom: 1px solid #f0f0f0;
}

.auth-header i {
    font-size: 48px;
    color: var(--primary-color, #8B1538);
    margin-bottom: 20px;
}

.auth-header h2 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.auth-header p {
    color: #7f8c8d;
    font-size: 14px;
}

.auth-modal form {
    padding: 30px 40px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 14px;
}

.form-group label i {
    margin-right: 8px;
    color: var(--primary-color, #8B1538);
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color, #8B1538);
    box-shadow: 0 0 0 3px rgba(139, 21, 56, 0.1);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #2c3e50;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.forgot-link {
    color: var(--primary-color, #8B1538);
    font-size: 14px;
    text-decoration: none;
}

.forgot-link:hover {
    text-decoration: underline;
}

.btn-auth {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color, #8B1538) 0%, #D84A6B 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 21, 56, 0.3);
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 21, 56, 0.4);
}

.btn-auth i {
    margin-right: 8px;
}

.auth-footer {
    text-align: center;
    padding: 0 40px 40px;
    color: #7f8c8d;
    font-size: 14px;
}

.auth-footer a {
    color: var(--primary-color, #8B1538);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ===== FORM VALIDATION STYLES ===== */
.form-group {
    position: relative;
    margin-bottom: 24px;
}

.form-group.error input {
    border-color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.02);
}

.form-group.success input {
    border-color: #27ae60;
}

.error-message {
    display: block;
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    min-height: 18px; /* Prevent layout shift */
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-group.success .error-message {
    display: none;
}

/* Form Error Banner */
.form-error-banner {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #c0392b;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

.form-error-banner i {
    font-size: 16px;
    color: #e74c3c;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loading State for Buttons */
.btn-auth.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-auth.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== SIDEBAR PANELS (WISHLIST & CART) ===== */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-panel {
    position: fixed;
    top: 0;
    right: -450px;
    width: 420px;
    max-width: 90vw;
    height: 100%;
    background: white;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.4s ease;
}

.sidebar-panel.active {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 2px solid #f0f0f0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.sidebar-header h3 {
    font-size: 20px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header i {
    font-size: 22px;
    color: var(--primary-color, #8B1538);
}

.close-sidebar {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-sidebar:hover {
    color: #e74c3c;
    transform: rotate(90deg);
}

.sidebar-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.empty-message {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

.empty-message i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.wishlist-item,
.cart-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    margin-bottom: 16px;
    background: white;
    transition: all 0.2s ease;
}

.wishlist-item:hover,
.cart-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color, #8B1538);
}

.wishlist-item img,
.cart-item img {
    width: 80px;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
}

.item-details {
    flex: 1;
}

.item-details h4 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-details p {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 8px;
}

.item-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color, #8B1538);
}

.item-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: 1px solid #e1e8ed;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--primary-color, #8B1538);
    color: white;
    border-color: var(--primary-color, #8B1538);
}

.btn-remove {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-remove:hover {
    transform: scale(1.2);
}

.item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.item-quantity button {
    width: 30px;
    height: 30px;
    border: 1px solid #e1e8ed;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.item-quantity button:hover {
    background: var(--primary-color, #8B1538);
    color: white;
    border-color: var(--primary-color, #8B1538);
}

.item-quantity span {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
}

.sidebar-footer {
    padding: 20px;
    border-top: 2px solid #f0f0f0;
    background: #f8f9fa;
}

.cart-footer {
    padding: 24px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-bottom: 16px;
    border-bottom: 2px solid #e1e8ed;
    font-size: 18px;
}

.cart-total strong {
    font-size: 24px;
    color: var(--primary-color, #8B1538);
}

.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color, #8B1538) 0%, #D84A6B 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 21, 56, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 21, 56, 0.4);
}

.btn-secondary {
    background: white;
    color: #2c3e50;
    border: 2px solid #e1e8ed;
    margin-top: 12px;
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: var(--primary-color, #8B1538);
}

.btn-block {
    display: block;
    width: 100%;
}

/* ===== BOOK CARD ACTION BUTTONS ===== */
.book-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0.6;
    transform: translateX(0);
    transition: all 0.3s ease;
    z-index: 10;
}

.book-card:hover .book-actions {
    opacity: 1;
    transform: translateX(0);
}

.btn-wishlist,
.btn-cart {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 18px;
    backdrop-filter: blur(10px);
}

.btn-wishlist {
    color: #e74c3c;
}

.btn-wishlist:hover {
    background: #e74c3c;
    color: white;
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5), 0 3px 10px rgba(231, 76, 60, 0.3);
    border-color: #e74c3c;
}

.btn-wishlist.active {
    background: #e74c3c;
    color: white;
}

.btn-wishlist.active i {
    font-weight: 900;
}

.btn-cart {
    color: var(--primary-color, #8B1538);
}

.btn-cart:hover {
    background: var(--primary-color, #8B1538);
    color: white;
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(139, 21, 56, 0.5), 0 3px 10px rgba(139, 21, 56, 0.3);
    border-color: var(--primary-color, #8B1538);
}

.btn-wishlist i,
.btn-cart i {
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-buttons {
        gap: 8px;
    }

    .auth-buttons .action-btn span {
        display: none;
    }

    .sidebar-panel {
        width: 100%;
        right: -100%;
    }

    .auth-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .auth-modal form {
        padding: 20px 24px;
    }

    .auth-header {
        padding: 40px 24px 24px;
    }

    .book-actions {
        opacity: 1;
        transform: translateX(0);
    }

    .btn-wishlist,
    .btn-cart {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}