:root {
    --bg: #FAFBF6;
    --surface: #fff;
    --text: #313A19;
    --accent: #9DB755;
    --border: #cfdad1;
    --grey: #687169;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    margin-bottom: 20px;
}

.header-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    justify-content: space-between;
}

.header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.header-title-group {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    color: var(--text);
    font-size: 2rem;
}

h1 {
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

h1 .icon-box {
    background: var(--accent);
    color: white;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

h1 .icon-box svg {
    width: 25px;
    height: 25px;
}

h2 {
    color: var(--grey);
    font-size: 1.2rem !important;
    font-weight: 300;
    margin: .55rem 0 0 0;
    font-family: "Shantell Sans", cursive;
}

.subtitle {
    color: var(--grey);
    font-size: 1rem;
    font-weight: 400;
}

.premium-badge {
    background: var(--accent);
    color: white;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 400;
}

.unlock-box {
    background-color: #f1f7e9;
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 12px 15px;
    display: grid;
    max-width: 400px;
    grid-template-columns: 1fr auto;
    gap: 1.3rem;
    align-items: start;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.unlock-box-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.unlock-box-right {
    padding-top: 3px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: left;
}

.unlock-box-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.unlock-btn {
    background: linear-gradient(135deg, var(--accent) 0%, #6e8b3d 100%);
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.unlock-btn:hover {
    background: #445626;
}

.unlock-features {
    font-size: 10px;
    color: var(--grey);
    line-height: 1.5;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.redeem-link {
    color: var(--grey);
    font-size: 10px;
    text-decoration: none;
    text-align: center;
}

.redeem-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
}

.modal-content h3 {
    margin-bottom: 10px;
    font-size: 20px;
}

.modal-content p {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 15px;
}

.modal-buttons {
    text-align: center;
    display: flex;
    gap: 10px;
}

.modal-buttons button {
    flex: 1;
    justify-content: center;
}

.main-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    align-items: start;
}

.controls {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 20px;
}

.tool-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.tool-group button {
    width: 100%;
    justify-content: center;
    padding: 12px;
}

.text-tool-wrapper {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: center;
    background-color: var(--bg);
    padding: .4rem;
    border-radius: 8px;
}

.select-tool-wrapper {
    grid-column: 1 / -1;
}

#strokeWidthValue {
    text-align:center;
}

.controls p {
    color: var(--grey);
    font-size: .75rem;
    margin: 0;
}

.controls p code {
    margin-left: .3rem;
    padding: .2rem .5rem;
    font-size: .3rem;
    background-color: var(--bg);
    border: 1px solid var(--border);
    display: inline-flex;
    flex-direction: row;
    gap: .3rem;
    align-items: center;
}

.controls h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: -10px;
}

button {
    padding: 10px 28px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

button:hover {
    background: #f5f5f5;
    border-color: var(--text);
}

button.active {
    background: var(--text);
    color: var(--surface);
    border-color: var(--text);
}

button.premium-tool {
    opacity: 0.5;
    position: relative;
}

button.premium-tool:disabled {
    cursor: not-allowed;
}

button.premium-tool.premium-locked:disabled::after {
    content: "Pro";
    position: absolute;
    top: -1px;
    right: 0px;
    background: var(--grey);
    color: white;
    font-size: 8px;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 0px;
    line-height: 1;
}

button.premium-tool:not(:disabled) {
    opacity: 1;
}

.aspect-ratio-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.aspect-btn {
    padding: 8px 12px;
    font-size: 12px;
}

.canvas-container {
    background: repeating-linear-gradient(-45deg,
            rgb(from var(--accent) r g b / 0.001) 0,
            rgb(from var(--accent) r g b / 0.001) 10px,
            var(--surface) 10px,
            var(--surface) 20px);
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.canvas-container:hover {
    border-color: var(--accent);
}

.canvas-container.has-image {
    border-style: solid;
    cursor: default;
}

.canvas-container.has-image:hover {
    border-color: var(--border);
    background: var(--surface);
}

.canvas-content {
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.canvas-content svg {
    color: var(--accent);
    opacity: 0.5;
}

#canvas {
    border: 1px solid var(--border);
    cursor: crosshair;
    max-width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#canvas.select-mode {
    cursor: grab;
}

#canvas.grabbing-mode {
    cursor: grabbing;
}

.canvas-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.download-section {
    display: flex;
    gap: 10px;
}

.download-section:has(#copyBtn) {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.download-btn {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    padding: 12px 16px;
    font-weight: 600;
    min-width: 0;
    justify-content: center;
}

.download-btn svg {
    flex-shrink: 0;
}

.download-btn:hover {
    background: var(--text);
    border-color: var(--text);
}

.download-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.clear-btn {
    background: transparent;
    color: var(--text);
}

.empty-state {
    text-align: center;
    color: var(--grey);
    font-size: 14px;
    display: block;
    line-height: 1.4;
}

.empty-state span {
    font-size: 12px;
}

.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.slider-wrapper:has(.color-picker-item) {
    gap: 1.5rem;
}

.slider-wrapper.premium-locked {
    opacity: 0.5;
    position: relative;
    cursor: not-allowed;
}

.slider-wrapper.premium-locked::after {
    content: "Pro";
    position: absolute;
    top: 0%;
    right: 0;
    background: var(--grey);
    color: white;
    font-size: 8px;
    font-weight: 600;
    padding: 2px 4px;
    line-height: 1;
}

.slider-wrapper.premium-locked input[type="range"] {
    cursor: not-allowed;
}

.slider-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.slider-wrapper label, .text-tool-wrapper label:not(.toggle-switch) {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    width: 55px;
    flex-shrink: 0;
}

.slider-wrapper label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
}

.slider-wrapper input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.slider-wrapper input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.slider-wrapper span {
    white-space: nowrap;
    flex-shrink: 0;
    width: 35px;
    font-size: 12px;
    text-align: right;
}

input[type="color"] {
    width: 30px;
    height: 30px;
    border: 1px solid white;
    border-radius: 4px;
    cursor: pointer;
    background-color: white;
}

.size-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    justify-content: flex-start;
    width: fit-content;
    justify-self: start;
}

.toggle-switch {
    position: relative;
    width: 32px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    flex-shrink: 0;
    cursor: pointer;
    padding: 2px;
}

.toggle-switch input {
    display: none;
}

.toggle-switch .knob {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--grey);
    border-radius: 50%;
    left: 2px;
    top: 2px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.toggle-switch input:checked ~ .knob {
    transform: translateX(14px);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 2px;
    background: var(--grey);
    cursor: pointer;
    max-width: 115px;
}

input[type="range"]::-webkit-slider-track {
    background: var(--border);
    height: 6px;
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: var(--grey);
    height: 14px;
    width: 14px;
    border-radius: 50%;
    margin-top: -1px;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--text);
}

