/* === WhatsApp DP Cropper Specific CSS === */
:root {
    --wc-bg: #f8fafc;
    --wc-primary: #0066cc; /* Brand Blue */
    --wc-primary-dark: #004d99;
    --wc-secondary: #00bcd4; /* Brand Cyan */
    --wc-gradient: linear-gradient(135deg, var(--wc-primary), var(--wc-secondary));
    --wc-surface: #ffffff;
    --wc-text: #1a1a1a;
    --wc-text-light: #52565e;
    --wc-border: #e2e8f0;
    --wc-radius: 12px;
}

/* Wrapper to scope styles */
.wp-cropper-wrapper {
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--wc-text);
}

/* Tool Main Container */
.tool-box-container {
    background-color: var(--wc-surface);
    padding: 30px;
    border-radius: var(--wc-radius);
    width: 100%;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: relative;
    max-width: 1000px;
}

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

.tool-header h1 {
    font-size: 28px;
    font-weight: 700;
    background: var(--wc-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.tool-header h5 {
    color: var(--wc-text-light);
    font-size: 16px;
    font-weight: 500;
}

/* Upload Section */
.upload-section {
    text-align: center;
    margin: 25px 0;
}

.file-input {
    display: none;
}

.choose-img {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 30px;
    background: var(--wc-gradient);
    color: white;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.2);
}

.choose-img:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.3);
}

/* Editor Layout */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

@media (min-width: 1024px) {
    .main-content {
        flex-direction: row;
    }
    .editor-section, .filters-section {
        flex: 1;
    }
}

/* Canvas Area */
.preview-img {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f1f5f9;
    border-radius: var(--wc-radius);
    padding: 20px;
    min-height: 300px;
    border: 2px dashed var(--wc-border);
}

#canvas {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

#croppie-c { display: none; }
body.croppie-active #canvas { display: none; }
body.croppie-active #croppie-c { display: block; width: 100%; }

/* Controls (Sliders) */
.controls {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--wc-text-light);
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 5px;
    -webkit-appearance: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--wc-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Filter Buttons */
.filters-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--wc-text);
    margin-bottom: 10px;
    border-bottom: 2px solid var(--wc-border);
    padding-bottom: 10px;
}

.filter-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}

.filter-btn {
    padding: 10px;
    border: 1px solid var(--wc-border);
    background: white;
    color: var(--wc-text-light);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.filter-btn:hover {
    background: #f8fafc;
    border-color: var(--wc-primary);
    color: var(--wc-primary);
}

.filter-btn.active {
    background: var(--wc-primary);
    color: white;
    border-color: var(--wc-primary);
}

/* Advanced Options (Switches) */
.advanced-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
}

.checkbox-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider-switch {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}

.slider-switch:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider-switch {
    background-color: var(--wc-primary);
}

input:checked + .slider-switch:before {
    transform: translateX(20px);
}

/* Color Controls */
#color-controls.hidden { display: none; }
#color-controls {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#color-picker {
    width: 100%;
    height: 40px;
    border: 1px solid var(--wc-border);
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
}

.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--wc-border);
}

/* Download Button */
.save-btn {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: 700;
    color: white;
    background: var(--wc-gradient);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 10px rgba(0, 102, 204, 0.2);
    margin-top: 10px;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 102, 204, 0.3);
}

/* Content Cards */
.content-card {
    background: white;
    padding: 30px;
    border-radius: var(--wc-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid var(--wc-border);
}

.content-card h2 {
    color: var(--wc-primary);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 15px;
}

.content-card p, .content-card li {
    line-height: 1.7;
    color: var(--wc-text-light);
    margin-bottom: 10px;
}

.feature-list, .steps-list {
    padding-left: 20px;
}

.feature-list li { list-style: disc; }
.steps-list li { list-style: decimal; }

/* FAQ Styles */
.faq-item {
    border-bottom: 1px solid var(--wc-border);
}
.faq-question {
    cursor: pointer;
    padding: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--wc-text);
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0;
}
.faq-answer.active {
    max-height: 300px;
    padding-bottom: 15px;
}

/* Loading Spinner */
#loading-spinner {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 50;
    border-radius: var(--wc-radius);
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--wc-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Notification */
#copyMessageBox {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 1000;
}