/* BoxNode Store - Component Styles */

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100vh;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.98) 0%, rgba(17, 24, 39, 0.95) 100%);
    backdrop-filter: blur(12px);
    border-left: 2px solid rgba(96, 165, 250, 0.2);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
    animation: slideInCart 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-sidebar.closing {
    animation: slideOutCart 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes slideInCart {
    from {
        right: -400px;
        opacity: 0.8;
    }
    to {
        right: 0;
        opacity: 1;
    }
}

@keyframes slideOutCart {
    from {
        right: 0;
        opacity: 1;
    }
    to {
        right: -400px;
        opacity: 0.8;
    }
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.cart-header h3 {
    font-size: 1.25rem;
}

.cart-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.3s;
}

.cart-close:hover {
    background: var(--card-hover);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    text-align: center;
}

.cart-empty svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--midnight-black);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
        max-height: 100px;
    }
    to {
        transform: translateX(-120%);
        opacity: 0;
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cart-item-price {
    color: var(--sky-blue);
    font-weight: 600;
}

.cart-item-remove {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    height: fit-content;
}

.cart-item-remove:hover {
    background: #EF4444;
    border-color: #EF4444;
    color: white;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.total-amount {
    color: var(--sky-blue);
}

.checkout-btn {
    width: 100%;
    background: var(--royal-blue);
    border: none;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    letter-spacing: 0.015em;
}

.checkout-btn:hover {
    background: var(--sky-blue);
    transform: translateY(-1px);
}

.checkout-btn:active {
    transform: translateY(0);
}

.checkout-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.checkout-btn:disabled:hover {
    background: var(--royal-blue);
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1999;
    display: none;
}

.cart-overlay.active {
    display: block;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--sky-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Page Loading Overlay */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.4s ease, backdrop-filter 0.4s ease;
}

.page-loading.hidden {
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--royal-blue);
    border-right-color: var(--sky-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

.loading-text {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    display: none;
}

.modal.active {
    display: flex;
    animation: fadeInModal 0.3s ease;
}

.modal.active .modal-content {
    animation: scaleInModal 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.closing {
    animation: fadeOutModal 0.25s ease forwards;
}

.modal.closing .modal-content {
    animation: scaleOutModal 0.25s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOutModal {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes scaleInModal {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes scaleOutModal {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.9);
        opacity: 0;
    }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.98) 0%, rgba(17, 24, 39, 0.95) 100%);
    backdrop-filter: blur(12px);
    border: 2px solid rgba(96, 165, 250, 0.2);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-right: 0.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    padding-right: 1rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.3s;
}

.modal-close:hover {
    background: var(--card-hover);
}

/* Policy Modal Specific Styles */
.policy-modal .modal-content {
    max-width: 800px;
    max-height: 85vh;
}

.policy-body {
    line-height: 1.8;
    color: var(--text-secondary);
}

/* Custom Scrollbar for Modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(17, 24, 39, 0.5);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.3);
    border-radius: 4px;
    transition: background 0.3s;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 165, 250, 0.5);
}

/* Firefox */
.modal-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(96, 165, 250, 0.3) rgba(17, 24, 39, 0.5);
}

.policy-body h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.policy-body h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--sky-blue);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.policy-body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.policy-body p {
    margin-bottom: 1rem;
}

.policy-body ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
    list-style: none;
}

.policy-body ul li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.5rem;
}

.policy-body ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--sky-blue);
    font-weight: bold;
}

.policy-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.policy-body a {
    color: var(--sky-blue);
    text-decoration: none;
    transition: color 0.3s;
}

.policy-body a:hover {
    color: var(--royal-blue);
    text-decoration: underline;
}

.policy-body .loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Notifications */
#notification-container {
    position: fixed;
    top: 5rem;
    right: 2rem;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.notification {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    transition: all 0.3s ease;
    max-width: 400px;
}

.notification.removing {
    animation: slideOutRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(calc(100% + 2rem));
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(calc(100% + 2rem));
        opacity: 0;
    }
}

.notification.success {
    border-color: var(--success);
}

.notification.error {
    border-color: #EF4444;
}

.notification.warning {
    border-color: #F59E0B;
}

.notification-icon {
    width: 24px;
    height: 24px;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.notification-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: var(--midnight-black);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    z-index: 5000;
    pointer-events: none;
    white-space: nowrap;
    border: 1px solid var(--border-color);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
    
    #notification-container {
        right: 1rem;
        left: 1rem;
        width: calc(100% - 2rem);
    }
    
    .notification {
        max-width: 100%;
    }
}
