/* Profile Frame Generator Control Styles */

:root {
    --pfg-primary: #2271b1;
    --pfg-primary-hover: #135e96;
    --pfg-bg: #f0f0f1;
    --pfg-card-bg: #ffffff;
    --pfg-text: #3c434a;
    --pfg-border: #dcdcde;
    --pfg-radius: 8px;
    --pfg-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.ppfg-wrapper {
    background: var(--pfg-card-bg);
    border-radius: var(--pfg-radius);
    box-shadow: var(--pfg-shadow);
    width: 100%;
    max-width: 900px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    border: 1px solid var(--pfg-border);
    flex-wrap: wrap;
    /* Allow wrapping for full-width items */
}

@media (min-width: 768px) {
    .ppfg-wrapper {
        flex-direction: row;
    }

    .ppfg-wrapper.ppfg-layout-bottom {
        flex-direction: column !important;
    }
}

/* Preview Section */
.ppfg-preview-section {
    flex: 2;
    background-color: #e5e5e5;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-image: linear-gradient(45deg, #ddd 25%, transparent 25%),
        linear-gradient(-45deg, #ddd 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ddd 75%),
        linear-gradient(-45deg, transparent 75%, #ddd 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    min-height: 300px;
    position: relative;
}

.rendered-image {
    max-width: 100%;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Spinner animation styles */
.dashicons.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Canvas state classes */
.ppfg-canvas-grabbing {
    cursor: grabbing !important;
}

.ppfg-canvas-grab {
    cursor: grab !important;
}

/* Toolbar */
.ppfg-toolbar {
    margin-top: 15px;
    background: white;
    padding: 8px;
    border-radius: 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    display: none;
}

.ppfg-btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ppfg-btn-icon:hover {
    background: #f0f0f0;
    color: var(--pfg-primary);
}

.ppfg-tool-separator {
    width: 1px;
    height: 20px;
    background: #ddd;
    margin: 0 5px;
}

/* Zoom Slider Styles */
.ppfg-zoom-container {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 180px;
    position: relative;
}

.ppfg-zoom-slider {
    appearance: none;
    -webkit-appearance: none;
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #ddd;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
    margin: 0;
    padding: 0;
}

.ppfg-zoom-slider:hover {
    opacity: 1;
}

.ppfg-zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--pfg-primary);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: none;
    margin-top: -6px;
    /* Center thumb on track for some browsers */
}

/* Firefox thumb */
.ppfg-zoom-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--pfg-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Reset standard track styles if needed */
.ppfg-zoom-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    border: none;
}

.ppfg-divider {
    width: 1px;
    height: 20px;
    background: #ddd;
}

/* Controls Section */
.ppfg-controls-section {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-left: 1px solid var(--pfg-border);
}

.ppfg-title {
    margin: 0 0 10px;
    font-size: 1.5rem;
    color: #1d2327;
}

.ppfg-subtitle {
    font-size: 0.9rem;
    color: #646970;
    margin-bottom: 20px;
}

.ppfg-group {
    margin-bottom: 15px;
}

.ppfg-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

/* Upload Button */
.ppfg-file-upload {
    position: relative;
    display: block;
}

.ppfg-file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f6f7f7;
    border: 1px dashed #8c8f94;
    padding: 20px;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    color: #50575e;
}

.ppfg-file-label:hover {
    border-color: var(--pfg-primary);
    background: #f0f6fc;
    color: var(--pfg-primary);
}

/* Inputs */
.ppfg-input-flex {
    display: flex;
    gap: 8px;
}

.ppfg-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
}

.ppfg-btn-secondary {
    background: #f6f7f7;
    border: 1px solid #8c8f94;
    color: #2c3338;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.ppfg-btn-secondary:hover {
    background: #f0f0f1;
    border-color: #2c3338;
}

.ppfg-btn-success {
    background-color: #008a20 !important;
    border-color: #008a20 !important;
    color: #fff !important;
}

/* Toggles */
.ppfg-bokeh-control-wrapper {
    display: none;
}

.ppfg-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ppfg-toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
}

.ppfg-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ppfg-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.ppfg-toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.ppfg-toggle-slider {
    background-color: var(--pfg-primary);
}

input:checked+.ppfg-toggle-slider:before {
    transform: translateX(16px);
}

/* Download Button */
.ppfg-btn-primary {
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.ppfg-btn-primary:hover {
    background: linear-gradient(135deg, #135e96 0%, #0a4b78 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(34, 113, 177, 0.4);
}

.ppfg-btn-primary .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.ppfg-btn-primary:hover .dashicons {
    transform: translateY(2px);
}

/* Uploading state */
.ppfg-btn-primary.uploading {
    opacity: 0.8;
    pointer-events: none;
}

.ppfg-btn-primary.uploading .dashicons {
    animation: spin 1s linear infinite;
}

/* Instructions Box */
.ppfg-instructions {
    width: 100%;
    max-width: 900px;
    margin: 30px auto 0;
    box-sizing: border-box;
    padding: 30px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.6;
    color: #50575e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.ppfg-instructions::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--pfg-primary), #4facfe);
}

.ppfg-instructions h3,
.ppfg-instructions h4 {
    margin-top: 0;
    color: #2c3338;
    font-weight: 700;
}

.ppfg-instructions p {
    margin: 0 0 12px 0;
}

.ppfg-instructions ul,
.ppfg-instructions ol {
    margin: 0 0 15px 20px;
    padding-left: 0;
}

.ppfg-instructions li {
    margin-bottom: 8px;
    position: relative;
}

/* Bullet point styling for unordered lists in instructions */
.ppfg-instructions ul li {
    list-style-type: none;
    padding-left: 20px;
}

.ppfg-instructions ul li::before {
    content: "•";
    color: var(--pfg-primary);
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
}

/* Success/Error messages */
.media-library-message {
    margin: 10px 0;
    padding: 12px 15px;
    border-radius: 4px;
    font-weight: 500;
    display: none;
}

.media-library-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.media-library-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}