input[type="range"]::-moz-range-track {
    background: var(--border);
    height: 6px;
    border-radius: 3px;
}

input[type="range"]::-moz-range-thumb {
    background: var(--grey);
    height: 18px;
    width: 18px;
    border-radius: 50%;
    border: none;
}

input[type="range"]::-moz-range-thumb:hover {
    background: var(--text);
}

.delete-btn {
    position: absolute;
    background: #6e6e6e;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.delete-btn:hover {
    background: #dd3333;
}

ul.features {
 
    font-size: 11px;
    color: var(--text);
    list-style: none;
}

ul.features li {
    position: relative;
    padding-left: 15px;
}

ul.features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    width: 11px;
    height: 11px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%237c9d45" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>');
    background-size: contain;
    background-repeat: no-repeat;
}


footer {
    text-align: left;
    padding: 20px 0;
    color: var(--grey);
    font-size: 0.75rem;
}

footer a {
    text-decoration: none;
    color: var(--grey);
}

footer a:hover {
    text-decoration: none;
    color: var(--accent);
}

/* Content page specific styles */
.content-page {
    max-width: 800px;
    margin: 5rem auto;
}

.content-page h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.content-page h2 {
    font-size: 1.5rem !important;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.content-page h3 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.content-page p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.content-page strong {
    color: var(--text);
    font-weight: 600;
}

.content-page ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.content-page li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        max-width: 100%;
    }

    header {
        margin-bottom: 15px;
        padding: 1rem;
    }

    .header-row {
        flex-direction: column;
        align-items: start;
        gap: 1rem;
    }

    .header-left {
        width: 100%;
    }

    .header-title-group {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }

    .header-right {
        width: 100%;
        align-items: flex-start !important;
    }

    h1 {
        font-size: 1.5rem;
    }

    h1 .icon-box {
        width: 28px;
        height: 28px;
    }

    h1 .icon-box svg {
        width: 16px;
        height: 16px;
    }

    h2 {
        font-size: 1.1rem !important;
        margin-left: 0;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    .main-content {
        grid-template-columns: 1fr;
    }

    .controls {
        padding: 15px;
        gap: 15px;
        position: static;
    }

    .tool-group {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .tool-group button {
        width: auto;
        flex: 1;
        min-width: 80px;
    }



    .text-tool-wrapper,
    .select-tool-wrapper {
        width: 100%;
    }

    .select-tool-wrapper button {
        width: 100%;
    }

    button {
        padding: 8px 8px;
        font-size: 13px;
    }

    .aspect-ratio-group {
        grid-template-columns: repeat(3, 1fr);
    }

    .aspect-btn {
        padding: 8px;
        font-size: 12px;
    }

    .canvas-container {
        padding: 20px;
        min-height: 300px;
    }

    .download-section {
        flex-direction: column;
        gap: 10px;
    }

    .download-btn,
    .clear-btn {
        width: 100%;
        justify-content: center;
    }

    .content-page h1 {
        font-size: 1.75rem;
    }

    .content-page h2 {
        font-size: 1.3rem !important;
    }

    .content-page h3 {
        font-size: 1.1rem;
    }
}
