/* Certificate Maker Styles */

.certificate-maker-wrap {
    margin-right: 20px;
}

.certificate-maker-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    background: #f0f0f1;
    padding: 20px;
    border-radius: 8px;
    min-height: 800px;
}

/* Sidebar */
.maker-sidebar {
    width: 250px;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow-y: auto;
    max-height: 90vh;
}

.sidebar-section {
    margin-bottom: 30px;
}

.sidebar-section h3 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #2271b1;
    font-size: 14px;
    font-weight: 600;
    color: #2c3338;
}

.sidebar-section .button-primary {
    width: 100%;
    margin-bottom: 15px;
    justify-content: center;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Templates List */
.templates-list {
    max-height: 300px;
    overflow-y: auto;
}

.template-item {
    padding: 10px;
    margin-bottom: 8px;
    background: #f6f7f7;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.template-item:hover {
    background: #e5e5e5;
}

.template-item.active {
    background: #2271b1;
}

.template-item.active .template-name-link {
    color: #fff;
}

.template-item .template-name-link {
    flex: 1;
    text-decoration: none;
    color: #2c3338;
    font-size: 13px;
}

.template-item-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.template-item .duplicate-template {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 3px;
    color: #2271b1;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.template-item .duplicate-template:hover,
.template-item .duplicate-template:focus {
    background: rgba(34, 113, 177, 0.1);
    color: #135e96;
    outline: none;
}

.template-item.active .duplicate-template {
    color: #fff;
}

.template-item.active .duplicate-template:hover,
.template-item.active .duplicate-template:focus {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.template-item .delete-template {
    background: none;
    border: none;
    cursor: pointer;
    color: #d63638;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: background 0.2s;
}

.template-item .delete-template:hover {
    background: rgba(214, 54, 56, 0.1);
}

.no-templates {
    text-align: center;
    color: #8c8f94;
    font-size: 13px;
    padding: 20px 0;
}

/* Elements List */
.elements-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.element-btn {
    padding: 10px 15px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.element-btn:hover {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.element-btn .dashicons {
    font-size: 18px;
}

/* Dynamic Fields Info */
.dynamic-fields-info {
    font-size: 12px;
}

.dynamic-fields-info p {
    margin: 5px 0;
}

.dynamic-fields-info code {
    background: #f6f7f7;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: #d63638;
}

/* Canvas Area */
.maker-canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.canvas-toolbar {
    padding: 15px 20px;
    background: #f6f7f7;
    border-bottom: 1px solid #dcdcde;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

#template-name-input {
    flex: 1;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
}

.toolbar-actions {
    display: flex;
    gap: 10px;
}

.toolbar-actions .button {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Canvas Container */
.canvas-container {
    flex: 1;
    overflow: auto;
    padding: 40px;
    background: repeating-linear-gradient(
            0deg,
            #f0f0f1,
            #f0f0f1 20px,
            #e5e5e5 20px,
            #e5e5e5 21px
    ),
    repeating-linear-gradient(
            90deg,
            #f0f0f1,
            #f0f0f1 20px,
            #e5e5e5 20px,
            #e5e5e5 21px
    );
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

#certificate-canvas {
    position: relative;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Canvas Elements */
.canvas-element {
    position: absolute;
    cursor: move;
    border: 2px dashed transparent;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.canvas-element:hover {
    border-color: rgba(34, 113, 177, 0.5);
}

.canvas-element.selected {
    border-color: #2271b1;
    outline: 2px solid rgba(34, 113, 177, 0.3);
}

.canvas-element .element-content {
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.text-element .element-content,
.field-element .element-content {
    padding: 5px;
    word-wrap: break-word;
}

/* Element Controls */
.element-controls {
    position: absolute;
    top: -30px;
    right: -2px;
    display: none;
    background: #2271b1;
    border-radius: 4px;
    padding: 2px;
    z-index: 1000;
}

.canvas-element.selected .element-controls {
    display: flex;
    gap: 2px;
}

.delete-element-btn {
    background: #d63638;
    color: #fff;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    font-weight: bold;
    transition: background 0.2s;
}

.delete-element-btn:hover {
    background: #b32d2e;
}

/* Resize Handle */
.resize-handle {
    position: absolute;
    right: -5px;
    bottom: -5px;
    width: 10px;
    height: 10px;
    background: #2271b1;
    cursor: nwse-resize;
    border: 2px solid #fff;
    border-radius: 2px;
    display: none;
}

.canvas-element.selected .resize-handle {
    display: block;
}

/* Properties Panel */
.maker-properties {
    width: 280px;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow-y: auto;
    max-height: 90vh;
}

.maker-properties h3 {
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #2271b1;
    font-size: 14px;
    font-weight: 600;
    color: #2c3338;
}

.no-selection {
    text-align: center;
    color: #8c8f94;
    font-size: 13px;
    padding: 40px 20px;
}

/* Properties Form */
.properties-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.property-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.property-group label {
    font-size: 12px;
    font-weight: 600;
    color: #2c3338;
}

.property-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    transition: border-color 0.2s;
}

.property-input:focus {
    border-color: #2271b1;
    outline: none;
}

.property-input[type="color"] {
    height: 38px;
    cursor: pointer;
}

.property-input[type="number"] {
    -moz-appearance: textfield;
}

.property-input[type="number"]::-webkit-outer-spin-button,
.property-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

textarea.property-input {
    resize: vertical;
    min-height: 60px;
    font-family: monospace;
}

select.property-input {
    cursor: pointer;
}

/* Responsive */
@media (max-width: 1400px) {
    .certificate-maker-container {
        flex-direction: column;
    }

    .maker-sidebar,
    .maker-properties {
        width: 100%;
        max-height: none;
    }

    .canvas-container {
        min-height: 600px;
    }
}

/* Scrollbar Styling */
.maker-sidebar::-webkit-scrollbar,
.maker-properties::-webkit-scrollbar,
.templates-list::-webkit-scrollbar {
    width: 8px;
}

.maker-sidebar::-webkit-scrollbar-track,
.maker-properties::-webkit-scrollbar-track,
.templates-list::-webkit-scrollbar-track {
    background: #f0f0f1;
    border-radius: 4px;
}

.maker-sidebar::-webkit-scrollbar-thumb,
.maker-properties::-webkit-scrollbar-thumb,
.templates-list::-webkit-scrollbar-thumb {
    background: #8c8f94;
    border-radius: 4px;
}

.maker-sidebar::-webkit-scrollbar-thumb:hover,
.maker-properties::-webkit-scrollbar-thumb:hover,
.templates-list::-webkit-scrollbar-thumb:hover {
    background: #2271b1;
}

.pro-container-span{
    background: linear-gradient(135deg, #ff4b2b, #ff416c);
    padding: 4px 10px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
}

.pro-container-small{
    color: white;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
    line-height: 1;
}