/* Shop Banner Admin Styles */

.shopglut-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: #f8f9fa;
    padding: 20px 25px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #e9ecef;
    color: #333;
}

.modal-body {
    padding: 25px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* Banner Grid */
.banners-grid {
    margin-top: 30px !important;
}

.banner-card {
    transition: all 0.3s ease;
}

.banner-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15) !important;
}

.banner-actions .button {
    margin-right: 5px;
    margin-bottom: 5px;
}

.banner-actions .button i {
    margin-right: 5px;
}

/* Prebuilt Templates */
.prebuilt-templates .template-card {
    border: 2px solid #ddd !important;
    cursor: pointer;
    transition: all 0.3s ease;
}

.prebuilt-templates .template-card:hover {
    border-color: #0073aa !important;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 115, 170, 0.2);
}

/* Banner Editor */
.editor-controls {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.editor-controls h3,
.editor-controls h4 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 8px;
}

.editor-controls label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #555;
}

.editor-controls input,
.editor-controls textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.editor-controls input:focus,
.editor-controls textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.editor-controls input[type="color"] {
    height: 40px;
    padding: 2px;
    cursor: pointer;
}

.editor-controls input[type="number"] {
    width: 80px;
}

/* Live Preview */
.banner-preview-container {
    position: sticky;
    top: 0;
}

.banner-preview-container h3 {
    margin-top: 0;
    color: #333;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
}

#live-preview {
    border: 2px dashed #ddd;
    transition: all 0.3s ease;
    position: relative;
    min-height: 250px;
}

#live-preview:hover {
    border-color: #0073aa;
}

/* Banner Actions */
.banner-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.banner-actions .button {
    flex: 1;
    text-align: center;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* Form Grid */
.editor-controls > div[style*="grid"] p {
    margin-bottom: 15px;
}

/* No Banners State */
.no-banners {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.no-banners i {
    font-size: 64px;
    color: #ccc;
    margin-bottom: 20px;
    display: block;
}

.no-banners h3 {
    color: #666;
    margin-bottom: 10px;
}

.no-banners p {
    color: #999;
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .modal-content[style*="max-width: 1000px"] {
        max-width: 95vw !important;
    }
    
    #banner-editor-form[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .banner-preview-container {
        position: static;
    }
}

/* Full-width Banner Cards */
.banner-card {
    transition: all 0.3s ease;
}

.banner-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
}

/* Banner preview enhancements */
.banner-preview {
    position: relative;
    overflow: hidden;
}

.banner-content {
    backdrop-filter: blur(1px);
}

@media (max-width: 768px) {
    .modal-content {
        max-width: 95vw;
        margin: 10px;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .banners-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .banner-info {
        padding: 15px !important;
    }
    
    .banner-info > div[style*="display: flex"] {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    .banner-info > div > div[style*="flex: 1"] {
        margin-right: 0 !important;
        margin-bottom: 15px !important;
    }
    
    .banner-actions[style*="display: flex"] {
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
        margin-top: 0 !important;
    }
    
    .banner-actions .button {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }
    
    .editor-controls > div[style*="grid"] {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
}

/* Success/Error States */
.banner-success {
    background: #d1edff;
    border-left: 4px solid #00a32a;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.banner-error {
    background: #ffeaea;
    border-left: 4px solid #dc3232;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

/* Loading States */
.button.loading {
    position: relative;
    color: transparent !important;
}

.button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Shortcode Display */
code {
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    color: #e83e8c;
    border: 1px solid #dee2e6;
    user-select: all;
}

/* Banner Preview Enhancements */
.banner-preview {
    position: relative;
    overflow: hidden;
}

.banner-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 49%, rgba(255,255,255,0.1) 50%, transparent 51%);
    pointer-events: none;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.banner-card:hover .banner-preview::before {
    opacity: 1;
}