.shopglut-admin-contents.woo-templates-editor {
    max-width: 1600px;
}

.shopglut-template-settings {
    background-color: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 4px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.shopglut-template-settings h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
}

.shopglut-template-setting {
    margin-bottom: 15px;
}

.shopglut-template-setting:last-child {
    margin-bottom: 0;
}

.shopglut-template-setting label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.shopglut-template-setting input[type="text"] {
    width: 100%;
    max-width: 400px;
}

.shopglut-template-editor-container {
    display: flex;
    gap: 30px;
    margin-top: 30px;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.shopglut-template-editor-sidebar {
    flex: 0 0 300px;
    margin-left: 20px;
}

.shopglut-template-editor-main {
    flex: 1;
    min-width: 0;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    order: 1;
}

.shopglut-template-editor-sidebar {
    order: 2;
}

/* Template Settings */
.shopglut-template-settings {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 25px;
    margin-top: 8px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.03);
}

.shopglut-template-settings h2 {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 18px;
    color: #23282d;
}

.shopglut-template-setting {
    margin-bottom: 20px;
}

.shopglut-template-setting:last-child {
    margin-bottom: 0;
}

.shopglut-template-setting label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #23282d;
}

.shopglut-template-setting input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
    transition: border-color 0.15s ease-in-out;
}

.shopglut-template-setting input[type="text"]:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.shopglut-template-setting .description {
    margin-top: 6px;
    color: #666;
    font-style: italic;
    font-size: 13px;
}

/* Template Tags */
.shopglut-template-tags {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.03);
}

.shopglut-template-tags h2 {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 18px;
    color: #23282d;
}

.shopglut-template-tags .description {
    margin-bottom: 15px;
    color: #666;
    font-size: 13px;
}

.shopglut-template-tags-category {
    margin-bottom: 20px;
}

.shopglut-template-tags-category:last-child {
    margin-bottom: 0;
}

.shopglut-template-tags-category h3 {
    margin-top: 0;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 15px;
    color: #23282d;
}

.shopglut-template-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
}

.shopglut-template-settings-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.shopglut-template-settings-row .shopglut-template-setting {
    flex: 1;
    min-width: 250px;
}

.shopglut-template-tag {
    display: block;
    align-items: center;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-bottom: 8px;
    background: #f9f9f9;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.shopglut-template-tag:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

.shopglut-template-tag code {
    background: #e9e9e9;
    padding: 2px 5px;
    border-radius: 3px;
    margin-right: 8px;
    font-size: 12px;
    white-space: nowrap;
}

.shopglut-template-tag-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.shopglut-template-tag-info strong {
    font-size: 13px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shopglut-template-tag-info small {
    font-size: 11px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shopglut-template-tags-category {
    margin-bottom: 15px;
}

.shopglut-template-tags-category h3 {
    margin: 0 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.template-id {
    display: inline-block;
    margin-left: 8px;
    font-size: 12px;
    color: #666;
    vertical-align: middle;
}

.template-id code {
    background: #f0f0f0;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 11px;
}

.shopglut-template-tag:hover {
    background-color: #f0f0f0;
    border-color: #bbb;
}

.shopglut-template-tag code {
    display: block;
    background: none;
    padding: 0;
    margin-bottom: 5px;
    font-size: 13px;
    color: #007cba;
    font-weight: 600;
}

.shopglut-template-tag-name {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 3px;
    color: #333;
}

.shopglut-template-tag-description {
    display: block;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.shopglut-template-tag:hover .shopglut-template-tag-description {
    display: block;
}

/* Editor Tabs */
.shopglut-template-editor-tabs {
    display: flex;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 15px;
}

.shopglut-template-editor-tab {
    padding: 15px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-right: 5px;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.2s ease;
}

.shopglut-template-editor-tab:hover {
    color: #2271b1;
    background: rgba(0, 0, 0, 0.02);
}

.shopglut-template-editor-tab.active {
    color: #2271b1;
    border-bottom: 3px solid #2271b1;
    background: #fff;
}

/* Editor Panels */
.shopglut-template-editor-panel {
    display: none;
    background: #fff;
    padding: 25px;
}

.shopglut-template-editor-panel.active {
    display: block;
}

/* Code Editor */
.shopglut-code-editor-field {
    margin-bottom: 20px;
}

.shopglut-code-editor-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #23282d;
}

.shopglut-code-editor-container {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.shopglut-code-editor {
    width: 100%;
    min-height: 450px;
}

/* CodeMirror Customizations */
.CodeMirror {
    height: 650px !important;
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
}

/* Preview Panel */
.shopglut-template-preview-container {
    padding: 20px;
    background: #fff;
}

.shopglut-template-preview-container h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 16px;
    color: #23282d;
}

#shopglut-template-preview {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 25px;
    min-height: 400px;
    background: #fcfcfc;
    box-shadow: inset 0 1px 5px rgba(0, 0, 0, 0.03);
}

.shopglut-template-preview-loading {
    text-align: center;
    padding: 60px 40px;
    color: #666;
    font-style: italic;
}

.shopglut-template-preview-content {
    padding: 15px;
}

/* Form Actions */
.shopglut-template-editor-actions {
    margin-top: 30px;
    padding: 20px 0;
    border-top: 1px solid #e5e5e5;
    text-align: right;
}

.shopglut-template-editor-actions .button-primary {
    padding: 8px 20px;
    height: auto;
    line-height: 1.4;
    font-size: 14px;
    min-width: 150px;
}

/* Templates List Table */
.shopglut-admin-contents.woo-templates .wp-list-table .column-shortcode {
    width: 30%;
}

.shopglut-admin-contents.woo-templates .wp-list-table .column-template_id {
    width: 15%;
}

.shopglut-admin-contents.woo-templates .wp-list-table .column-created_at {
    width: 15%;
}

.shopglut-templates-description {
    margin: 20px 0;
    padding: 15px;
    background: #fff;
    border-left: 4px solid #2271b1;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
}

/* Copy Shortcode Button */
.copy-shortcode {
    margin-left: 8px;
    vertical-align: middle;
    color: #2271b1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.copy-shortcode:hover {
    color: #135e96;
}

/* Responsive Adjustments */
@media screen and (max-width: 1200px) {
    .shopglut-template-editor-container {
        flex-direction: column;
    }
    
    .shopglut-template-editor-sidebar {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 25px;
    }
}

@media screen and (max-width: 782px) {
    .shopglut-template-editor-tabs {
        flex-wrap: wrap;
    }
    
    .shopglut-template-editor-tab {
        flex: 1 1 auto;
        text-align: center;
    }
}

#template-editor-form .notice {
    display: block !important;
}