/* 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: 24px;
}

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

.input-group > label {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

.canvas-container {
    width: 100%;
    aspect-ratio: 16 / 10;
    min-height: 480px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background-color: #111111;
    border: 1px solid #374151;
}

.canvas-container canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

.canvas-container canvas.grabbing {
    cursor: grabbing;
}

.point-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.point-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid #1a1a1a;
}

.point-row:last-child {
    border-bottom: none;
}

.point-number {
    font-size: 14px;
    font-weight: 600;
    color: #e5e7eb;
    min-width: 24px;
}

.point-color {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 2px solid #374151;
    background: transparent;
    cursor: pointer;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    transition: border-color 150ms ease;
}

.point-color:hover {
    border-color: #3b82f6;
}

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

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

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

.point-coords {
    font-size: 13px;
    color: #6b7280;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.point-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.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: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms ease;
    text-align: center;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

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

.output-header h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 28px;
    color: #d1d5db;
}

.output-note {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.code-block {
    background-color: #111111;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
}

.code-block code {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 13px;
    color: #e2e8f0;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.6;
}

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

.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #d1d5db;
}

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

.preset-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    transition: transform 150ms ease;
}

.preset-item:hover {
    transform: translateY(-2px);
}

.preset-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    border: 2px solid transparent;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    display: block;
}

.preset-item:hover .preset-thumb {
    border-color: #3b82f6;
}

.preset-item.active .preset-thumb {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.preset-name {
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    transition: color 150ms ease;
}

.preset-item:hover .preset-name {
    color: #e5e7eb;
}

.export-controls {
    display: flex;
    gap: 16px;
}

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

.export-field label {
    font-size: 13px;
    font-weight: 500;
    color: #9ca3af;
}

.export-field .text-input {
    width: 120px;
    text-align: center;
}

.text-input {
    background-color: #1a1a1a;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

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

.animation-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.setting-item > label {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

input[type="range"].slider {
    width: 100%;
    height: 4px;
    background-color: #374151;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    display: block;
}

input[type="range"].slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background-color: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"].slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background-color: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

input[type="range"].slider:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.direction-buttons {
    display: flex;
    gap: 8px;
}

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

.direction-btn:hover:not(.active) {
    border-color: #3b82f6;
}

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

.pro-cta-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    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;
    transition: color 150ms ease;
}

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

.modal-content {
    padding: 24px;
}

.modal-feature-context {
    font-size: 15px;
    color: #9ca3af;
    margin-bottom: 20px;
}

.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;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #374151;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: #374151;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #3b82f6;
    border-radius: 2px;
    width: 0%;
    transition: width 200ms ease;
}

.modal-hidden {
    display: none;
}

@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;
    }

    .output-section {
        padding: 16px;
    }

    .pro-panel {
        padding: 16px;
    }

        padding: 0 16px;
    }

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

@media (max-width: 640px) {
        font-size: 24px;
        line-height: 32px;
    }

    .canvas-container {
        min-height: 320px;
    }

    .preset-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

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

    .export-field .text-input {
        width: 100%;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .button-secondary,
    .point-controls .button-secondary {
        width: 100%;
        justify-content: center;
    }

    .direction-buttons {
        flex-direction: column;
    }

    .direction-btn {
        width: 100%;
        text-align: center;
    }

    .point-row {
        flex-wrap: wrap;
        gap: 8px;
    }
}