/**
 * BloomScroll Favorites System Styles
 * Beautiful, modern, conversion-optimized styling
 */

/* ==================== */
/* Heart Button & Controls */
/* ==================== */

.favorite-controls {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    margin-bottom: 16px;
    font-family: 'Berkeley Mono', 'SF Mono', 'Monaco', monospace;
}

.favorite-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-family: 'Berkeley Mono', 'SF Mono', 'Monaco', monospace;
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.favorite-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.favorite-btn:active {
    transform: scale(0.98);
}

.favorite-btn.favorited {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    color: #667eea;
}

.heart-icon {
    font-size: 16px;
    transition: transform 0.2s ease;
    display: inline-block;
}

.favorite-btn:hover .heart-icon {
    transform: scale(1.1);
}

.favorite-btn.favorited .heart-icon {
    animation: pulse 0.4s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.heart-text {
    font-weight: 400;
    font-size: 11px;
}

.ripple-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.favorite-btn:active .ripple-effect {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    to {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* View Favorites Button */
.view-favorites-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-family: 'Berkeley Mono', 'SF Mono', 'Monaco', monospace;
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.view-favorites-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.favorites-count {
    background: rgba(102, 126, 234, 0.3);
    color: #667eea;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 400;
    min-width: 18px;
    text-align: center;
}

.favorites-text {
    font-weight: 400;
    font-size: 11px;
}

/* Floating counter removed - not needed */

/* ==================== */
/* Favorites Gallery Modal */
/* ==================== */

.favorites-modal,
.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.favorites-modal.open,
.cart-modal.open {
    opacity: 1;
    visibility: visible;
}

.modal-content,
.cart-content {
    background: #0A0A0A;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.2s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
    font-family: 'Berkeley Mono', 'SF Mono', 'Monaco', monospace;
}

.favorites-modal.open .modal-content,
.cart-modal.open .cart-content {
    transform: scale(1) translateY(0);
}

.modal-header,
.cart-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
}

.modal-title,
.cart-title {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    font-family: 'Berkeley Mono', 'SF Mono', 'Monaco', monospace;
}

.title-icon {
    font-size: 28px;
}

.modal-close,
.cart-close,
.cart-back {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 4px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.modal-close:hover,
.cart-close:hover,
.cart-back:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Modal Subheader */
.modal-subheader {
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
}

.collection-stats {
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    margin: 0;
}

.stat-count {
    color: white;
    font-weight: 700;
    font-size: 18px;
}

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

.select-mode-btn,
.cart-checkout-btn {
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.select-mode-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.select-mode-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.cart-checkout-btn {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    border: 1px solid #667eea;
}

.cart-checkout-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(240, 147, 251, 0.3);
}

.cart-checkout-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Filter Bar */
.filter-bar {
    padding: 16px 32px;
    display: flex;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-chip {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.filter-chip.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.sort-dropdown {
    margin-left: auto;
}

.sort-select {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

/* Favorites Grid */
.favorites-grid {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

/* Favorite Card */
.favorite-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.favorite-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.favorites-modal.select-mode .card-checkbox {
    opacity: 1;
}

.select-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.card-image {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    background: rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 50%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.favorite-card:hover .card-overlay {
    opacity: 1;
}

.card-action {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-action:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.card-action span {
    font-size: 10px;
    font-family: 'Berkeley Mono', 'SF Mono', 'Monaco', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-info {
    padding: 12px;
}

.card-name {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-date {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin: 0 0 8px 0;
}

.card-rating {
    display: flex;
    gap: 2px;
}

.star {
    color: rgba(255, 255, 255, 0.2);
    font-size: 14px;
}

.star.filled {
    color: #ffd700;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    font-family: 'Berkeley Mono', 'SF Mono', 'Monaco', monospace;
}

.empty-state h3 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 16px 0;
}

.empty-state p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin: 0 0 24px 0;
    font-weight: 300;
}

.close-modal-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-family: 'Berkeley Mono', 'SF Mono', 'Monaco', monospace;
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-modal-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Modal footer removed - not needed */

/* ==================== */
/* Cart Modal Styles */
/* ==================== */

.cart-content {
    width: 90%;
    max-width: 900px;
}

.cart-steps {
    display: flex;
    padding: 20px 32px;
    gap: 24px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.step.active {
    opacity: 1;
}

.step.completed {
    opacity: 0.8;
}

.step-number {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.step.completed .step-number {
    background: #4caf50;
}

.step-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
}

.step.active .step-label {
    color: white;
}

/* Cart Body */
.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.cart-step-content {
    display: none;
}

.cart-step-content.active {
    display: block;
}

.step-title {
    color: white;
    font-size: 20px;
    margin: 0 0 24px 0;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.product-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.product-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-4px);
}

.product-card.selected {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

.product-card.featured {
    background: linear-gradient(145deg, rgba(240, 147, 251, 0.1), rgba(245, 87, 108, 0.1));
}

.best-seller-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.product-mockup {
    position: relative;
    width: 100%;
    height: 150px;
    margin-bottom: 16px;
}

.product-mockup img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-preview {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
}

.bloom-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.product-name {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.product-price {
    color: #667eea;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px 0;
}

.product-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.feature {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
}

.product-select-btn {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-select-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.product-select-btn.selected {
    background: #667eea;
    border-color: transparent;
}

/* Cart Footer */
.cart-footer {
    padding: 24px 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-continue-btn {
    padding: 14px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.cart-continue-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.cart-continue-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cart-continue-btn.primary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.continue-icon {
    font-size: 18px;
}

.security-badges {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.badge {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ==================== */
/* Toast Notifications */
/* ==================== */

.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 24px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 100000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
}

/* ==================== */
/* Loading Spinner */
/* ==================== */

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== */
/* Responsive Design */
/* ==================== */

@media (max-width: 768px) {
    .modal-content,
    .cart-content {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .favorites-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
        padding: 16px;
    }

    .product-grid {
        grid-template-columns: 1fr 1fr;
    }

    .cart-steps {
        padding: 16px;
        gap: 12px;
    }

    .step-label {
        display: none;
    }

    .favorite-controls {
        flex-direction: column;
    }
}

/* ==================== */
/* Animations Entry */
/* ==================== */

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

@keyframes savePulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
}

@keyframes fadeOut {
    0% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0) rotate(-30deg);
        opacity: 0;
    }
}

/* Dark mode optimizations */
@media (prefers-color-scheme: dark) {
    .modal-content,
    .cart-content {
        background: linear-gradient(145deg, #0a0a0f 0%, #000000 100%);
    }
}