/**
 * Cart Bulk Import Styles
 *
 * Styles for the bulk import modal and button on WooCommerce cart page
 */

/* Import Button */
.cart-bulk-import-wrapper {
    display: block;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

#cart-bulk-import-btn {
    font-size: 16px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cart-bulk-import-info {
    margin-left: 15px;
    color: #666;
    font-size: 14px;
}

/* Modal Overlay */
.cart-bulk-import-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none !important;
}

.cart-bulk-import-modal.active {
    display: block !important;
}

.cart-bulk-import-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

/* Modal Content */
.cart-bulk-import-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Modal Header */
.cart-bulk-import-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.cart-bulk-import-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.cart-bulk-import-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}


/* Modal Body */
.cart-bulk-import-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

/* Import Instructions */
.import-instructions {
    background: #e8f4fd;
    border-left: 4px solid #2196F3;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.import-instructions p {
    margin: 0 0 10px 0;
}

.import-instructions p:last-child {
    margin-bottom: 0;
}

.import-instructions ul {
    margin: 10px 0;
    padding-left: 25px;
}

.import-instructions li {
    margin: 5px 0;
}

.import-instructions code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.import-instructions pre {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 10px 0 0 0;
    font-size: 13px;
}

/* Import Form */
.import-form label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

/* File Upload Section */
.import-file-upload {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.file-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

#cart-import-file-btn, #cart-import-file-btn:hover {
    cursor: pointer;
    transition: background 0.3s ease;
    border: none;
}

#cart-import-file-name {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

#cart-import-file-name:empty::before {
    content: 'Žádný soubor není vybrán';
    color: #999;
    font-weight: normal;
}

/* Import Separator */
.import-separator {
    position: relative;
}

.import-separator span {
    position: relative;
    z-index: 1;
}

.import-separator hr {
    margin: 0;
}

/* Manual Input Section */
.import-manual-input {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

#cart-import-data {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#cart-import-data:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* Import Actions */
.import-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.import-actions .button {
    white-space: nowrap;
    padding: 10px 20px;
    min-width: 150px;
}

#cart-import-submit-btn, .button.cart-bulk-import-modal-close, #cart-import-submit-btn:hover, .button.cart-bulk-import-modal-close:hover {
    font-size: 16px;
    border: none;
}

.import-loading {
    display: none;
    align-items: center;
    color: #666;
}

.import-loading.active {
    display: flex;
}

/* Import Results */
.import-results {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    display: none;
}

.import-results.active {
    display: block;
}

.import-results h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.import-results-content {
    font-size: 14px;
}

/* Success/Error Messages */
.import-message {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.import-message:last-child {
    margin-bottom: 0;
}

.import-message.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.import-message.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.import-message.warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

/* Success/Failed Items Lists */
.import-items-list {
    margin-top: 10px;
}

.import-items-list ul {
    margin: 5px 0;
    padding-left: 20px;
}

.import-items-list li {
    margin: 3px 0;
    font-size: 13px;
}

.import-item-success {
    color: #155724;
}

.import-item-error {
    color: #721c24;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cart-bulk-import-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .cart-bulk-import-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    .cart-bulk-import-info {
        margin-left: 0;
        margin-top: 10px;
    }

    .import-actions {
        flex-wrap: wrap;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translate(-50%, -45%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

.cart-bulk-import-modal.active .cart-bulk-import-modal-overlay {
    animation: fadeIn 0.3s ease;
}

.cart-bulk-import-modal.active .cart-bulk-import-modal-content {
    animation: slideIn 0.3s ease;
}

/* Alert Notifications */
.cart-import-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: alertSlideIn 0.3s ease;
    max-width: 450px;
    min-width: 300px;
}

.cart-import-alert-success {
    background: #d4edda;
    border-left: 5px solid #28a745;
    color: #155724;
}

.cart-import-alert-error {
    background: #f8d7da;
    border-left: 5px solid #dc3545;
    color: #721c24;
}

.cart-import-alert-icon {
    font-size: 24px;
    font-weight: bold;
    flex-shrink: 0;
}

.cart-import-alert-success .cart-import-alert-icon {
    color: #28a745;
}

.cart-import-alert-error .cart-import-alert-icon {
    color: #dc3545;
}

.cart-import-alert-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.cart-import-alert-close {
    background: none;
    border: none;
    font-size: 24px;
    color: inherit;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.cart-import-alert-close:hover {
    opacity: 1;
}

@keyframes alertSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Clear Cart Button */
#cart-clear-btn {
    transition: all 0.3s ease;
}

#cart-clear-btn:hover {
    background: #c82333 !important;
    border-color: #c82333 !important;
}

#cart-clear-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive Alert */
@media (max-width: 768px) {
    .cart-import-alert {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        min-width: auto;
    }
}
