/**
 * JR Post to Photocard Maker - Frontend Styles
 */

/* Reset and Base Styles */
.jrpcm-wrapper * {
    box-sizing: border-box;
}

.jrpcm-wrapper {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

/* Header */
.jrpcm-header {
    text-align: center;
    margin-bottom: 40px;
}

.jrpcm-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #1e293b;
}

.jrpcm-header p {
    font-size: 16px;
    color: #64748b;
    margin: 0;
}

/* Container */
.jrpcm-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Sidebar */
.jrpcm-sidebar {
    flex: 0 0 320px;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
    overflow-y: auto;
}

.jrpcm-control-group {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.jrpcm-control-group:last-of-type {
    border-bottom: none;
}

.jrpcm-control-group h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: #1e293b;
}

.jrpcm-control {
    margin-bottom: 16px;
}

.jrpcm-control:last-child {
    margin-bottom: 0;
}

.jrpcm-control label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #475569;
}

.jrpcm-input,
.jrpcm-textarea,
.jrpcm-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.jrpcm-input:focus,
.jrpcm-textarea:focus,
.jrpcm-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.jrpcm-textarea {
    resize: vertical;
    min-height: 80px;
}

input[type="color"] {
    width: 100%;
    height: 40px;
    padding: 4px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
}

input[type="range"] {
    width: calc(100% - 60px);
    margin-right: 10px;
    vertical-align: middle;
}

.jrpcm-control span {
    display: inline-block;
    font-size: 14px;
    color: #475569;
    min-width: 50px;
    text-align: right;
}

input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

/* Buttons */
.jrpcm-button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.jrpcm-button-primary {
    background: #3b82f6;
    color: #ffffff;
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.jrpcm-button-primary:hover {
    background: #2563eb;
}

.jrpcm-button-secondary {
    background: #f1f5f9;
    color: #475569;
    width: 100%;
}

.jrpcm-button-secondary:hover {
    background: #e2e8f0;
}

.jrpcm-actions {
    margin-top: 24px;
}

/* Preview */
.jrpcm-preview-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.jrpcm-preview-container {
    background: #f8fafc;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Canvas */
.jrpcm-canvas {
    width: 850px;
    height: 500px;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.jrpcm-canvas-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
	z-index:1;
}


/* grid must be above */
.jrpcm-grid{
    position:absolute;
    inset:0;
    z-index:5;
}
.grid-stack-item-content{
    cursor: move;
    user-select:none;
}



.jrpcm-canvas-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    transition: background 0.3s;
	z-index:1;
}

.jrpcm-canvas-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    text-align: left;
}

.jrpcm-canvas-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 20px 0;
    color: #ffffff;
    word-wrap: break-word;
}

.jrpcm-canvas-text {
    font-size: 20px;
    line-height: 1.6;
    margin: 0 0 20px 0;
    color: #ffffff;
    opacity: 0.95;
}

.jrpcm-canvas-date {
    font-size: 16px;
    margin: 0;
    color: #ffffff;
    opacity: 0.8;
    font-weight: 500;
}

.jrpcm-canvas-watermark {
    position: absolute;
    z-index: 3;
    max-width: 200px;
    height: auto;
}

.jrpcm-canvas-watermark img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}



/* Templates */
.jrpcm-canvas[data-template="classic"] .jrpcm-canvas-content {
    justify-content: flex-end;
    padding-bottom: 80px;
}

.jrpcm-canvas[data-template="minimal"] .jrpcm-canvas-content {
    justify-content: center;
    text-align: center;
    align-items: center;
}

.jrpcm-canvas[data-template="minimal"] .jrpcm-canvas-title {
    max-width: 800px;
}

/* Remove button hidden by default */
.grid-stack-item .remove-btn {
    display: none;
    position: absolute;
    top: 5px;
    right: 5px;
    background: red;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 2px 6px;
    cursor: pointer;
    z-index: 10;
	height:25px;
	width:25px;
	font-size:12px;
	border-radius:50%;
}

/* Show remove button on hover of the widget */
.grid-stack-item:hover .remove-btn {
    display: block;
}

.jrpcm-photocard-button{
	  font-size: 12px;
    background: darkgreen;
    color: #fff !important;
    padding: 5px;
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 1200px) {
    .jrpcm-canvas {
        width: 800px;
        height: 420px;
    }
    
    .jrpcm-canvas-content {
        padding: 40px;
    }
    
    .jrpcm-canvas-title {
        font-size: 36px;
    }
    
    .jrpcm-canvas-text {
        font-size: 16px;
    }
    
    .jrpcm-canvas-date {
        font-size: 14px;
    }
}

@media (max-width: 992px) {
    .jrpcm-container {
        flex-direction: column;
    }
    
    .jrpcm-sidebar {
        flex: 1;
        width: 100%;
        max-height: none;
    }
    
    .jrpcm-canvas {
        width: 600px;
        height: 315px;
    }
    
    .jrpcm-canvas-content {
        padding: 30px;
    }
    
    .jrpcm-canvas-title {
        font-size: 28px;
    }
    
    .jrpcm-canvas-text {
        font-size: 14px;
    }
}

@media (max-width: 640px) {
    .jrpcm-wrapper {
        padding: 0 15px;
        margin: 20px auto;
    }
    
    .jrpcm-header h1 {
        font-size: 24px;
    }
    
    .jrpcm-canvas {
        width: 100%;
        max-width: 400px;
        height: 210px;
    }
    
    .jrpcm-canvas-content {
        padding: 20px;
    }
    
    .jrpcm-canvas-title {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .jrpcm-canvas-text {
        font-size: 12px;
        margin-bottom: 10px;
    }
    
    .jrpcm-canvas-date {
        font-size: 11px;
    }
    
    .jrpcm-canvas-watermark {
        max-width: 80px;
        max-height: 40px;
    }
    
}