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

.file-upload-zone {
    background-color: #0a0a0a;
    border: 2px dashed #374151;
    border-radius: 12px;
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    transition: all 150ms ease;
    position: relative;
    outline: none;
}

.file-upload-zone.has-error {
    border-color: #dc2626;
    background-color: #7f1d1d;
}

.upload-icon {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    opacity: 0.7;
    color: #6b7280;
    letter-spacing: 2px;
}

.upload-primary {
    font-size: 16px;
    font-weight: 400;
    color: #e5e7eb;
    margin-bottom: 4px;
}

.upload-secondary {
    font-size: 14px;
    font-weight: 400;
    color: #9ca3af;
}

.image-list-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.image-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.image-list-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #d1d5db;
}

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

.image-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background-color: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 6px;
    transition: border-color 150ms ease;
}

.image-list-item:hover {
    border-color: #4b5563;
}

.image-list-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background-color: #141414;
    border: 1px solid #374151;
}

.image-list-info {
    flex: 1;
    min-width: 0;
}

.image-list-name {
    font-size: 13px;
    color: #e5e7eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-list-dims {
    font-size: 12px;
    color: #9ca3af;
}

.image-list-remove {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: color 150ms ease;
    flex-shrink: 0;
}

.image-list-remove:hover {
    color: #ef4444;
}

.button-text {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 150ms ease;
}

.button-text:hover {
    color: #ef4444;
}

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

.settings-title {
    font-size: 18px;
    font-weight: 500;
    color: #d1d5db;
    margin-bottom: 4px;
}

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

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

.setting-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

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

.text-input {
    background-color: #141414;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 12px 16px;
    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);
}

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

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

input[type="number"].text-input {
    max-width: 120px;
    -moz-appearance: textfield;
}

input[type="number"].text-input::-webkit-outer-spin-button,
input[type="number"].text-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #e5e7eb;
    transition: opacity 150ms ease;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    background-color: #141414;
    border: 2px solid #374151;
    border-radius: 50%;
    position: relative;
    transition: all 150ms ease;
    flex-shrink: 0;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: #3b82f6;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    background-color: #3b82f6;
    border-radius: 50%;
}

.radio-label input[type="radio"]:disabled + .radio-custom {
    opacity: 0.5;
    cursor: not-allowed;
}

.radio-label input[type="radio"]:disabled ~ * {
    opacity: 0.5;
}

label.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #e5e7eb;
}

label.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 4px;
    position: relative;
    transition: all 150ms ease;
    flex-shrink: 0;
}

label.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

label.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 4px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

label.checkbox-label input[type="checkbox"]:disabled + .checkbox-custom {
    opacity: 0.5;
    cursor: not-allowed;
}

.pro-feature {
    position: relative;
    opacity: 0.6;
}

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

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

.pro-badge-inline {
    color: #0a0a0a;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
}

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

.button-download {
    background-color: #059669;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: center;
    width: 100%;
}

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

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

.output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.sprite-preview-container {
    background-color: #0a0a0a;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 16px;
    overflow: auto;
    max-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Checkerboard transparency background */
    background-image:
        linear-gradient(45deg, #1a1a1a 25%, transparent 25%),
        linear-gradient(-45deg, #1a1a1a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1a1a1a 75%),
        linear-gradient(-45deg, transparent 75%, #1a1a1a 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.sprite-preview-container canvas {
    max-width: 100%;
    height: auto;
    image-rendering: pixelated;
}

.sprite-dimensions {
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
}

.code-block-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.code-block {
    background-color: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 16px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #e5e7eb;
    overflow-x: auto;
    white-space: pre;
    max-height: 400px;
    overflow-y: auto;
    tab-size: 2;
}

.code-block .css-selector {
    color: #3b82f6;
}

.code-block .css-property {
    color: #a78bfa;
}

.code-block .css-value {
    color: #34d399;
}

.svg-warning {
    background-color: #78350f;
    border: 1px solid #d97706;
    color: #fde68a;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.individual-preview {
    background-color: #0a0a0a;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 24px;
    min-height: 100px;
}

.individual-preview-empty {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    padding: 24px 16px;
}

.individual-preview-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.individual-preview-canvas-wrap {
    flex-shrink: 0;
    background-image:
        linear-gradient(45deg, #1a1a1a 25%, transparent 25%),
        linear-gradient(-45deg, #1a1a1a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1a1a1a 75%),
        linear-gradient(-45deg, transparent 75%, #1a1a1a 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0;
    border: 1px solid #374151;
    border-radius: 6px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.individual-preview-canvas-wrap canvas {
    max-width: 80px;
    max-height: 80px;
    image-rendering: pixelated;
}

.individual-preview-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preview-class-name {
    font-size: 14px;
    font-weight: 600;
    color: #3b82f6;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
}

.preview-dimensions {
    font-size: 13px;
    color: #e5e7eb;
}

.preview-position {
    font-size: 13px;
    color: #9ca3af;
}

.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;
    transition: color 150ms ease;
}

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

.modal-content {
    padding: 24px;
}

.modal-feature-context {
    font-size: 14px;
    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;
}

.error-message {
    background-color: #7f1d1d;
    border: 1px solid #dc2626;
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 8px;
}

.success-message {
    background-color: #064e3b;
    border: 1px solid #059669;
    color: #6ee7b7;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 8px;
}

.copy-tooltip {
    font-size: 13px;
    color: #10b981;
    font-weight: 500;
}

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

.loading-text {
    font-size: 14px;
    color: #9ca3af;
}

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

    .settings-group {
        padding: 16px;
    }

    .output-section {
        padding: 16px;
    }

    .file-upload-zone {
        padding: 32px 16px;
    }

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

    .individual-preview-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .sprite-preview-container {
        max-height: 300px;
    }

    .code-block {
        max-height: 300px;
        font-size: 12px;
    }

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

        padding: 0 16px;
    }

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

    .image-list-item {
        padding: 8px 10px;
    }

    .image-list-thumb {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .image-list-dims {
        display: none;
    }

    .individual-preview {
        padding: 16px;
    }
}