/* Admin Product Badges Styles */

.shopglut-badges-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px 0;
    border-bottom: 1px solid #ddd;
}

.shopglut-badges-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.shopglut-badges-header .description {
    margin: 5px 0 0 0;
    color: #666;
}

.shopglut-badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.shopglut-badge-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.shopglut-badge-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.badge-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.badge-card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.badge-actions {
    display: flex;
    gap: 5px;
}

.badge-preview {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 15px;
    position: relative;
}

.badge-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, #ccc 25%, transparent 25%), 
        linear-gradient(-45deg, #ccc 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #ccc 75%), 
        linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    opacity: 0.1;
    z-index: 0;
}

.badge-preview .shopglut-badge {
    position: relative;
    z-index: 1;
}

.badge-meta {
    font-size: 13px;
    line-height: 1.4;
}

.badge-meta p {
    margin: 5px 0;
}

.badge-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-status-active {
    background: #d4edda;
    color: #155724;
}

.badge-status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.shopglut-no-badges {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.no-badges-content .dashicons {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 20px;
}

.no-badges-content h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.no-badges-content p {
    margin: 0 0 20px 0;
    color: #666;
}

/* Badge Templates */
.shopglut-badge-templates {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
}

.templates-header {
    text-align: center;
    margin-bottom: 30px;
}

.templates-header h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.template-card {
    background: #fff;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.template-card:hover {
    border-color: #007cba;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.1);
}

.template-card.template-custom {
    border-style: dashed;
    border-color: #ccc;
}

.template-card.template-custom:hover {
    border-color: #007cba;
}

.template-preview {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    position: relative;
}

.template-badge-preview {
    display: inline-block;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.custom-preview {
    width: 60px;
    height: 60px;
    border: 2px dashed #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-preview .dashicons {
    font-size: 24px;
    color: #ccc;
}

.template-info h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
}

.template-info p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 13px;
}

.template-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* Modal 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;
}

.shopglut-modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
}

.shopglut-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #ddd;
    background: #f8f9fa;
}

.shopglut-modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.shopglut-modal-close {
    font-size: 24px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.shopglut-modal-close:hover {
    color: #333;
}

.shopglut-modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

.shopglut-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #ddd;
    background: #f8f9fa;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Form Styles */
.form-row {
    margin-bottom: 20px;
}

.form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
    outline: none;
}

.form-row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
}

.form-section h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

/* Assignment Tabs */
.assignment-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab-button {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    font-weight: 500;
}

.tab-button.active {
    border-bottom-color: #007cba;
    color: #007cba;
}

.tab-content {
    margin-top: 20px;
}

.conditions-list {
    display: grid;
    gap: 15px;
}

.condition-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.condition-item label {
    margin: 0;
    font-weight: normal;
}

.condition-item input[type="number"] {
    width: auto;
}

/* Preview Styles */
.badge-preview-container {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 20px;
}

.preview-product-card {
    background: #fff;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    max-width: 250px;
    margin: 0 auto;
}

.preview-badges {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.preview-product-content {
    text-align: center;
    padding-top: 60px;
}

.preview-product-content h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

.preview-product-content .price {
    font-size: 18px;
    font-weight: bold;
    color: #007cba;
}

/* Badge Preview in List Table */
.shopglut-badge-preview {
    display: inline-block;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Badge Editor */
.shopglut-badge-editor {
    background: #fff;
    border-radius: 8px;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 30px;
}

.editor-header h1 {
    margin: 0;
    font-size: 24px;
}

.editor-actions {
    display: flex;
    gap: 10px;
}

.editor-content {
    padding: 0;
}

.editor-main {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
}

.editor-sidebar {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
}

.editor-preview {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
}

.preview-container {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 20px;
}

.preview-product {
    background: #fff;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    text-align: center;
}

.product-image {
    position: relative;
    height: 200px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-preview-area {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.placeholder-image {
    font-size: 48px;
    color: #ccc;
}

.product-info h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

.product-info .price {
    font-size: 18px;
    font-weight: bold;
    color: #007cba;
}

/* Toggle Switch */
.badge-status-toggle {
    display: flex;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #007cba;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Assignment Info */
.badge-assignment-info {
    margin-bottom: 10px;
}

.assignment-list {
    margin-top: 5px;
}

.assignment-item {
    display: inline-block;
    background: #f0f0f1;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    margin-right: 5px;
    margin-bottom: 3px;
}

.no-assignment {
    color: #666;
    font-style: italic;
    font-size: 12px;
}

.badge-status-display {
    margin-bottom: 15px;
}

/* Enhancement Sections */
.shopglut-enhancement-section {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 20px;
}

.shopglut-enhancement-section h1 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
}

.shopglut-enhancement-section .description {
    margin: 0 0 30px 0;
    color: #666;
    font-size: 16px;
}

.enhancement-redirect-notice {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
}

.enhancement-redirect-notice p {
    margin: 0 0 15px 0;
    color: #0073aa;
}

.enhancement-coming-soon {
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
}

.coming-soon-content {
    max-width: 400px;
    margin: 0 auto;
}

.coming-soon-content .dashicons {
    display: block;
    margin: 0 auto 20px auto;
}

.coming-soon-content h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 20px;
}

.coming-soon-content p {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 1200px) {
    .editor-main {
        grid-template-columns: 1fr;
    }
    
    .templates-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .shopglut-badges-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .shopglut-badges-grid {
        grid-template-columns: 1fr;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row-group {
        grid-template-columns: 1fr;
    }
    
    .assignment-tabs {
        flex-wrap: wrap;
    }
    
    .shopglut-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .shopglut-modal-body {
        padding: 20px;
    }
    
    .shopglut-enhancement-section {
        padding: 20px;
    }
    
    .enhancement-coming-soon {
        padding: 40px 20px;
    }
}