/**
 * ConvMaster - Placeholder Generator
 * 3-column layout matching mockup design
 * 
 * @version 1.2.0
 */

/* =====================================================
   TOOL PAGE
   ===================================================== */
.tool-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tool-header__icon .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    font-size: 2rem;
    border-radius: var(--radius-lg);
    background: rgba(6, 182, 212, 0.15);
}

.tool-header__text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--text-primary);
}

.tool-header__text p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* =====================================================
   MAIN WIDGET
   ===================================================== */
.placeholder-generator {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* =====================================================
   3-COLUMN LAYOUT
   ===================================================== */
.placeholder-generator__layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 480px;
}

@media (max-width: 1000px) {
    .placeholder-generator__layout {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   COLUMN 1: PREVIEW (Sticky)
   ===================================================== */
.pg-col--preview {
    background: var(--bg-tertiary);
    border-right: 1px solid var(--border-color);
    padding: 1rem;
}

@media (max-width: 1000px) {
    .pg-col--preview {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
}

.preview-sticky {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (max-width: 1000px) {
    .preview-sticky {
        position: relative;
        top: 0;
    }
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.preview-header__dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.preview-canvas-area {
    background: repeating-conic-gradient(#e0e0e0 0% 25%, #fff 0% 50%) 50% / 10px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80px;
    max-height: 150px;
    overflow: auto;
}

[data-theme="dark"] .preview-canvas-area {
    background: repeating-conic-gradient(#3a3a3a 0% 25%, #2a2a2a 0% 50%) 50% / 10px 10px;
}

.preview-canvas-area canvas {
    max-width: 100%;
    max-height: 130px;
    display: block;
}

.preview-dimensions {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    align-self: center;
}

.preview-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}

.btn-export {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-export:hover {
    border-color: var(--primary);
}

.btn-export--primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-export--primary:hover {
    background: var(--primary-dark);
}

.preview-quality {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.preview-quality label {
    color: var(--text-muted);
}

.preview-quality input[type="range"] {
    flex: 1;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    appearance: none;
    cursor: pointer;
}

.preview-quality input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.preview-quality span {
    min-width: 32px;
    font-weight: 600;
    color: var(--text-secondary);
}

.preview-codes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}

.btn-code {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-code:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.btn-code__icon {
    font-size: 0.8rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.btn-code__label {
    font-weight: 600;
}

.btn-code.copied {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.btn-code.copied .btn-code__icon {
    opacity: 1;
}

/* Message de confirmation inline */
.copy-message {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    border-radius: var(--radius-sm);
    background: var(--success);
    color: white;
    animation: slideIn 0.3s ease;
}

.copy-message.error {
    background: var(--error);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =====================================================
   COLUMN 2 & 3: CONTROLS GRID
   ===================================================== */
.pg-col--controls {
    padding: 1rem;
}

.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1rem;
    height: 100%;
}

@media (max-width: 800px) {
    .controls-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   CONTROL BLOCKS
   ===================================================== */
.ctrl-block {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.ctrl-block__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.ctrl-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

.ctrl-block__header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* =====================================================
   BLOCK 1: DIMENSIONS
   ===================================================== */
.ctrl-block--dimensions .ctrl-block__header {
    flex-wrap: nowrap;
}

.dimension-inputs {
    display: flex;
    align-items: flex-end;
    gap: 0.35rem;
    margin-left: auto;
}

.dim-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.dim-field label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-align: center;
}

.dim-field input {
    width: 60px;
    padding: 0.35rem 0.25rem;
    font-size: 0.8rem;
    text-align: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

.dim-field input:focus {
    outline: none;
    border-color: var(--primary);
}

.dim-x {
    font-size: 0.9rem;
    color: var(--text-muted);
    padding-bottom: 0.25rem;
}

.btn-lock {
    padding: 0.35rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-lock:hover,
.btn-lock.active {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-lock svg {
    display: block;
}

/* Presets Tabs */
.presets-tabs {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}

.preset-tab {
    padding: 0.35rem 0.65rem;
    font-size: 0.7rem;
    font-weight: 500;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-tab:hover {
    border-color: var(--primary);
}

.preset-tab--active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Presets Grid */
.presets-content {
    flex: 1;
}

.presets-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
}

.preset-btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 500;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.preset-btn:hover {
    border-color: var(--primary);
}

.preset-btn--active {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

/* =====================================================
   BLOCK 2: APPEARANCE
   ===================================================== */
.colors-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.color-field label {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.color-input {
    display: flex;
    gap: 0.35rem;
}

.color-input input[type="color"] {
    width: 32px;
    height: 28px;
    padding: 2px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: transparent;
}

.color-input input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-input input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

.color-input input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 0.3rem 0.4rem;
    font-size: 0.7rem;
    font-family: monospace;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

.color-input input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
}

/* Style Options */
.style-field {
    margin-bottom: 0.6rem;
}

.style-field > label {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.style-options {
    display: flex;
    gap: 0.5rem;
}

.style-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    cursor: pointer;
}

.style-opt input {
    position: absolute;
    opacity: 0;
}

.style-box {
    width: 36px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.style-opt input:checked + .style-box {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.style-box--solid { background: #cccccc; }
.style-box--stripes { background: repeating-linear-gradient(45deg, #ccc, #ccc 2px, #999 2px, #999 4px); }
.style-box--grid { background: linear-gradient(#999 1px, transparent 1px), linear-gradient(90deg, #999 1px, transparent 1px), #ccc; background-size: 5px 5px; }
.style-box--gradient { background: linear-gradient(135deg, #ccc 0%, #888 100%); }

.style-label {
    font-size: 0.55rem;
    color: var(--text-muted);
}

.style-opt input:checked ~ .style-label {
    color: var(--primary);
}

/* Checkbox */
.checkbox-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
}

.checkbox-field input {
    position: absolute;
    opacity: 0;
}

.checkbox-field .checkmark {
    width: 16px;
    height: 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 3px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-field input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-field input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 7px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* =====================================================
   BLOCK 3: TEXT
   ===================================================== */
.text-input-row {
    margin-bottom: 0.75rem;
}

.text-input-row label {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.text-input-row input {
    width: 100%;
    padding: 0.5rem 0.6rem;
    font-size: 0.8rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

.text-input-row input:focus {
    outline: none;
    border-color: var(--primary);
}

.text-input-row .hint {
    display: block;
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.text-options-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: end;
}

.font-field label,
.size-field label {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.font-field select {
    width: 100%;
    padding: 0.4rem 1.5rem 0.4rem 0.5rem;
    font-size: 0.8rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23666' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    cursor: pointer;
}

.font-field select:focus {
    outline: none;
    border-color: var(--primary);
}

[data-theme="dark"] .font-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23aaa' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
}

.size-input {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.auto-check {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.auto-check input {
    width: 14px;
    height: 14px;
    accent-color: var(--primary);
}

.size-input input[type="number"] {
    width: 50px;
    padding: 0.35rem;
    font-size: 0.75rem;
    text-align: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

.size-input input[type="number"]:disabled {
    opacity: 0.5;
}

/* =====================================================
   BLOCK 4: LOGO
   ===================================================== */
.logo-dropzone {
    flex: 1;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
    min-height: 100px;
}

.logo-dropzone:hover {
    border-color: var(--primary);
}

.logo-dropzone.dragover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.logo-dropzone__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    text-align: center;
    padding: 1rem;
}

.logo-dropzone__icon {
    font-size: 2rem;
}

.logo-dropzone__text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.logo-dropzone__hint {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.logo-dropzone__preview {
    position: relative;
    padding: 0.5rem;
}

.logo-dropzone__preview img {
    max-width: 120px;
    max-height: 80px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.logo-remove {
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-sliders {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.slider-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slider-field label {
    font-size: 0.7rem;
    color: var(--text-primary);
    min-width: 50px;
}

.slider-field input[type="range"] {
    flex: 1;
    height: 4px;
    background: var(--bg-card);
    border-radius: 2px;
    appearance: none;
    cursor: pointer;
}

.slider-field input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
}

.slider-field span {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 30px;
    text-align: right;
}

/* =====================================================
   HIDDEN
   ===================================================== */
[hidden] {
    display: none !important;
}

/* =====================================================
   LIGHT THEME ADJUSTMENTS
   ===================================================== */
[data-theme="light"] .ctrl-block {
    background: var(--bg-secondary);
}

[data-theme="light"] .pg-col--preview {
    background: var(--bg-secondary);
}

[data-theme="light"] .preset-btn {
    background: var(--bg-primary);
}

[data-theme="light"] .logo-dropzone {
    background: var(--bg-primary);
}

[data-theme="light"] .dim-field input,
[data-theme="light"] .color-input input[type="text"],
[data-theme="light"] .text-input-row input,
[data-theme="light"] .font-field select,
[data-theme="light"] .size-input input[type="number"] {
    background: var(--bg-primary);
}

/* =====================================================
   SEO CONTENT
   ===================================================== */
.tool-content {
    margin-top: 3rem;
}

.tool-section {
    margin-bottom: 2.5rem;
}

.tool-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.tool-section p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.features-grid,
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.feature-card,
.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
}

.feature-card__icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
}

.step-card__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 0.75rem;
}

.feature-card h3,
.step-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.feature-card p,
.step-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.faq-item summary {
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
}

.faq-item summary::after {
    content: '+';
    float: right;
    font-size: 1.25rem;
    color: var(--text-muted);
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item p {
    padding: 0 1.5rem 1rem;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.7;
}
