/* Tool-specific styles only - base styles are in tool-layout.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #0a0a0a;
    color: #e5e7eb;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #141414;
    border-bottom: 1px solid #374151;
    z-index: 100;
}

    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

    margin-top: 60px;
    padding: 48px 24px;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    max-width: 720px;
    margin: 0 auto;
}

.tool-main {
    flex: 1;
    padding: 32px 24px 120px;
}

.tool-container {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-heading {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.section-hint {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
}

.template-group-label {
    font-size: 14px;
    font-weight: 500;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
    margin-bottom: 4px;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.template-card {
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    transition: all 150ms ease;
    text-align: center;
    overflow: hidden;
    position: relative;
    font-family: inherit;
    color: inherit;
}

.template-card:hover {
    border-color: #4b5563;
    background-color: #1a1a1a;
}

.template-card.active {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}

.template-card .pro-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}

.template-card-preview {
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-thumb {
    width: 100%;
    height: 64px;
    border-radius: 4px;
    background-color: #1a1a1a;
}

.thumb-newsletter {
    background: linear-gradient(180deg,
        #3b82f6 0%, #3b82f6 25%,
        #ffffff 25%, #ffffff 50%,
        #e5e7eb 50%, #e5e7eb 55%,
        #ffffff 55%, #ffffff 80%,
        #f4f4f4 80%, #f4f4f4 100%);
}

.thumb-announcement {
    background: linear-gradient(180deg,
        #3b82f6 0%, #3b82f6 30%,
        #ffffff 30%, #ffffff 70%,
        #3b82f6 70%, #3b82f6 80%,
        #f4f4f4 80%, #f4f4f4 100%);
}

.thumb-welcome {
    background: linear-gradient(180deg,
        #3b82f6 0%, #3b82f6 20%,
        #ffffff 20%, #ffffff 50%,
        #3b82f6 50%, #3b82f6 60%,
        #ffffff 60%, #ffffff 80%,
        #f4f4f4 80%, #f4f4f4 100%);
}

.thumb-promotion {
    background: linear-gradient(180deg,
        #3b82f6 0%, #3b82f6 20%,
        #ffffff 20%, #ffffff 40%,
        #3b82f6 40%, #3b82f6 50%,
        #e5e7eb 50%, #e5e7eb 55%,
        #ffffff 55%, #ffffff 75%,
        #3b82f6 75%, #3b82f6 85%,
        #f4f4f4 85%, #f4f4f4 100%);
}

.thumb-simple {
    background: linear-gradient(180deg,
        #ffffff 0%, #ffffff 60%,
        #3b82f6 60%, #3b82f6 72%,
        #f4f4f4 72%, #f4f4f4 100%);
}

.thumb-pro {
    background: linear-gradient(135deg, #1a1a2e 0%, #2a2a4e 50%, #3b82f6 100%);
}

.template-card-name {
    display: block;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #d1d5db;
    border-top: 1px solid #374151;
}

.pro-template {
    opacity: 0.7;
}

.pro-template:hover {
    opacity: 0.85;
}

.pro-template.unlocked {
    opacity: 1;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 24px;
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.setting-item > label {
    font-size: 13px;
    font-weight: 500;
    color: #9ca3af;
}

.setting-item-full {
    grid-column: 1 / -1;
}

.color-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-picker {
    width: 36px;
    height: 36px;
    border: 1px solid #374151;
    border-radius: 6px;
    background: none;
    cursor: pointer;
    padding: 2px;
    flex-shrink: 0;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.color-picker::-moz-color-swatch {
    border: none;
    border-radius: 4px;
}

.color-text-input {
    background-color: #1a1a1a;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    outline: none;
    width: 80px;
}

.color-text-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.text-input {
    background-color: #141414;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    width: 100%;
}

.text-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.text-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.text-input::placeholder {
    color: #6b7280;
}

.textarea-input {
    background-color: #141414;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    width: 100%;
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.textarea-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.textarea-input::placeholder {
    color: #6b7280;
}

.select-input {
    background-color: #141414;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 10px 36px 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.select-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.select-input option {
    background-color: #1a1a1a;
}

.pro-option {
    color: #f59e0b;
}

.sections-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.section-block {
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.section-block:hover {
    border-color: #4b5563;
}

.section-block.dragging {
    opacity: 0.4;
    border-color: #3b82f6;
}

.section-block.drag-over-top {
    box-shadow: 0 -2px 0 0 #3b82f6;
}

.section-block.drag-over-bottom {
    box-shadow: 0 2px 0 0 #3b82f6;
}

.section-block.expanded .section-block-body {
    display: flex;
}

.pro-section {
    border-color: #4b3a1a;
}

.pro-section:hover {
    border-color: #6b5a2a;
}

.section-block-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    transition: background-color 150ms ease;
}

.section-block-header:hover {
    background-color: #1a1a1a;
}

.drag-handle {
    font-size: 16px;
    color: #6b7280;
    cursor: grab;
    padding: 4px;
    min-width: 24px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 150ms ease;
}

.drag-handle:hover {
    color: #9ca3af;
}

.drag-handle:active {
    cursor: grabbing;
}

.section-type-label {
    font-size: 14px;
    font-weight: 500;
    color: #d1d5db;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-block-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.btn-duplicate,
.btn-delete {
    background: none;
    border: 1px solid transparent;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 150ms ease;
    font-family: inherit;
}

.btn-duplicate:hover {
    color: #9ca3af;
    border-color: #374151;
    background-color: #1a1a1a;
}

.btn-delete:hover {
    color: #ef4444;
    border-color: #7f1d1d;
    background-color: #1a0a0a;
}

.section-block-body {
    display: none;
    flex-direction: column;
    gap: 14px;
    padding: 0 16px 16px;
    border-top: 1px solid #2a2a2a;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-group > label {
    font-size: 13px;
    font-weight: 500;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 6px;
}

.field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.align-toggle {
    display: flex;
    gap: 0;
    border: 1px solid #374151;
    border-radius: 6px;
    overflow: hidden;
    width: fit-content;
}

.align-btn {
    background-color: #141414;
    border: none;
    border-right: 1px solid #374151;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    padding: 8px 14px;
    cursor: pointer;
    transition: all 150ms ease;
    min-width: 36px;
}

.align-btn:last-child {
    border-right: none;
}

.align-btn:hover {
    color: #d1d5db;
    background-color: #1a1a1a;
}

.align-btn.active {
    background-color: #3b82f6;
    color: #ffffff;
}

.image-upload-zone {
    background-color: #0a0a0a;
    border: 2px dashed #374151;
    border-radius: 8px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 150ms ease;
    outline: none;
    position: relative;
    overflow: hidden;
}

.image-upload-zone:hover,
.image-upload-zone:focus-visible {
    border-color: #3b82f6;
    background-color: #0f1a30;
}

.image-upload-zone.has-image {
    border-style: solid;
    padding: 8px;
}

.image-upload-zone.has-image img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
    border-radius: 4px;
}

.upload-placeholder {
    font-size: 13px;
    color: #6b7280;
}

.file-input-hidden {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.btn-remove-image {
    background: none;
    border: 1px solid #374151;
    color: #ef4444;
    font-size: 12px;
    font-family: inherit;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 150ms ease;
    margin-top: 4px;
}

.btn-remove-image:hover {
    background-color: #1a0a0a;
    border-color: #7f1d1d;
}

.pro-field {
    opacity: 0.5;
    pointer-events: none;
}

.pro-field.unlocked {
    opacity: 1;
    pointer-events: auto;
}

.divider-line-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.add-section-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.add-section-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.add-section-row .select-input {
    flex: 1;
}

.add-section-row .button-secondary {
    white-space: nowrap;
    flex-shrink: 0;
}

.pro-add-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pro-feature-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.columns-options {
    display: flex;
    gap: 8px;
}

.button-small {
    background-color: #1a1a1a;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms ease;
}

.button-small:hover {
    background-color: #374151;
}

.columns-editor {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
}

.column-editor {
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: 12px;
}

.column-editor-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.column-editor .field-group {
    margin-bottom: 10px;
}

.column-editor .field-group:last-child {
    margin-bottom: 0;
}

.pro-badge {
    color: #0a0a0a;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    line-height: 1.4;
}

.pro-badge-inline {
    color: #0a0a0a;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 1px 5px;
    border-radius: 3px;
    flex-shrink: 0;
    vertical-align: middle;
    line-height: 1.4;
}

.output-section {
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.output-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.output-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.preview-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.preview-mode-toggle,
.client-preview-toggle {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #374151;
    border-radius: 6px;
    overflow: hidden;
}

.client-preview-toggle {
    gap: 0;
}

.client-preview-toggle .pro-badge-inline {
    margin: 0 6px 0 8px;
}

.pro-feature-group {
    opacity: 0.5;
    pointer-events: none;
}

.pro-feature-group.unlocked {
    opacity: 1;
    pointer-events: auto;
}

.toggle-btn {
    background-color: #1a1a1a;
    border: none;
    border-right: 1px solid #374151;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 150ms ease;
    white-space: nowrap;
}

.toggle-btn:last-child {
    border-right: none;
}

.toggle-btn:hover {
    color: #d1d5db;
    background-color: #252525;
}

.toggle-btn.active {
    background-color: #3b82f6;
    color: #ffffff;
}

.client-label {
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
    padding: 6px 12px;
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    text-align: center;
}

.client-label span {
    color: #3b82f6;
    font-weight: 600;
}

.preview-container {
    background-color: #e5e7eb;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: center;
    overflow-x: auto;
    min-height: 300px;
}

.preview-container iframe {
    border: none;
    width: 600px;
    min-height: 400px;
    border-radius: 4px;
    transition: width 300ms ease;
}

.preview-container.mobile iframe {
    width: 375px;
}

.export-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.source-toggle {
    background: none;
    border: 1px solid #374151;
    color: #d1d5db;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.source-toggle:hover {
    background-color: #1a1a1a;
    border-color: #4b5563;
}

.toggle-arrow {
    font-size: 12px;
    transition: transform 200ms ease;
}

.source-toggle[aria-expanded="true"] .toggle-arrow {
    transform: rotate(180deg);
}

.source-panel {
    background-color: #0a0a0a;
    border: 1px solid #374151;
    border-radius: 6px;
    overflow: hidden;
}

.source-code {
    padding: 16px;
    margin: 0;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.source-code code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #9ca3af;
    white-space: pre;
    display: block;
}

.button-primary {
    background-color: #3b82f6;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: center;
}

.button-primary.copied {
    background-color: #059669;
}

.button-secondary {
    background-color: #1a1a1a;
    color: #e5e7eb;
    border: 1px solid #374151;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: center;
}

.pro-cta-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.pro-cta-text {
    font-size: 14px;
    color: #d1d5db;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 24px;
}

.modal-overlay.modal-hidden {
    display: none;
}

.modal-overlay.modal-visible {
    display: flex;
}

.modal {
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 0;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
}

.modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #e5e7eb;
}

.modal-content {
    padding: 24px;
}

.pro-features-list {
    margin-bottom: 24px;
}

.pro-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.feature-check {
    width: 20px;
    height: 20px;
    background-color: #059669;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.feature-text {
    font-size: 15px;
    color: #e5e7eb;
}

.modal-cta {
    width: 100%;
    display: block;
}

.footer {
    background-color: #0a0a0a;
    border-top: 1px solid #374151;
    padding: 32px 24px;
    text-align: center;
    margin-top: auto;
}

.footer p {
    font-size: 14px;
    color: #6b7280;
}

@media (max-width: 768px) {
        padding: 32px 16px;
    }

        font-size: 28px;
        line-height: 36px;
    }

        font-size: 14px;
    }

    .tool-main {
        padding: 24px 16px 100px;
    }

    .tool-container {
        gap: 32px;
    }

    .template-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .settings-grid {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .setting-item-full {
        grid-column: 1;
    }

    .output-section {
        padding: 16px;
    }

    .preview-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .preview-mode-toggle,
    .client-preview-toggle {
        width: 100%;
    }

    .toggle-btn {
        flex: 1;
        text-align: center;
        padding: 8px 10px;
    }

    .preview-container {
        padding: 8px;
    }

    .preview-container iframe {
        width: 100%;
    }

    .field-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .add-section-row {
        flex-direction: column;
    }

    .add-section-row .select-input,
    .add-section-row .button-secondary {
        width: 100%;
    }

    .export-actions {
        flex-direction: column;
    }

    .button-primary,
    .button-secondary {
        width: 100%;
    }

    .pro-cta-content {
        flex-direction: column;
        gap: 10px;
    }

        padding: 0 16px;
    }

    .section-block-header {
        padding: 10px 12px;
    }

    .section-block-body {
        padding: 0 12px 12px;
    }

    .drag-handle {
        min-height: 44px;
        min-width: 44px;
    }
}

@media (max-width: 480px) {
    .template-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .template-thumb {
        height: 48px;
    }

    .template-card-name {
        font-size: 12px;
        padding: 6px 8px;
    }

    .columns-options {
        flex-direction: column;
    }
}