.cpl-error-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cpl-error-modal.active {
    opacity: 1;
}

.cpl-error-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.cpl-error-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.cpl-error-modal.active .cpl-error-content {
    transform: translateY(0);
}

.cpl-error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.cpl-error-icon.error {
    animation: shake 0.5s ease-in-out;
}

.cpl-error-icon.warning {
    animation: pulse 1s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

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

.cpl-error-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px 0;
}

.cpl-error-message {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 24px 0;
    line-height: 1.6;
}

.cpl-error-retry {
    width: 100%;
    margin-bottom: 8px;
}

.cpl-error-close {
    width: 100%;
}

.cpl-error-support {
    font-size: 12px;
    color: #94a3b8;
    margin: 16px 0 8px 0;
}

.cpl-sheet-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
}

.cpl-sheet-container.active {
    pointer-events: all;
}

.cpl-sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cpl-sheet-container.active .cpl-sheet-overlay {
    opacity: 1;
}

.cpl-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cpl-sheet-container.active .cpl-sheet {
    transform: translateY(0);
}

.cpl-sheet-handle {
    width: 40px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 2px;
    margin: 0 auto 20px;
}

.cpl-sheet-content .opt-card {
    margin-bottom: 12px;
}

.touch-active {
    opacity: 0.7;
    transform: scale(0.98);
}

.header-hidden {
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.cpl-quick-preview {
    position: fixed;
    background: white;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.cpl-quick-preview.active {
    opacity: 1;
    transform: scale(1);
}

.cpl-quick-preview-img {
    width: 200px;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.cpl-quick-preview-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cpl-quick-preview-stats {
    display: flex;
    gap: 16px;
    justify-content: center;
    font-size: 12px;
    color: #64748b;
}

.cpl-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cpl-preview-modal.active {
    opacity: 1;
}

.cpl-preview-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 0;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.cpl-preview-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.cpl-preview-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.cpl-preview-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 32px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.cpl-preview-nav:hover {
    background: rgba(0, 0, 0, 0.7);
}

.cpl-preview-prev {
    left: 16px;
}

.cpl-preview-next {
    right: 16px;
}

.cpl-preview-image-container {
    width: 100%;
    max-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
}

.cpl-preview-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cpl-preview-info {
    padding: 24px;
}

.cpl-preview-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #64748b;
}

.cpl-preview-info .cpl-btn {
    width: 100%;
}

.cpl-preview-info .cpl-btn.selected {
    background: #10b981;
    color: white;
}

@media (max-width: 768px) {
    .cpl-error-content {
        padding: 24px;
    }

    .cpl-preview-content {
        max-height: 95vh;
    }

    .cpl-preview-nav {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .cpl-quick-preview {
        display: none;
    }
}

.cpl-loading-indicator {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.cpl-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    transition: transform 0.3s ease;
}

.cpl-toast.active {
    transform: translateX(-50%) translateY(0);
}

.cpl-skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
