/**
 * eCwid AJAX Styles
 * 
 * CSS voor AJAX loading states, transitions en user feedback
 */

/* Loading overlay */
#ecwid-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#ecwid-loading.show {
    display: flex;
}

/* Loading spinner */
.ecwid-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: ecwid-spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes ecwid-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#ecwid-loading span {
    color: #333;
    font-size: 16px;
    font-weight: 500;
}

/* Content transitions */
#ecwid-content {
    transition: opacity 0.3s ease-in-out;
}

body.ecwid-loading #ecwid-content {
    opacity: 0.7;
    pointer-events: none;
}

/* Error messages */
.ecwid-error-message {
    background: #dc3545;
    color: white;
    padding: 15px 20px;
    border-radius: 4px;
    margin: 20px 0;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(220, 53, 69, 0.2);
    animation: ecwid-slide-down 0.3s ease-out;
}

@keyframes ecwid-slide-down {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* AJAX pagination */
.ecwid-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    gap: 10px;
}

.ecwid-pagination a {
    padding: 10px 15px;
    background: #f8f9fa;
    color: #007cba;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    border: 1px solid #dee2e6;
}

.ecwid-pagination a:hover {
    background: #007cba;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 124, 186, 0.2);
}

.ecwid-pagination .current {
    padding: 10px 15px;
    background: #007cba;
    color: white;
    border-radius: 4px;
    border: 1px solid #007cba;
}

.ecwid-pagination .disabled {
    padding: 10px 15px;
    background: #e9ecef;
    color: #6c757d;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    cursor: not-allowed;
}

/* Product grid transitions */
.ecwid-product-grid {
    transition: opacity 0.3s ease-in-out;
}

.ecwid-product-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ecwid-product-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Search form styling */
.ecwid-search-form {
    position: relative;
    margin: 20px 0;
}

.ecwid-search-form input[type="search"],
.ecwid-search-form input[name="q"] {
    width: 100%;
    padding: 12px 50px 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 25px;
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ecwid-search-form input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.ecwid-search-form button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #007cba;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.ecwid-search-form button:hover {
    background: #005a87;
}

/* Breadcrumbs */
.ecwid-breadcrumbs {
    margin: 20px 0;
    font-size: 14px;
}

.ecwid-breadcrumbs a {
    color: #007cba;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ecwid-breadcrumbs a:hover {
    color: #005a87;
    text-decoration: underline;
}

.ecwid-breadcrumbs span {
    color: #6c757d;
    margin: 0 8px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #ecwid-loading {
        background: rgba(255, 255, 255, 0.95);
    }
    
    .ecwid-spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
    
    #ecwid-loading span {
        font-size: 14px;
    }
    
    .ecwid-pagination {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .ecwid-pagination a,
    .ecwid-pagination .current,
    .ecwid-pagination .disabled {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .ecwid-search-form input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    #ecwid-loading {
        background: rgba(33, 37, 41, 0.9);
    }
    
    #ecwid-loading span {
        color: #f8f9fa;
    }
    
    .ecwid-pagination a {
        background: #495057;
        color: #f8f9fa;
        border-color: #6c757d;
    }
    
    .ecwid-pagination a:hover {
        background: #007cba;
    }
    
    .ecwid-search-form input {
        background: #495057;
        color: #f8f9fa;
        border-color: #6c757d;
    }
    
    .ecwid-search-form input:focus {
        background: #495057;
        border-color: #007cba;
    }
}

/* Accessibility improvements */
.ecwid-loading .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus states for keyboard navigation */
.ecwid-pagination a:focus,
.ecwid-search-form button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Content fade transitions */
.ecwid-content-fade-enter {
    opacity: 0;
    transform: translateY(20px);
}

.ecwid-content-fade-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.ecwid-content-fade-exit {
    opacity: 1;
    transform: translateY(0);
}

.ecwid-content-fade-exit-active {
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
} 