* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Helvetica Neue", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.app-container {
    display: flex;
    gap: 2rem;
    width: 100%;
    max-width: 1600px;
    height: calc(100vh - 4rem);
    padding-right: 0;
}

.canvas-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0 2rem 2rem;
    overflow: hidden;
}

.poster-canvas {
    background: white;
    width: auto;
    height: 800px;
    aspect-ratio: 1/1;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.poster-canvas.inverted {
    background: black;
}

.poster-canvas[data-ratio="1350x1080"] {
    aspect-ratio: 1080/1350;
}

.poster-canvas[data-ratio="story"] {
    aspect-ratio: 9/16;
}

.poster-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.poster-background canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    transform: none;
}

/* Remove the old background patterns */
.poster-background::before {
    display: none;
}

.poster-content {
    position: relative;
    z-index: 2;
    padding: 4rem 4rem 4rem 2rem;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    font-family: "Helvetica Neue", sans-serif;
    font-weight: 700;
    justify-content: space-between;
    color: black;
    mix-blend-mode: normal;
}

.poster-canvas.inverted .poster-content {
    color: white;
}

.poster-canvas.show-labels .content-label {
    opacity: 1;
}

.poster-canvas.inverted.show-labels .content-label {
    opacity: 1;
}

.poster-content h1 {
    font-size: 3.825rem;
    font-weight: 700;
    font-family: "Helvetica Neue", sans-serif;
    letter-spacing: -0.04em;
    margin: 0;
}

.poster-content p {
    font-size: 1.275rem;
    line-height: 1.5;
    font-family: "Helvetica Neue", sans-serif;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin: 0;
}

/* Toggle Switch Styles */
.toggle-container {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e0e0e0;
}

.toggle-container.no-border {
    border-top: none;
    padding-top: 0;
    margin-top: 4px;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 4px;
}

.toggle input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: #e0e0e0;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
}

.toggle input:checked + .toggle-slider {
    background: #000;
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(16px);
}

.toggle-label {
    font-size: 0.875rem;
    color: #444;
}

.sidebar {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    width: 400px;
    min-width: 400px;
    height: 100%;
    overflow-y: auto;
    margin-right: 2rem;
}

.input-section {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: normal;
    color: #444444;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.input-group textarea {
    height: 50px;
    resize: vertical;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #000;
}

.controls-section {
    border-top: 1px solid #e0e0e0;
    padding-top: 1rem;
    margin-top: 1rem;
}

.controls-section:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.controls-section h3 {
    font-size: 0.75rem;
    color: #444;
    margin-bottom: 1rem;
    text-transform: none;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.ratio-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ratio-btn {
    position: relative;
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shape-icon {
    width: 24px;
    height: 24px;
    border: 2px solid currentColor;
    transition: all 0.2s;
}

.shape-icon.square {
    width: 20px;
    height: 20px;
}

.shape-icon.rectangle {
    width: 16px;
    height: 20px;
}

.shape-icon.story {
    width: 14px;
    height: 24px;
}

.ratio-label {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: black;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.ratio-btn:hover .ratio-label {
    opacity: 1;
}

.ratio-btn.active {
    background: #000;
    color: white;
    border-color: #000;
}

.ratio-btn:hover {
    background: #f5f5f5;
}

.ratio-btn.active:hover {
    background: #000;
}

.orientation-buttons {
    display: none;
}

@media (max-width: 1200px) {
    .app-container {
        flex-direction: column;
        height: auto;
        padding: 0;
    }
    
    .sidebar {
        width: 100%;
        min-width: 0;
        margin-right: 0;
        border-radius: 0;
    }
    
    .canvas-container {
        padding: 1rem;
        height: auto;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .poster-canvas {
        width: 100%;
        max-width: min(90vw, 90vh);
        height: auto;
        aspect-ratio: var(--poster-ratio, 1/1);
    }

    .poster-canvas[data-ratio="1350x1080"] {
        --poster-ratio: 1080/1350;
    }

    .poster-canvas[data-ratio="story"] {
        --poster-ratio: 9/16;
    }
}

@media (max-width: 600px) {
    body {
        padding: 0;
    }

    .app-container {
        max-width: 100%;
    }

    .canvas-container {
        padding: 0.5rem;
        min-height: 50vh;
    }

    .poster-canvas {
        max-width: min(95vw, 70vh);
    }

    .poster-content {
        padding: 2rem 2rem 2rem 1rem;
    }

    .poster-content h1 {
        font-size: 2.5rem;
    }

    .poster-content p {
        font-size: 0.875rem;
    }

    .content-label {
        margin-left: -0.5rem;
    }
}

/* Background Controls */
.background-controls {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.background-controls h3 {
    font-size: 0.75rem;
    color: #444;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.background-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.background-btn {
    position: relative;
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-icon {
    width: 24px;
    height: 24px;
    border: 2px solid currentColor;
    transition: all 0.2s;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.bg-icon.blank {
    background: #fff;
}

.background-btn.active .bg-icon.blank {
    background: #333;
}

.bg-icon.ovals::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: repeating-linear-gradient(
        45deg,
        currentColor 0px,
        currentColor 2px,
        transparent 2px,
        transparent 6px
    );
}

.bg-icon.dots::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background-image: radial-gradient(
        currentColor 1px,
        transparent 1px
    );
    background-size: 4px 4px;
}

.bg-icon.orb::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: radial-gradient(
        circle at center,
        transparent 0%,
        currentColor 70%
    );
    opacity: 0.2;
}

.background-btn.active .bg-icon.orb::before {
    opacity: 0.8;
}

.bg-icon.rings::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: repeating-radial-gradient(
        circle at center,
        currentColor 0%,
        currentColor 2px,
        transparent 2px,
        transparent 6px
    );
}

.bg-icon.lines::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: repeating-linear-gradient(
        90deg,
        currentColor 0px,
        currentColor 1px,
        transparent 1px,
        transparent 4px
    );
}

.bg-label {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: black;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.background-btn:hover .bg-label {
    opacity: 1;
}

.background-btn.active {
    background: #000;
    color: white;
    border-color: #000;
}

.background-btn:hover {
    background: #f5f5f5;
}

.background-btn.active:hover {
    background: #000;
}

/* Update poster background classes */
.poster-canvas[data-background="blank"] .poster-background {
    display: none;
}

.poster-canvas[data-background="ovals"] .poster-background {
    display: block;
}

.poster-canvas[data-background="dots"] .poster-background::before {
    background: repeating-radial-gradient(
        circle at center,
        rgba(0, 0, 0, 0.2) 1px,
        transparent 1px,
        transparent 15px
    );
    mask: none;
    -webkit-mask: none;
    transform: none;
}

.poster-canvas[data-background="orb"] .poster-background,
.poster-canvas[data-background="rings"] .poster-background {
    display: block;
}

label {
    color: #666;
}

.poster-canvas.inverted label {
    color: white;
}

/* Hide labels by default on non-inverted poster */
.label {
    display: none;
}

/* Show labels when both inverted and labels are enabled */
.poster-canvas.inverted.show-labels .label {
    display: block;
    color: white;
    opacity: 0.8;
}

/* Show labels when only labels are enabled (non-inverted) */
.poster-canvas.show-labels .label {
    display: block;
}

.export-container {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.export-btn {
    width: 100%;
    padding: 0.75rem;
    background: #000;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-btn:hover {
    background: #333;
}

.export-btn:active {
    transform: translateY(1px);
}

.typography-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alignment-controls {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem;
    background: #f5f5f5;
    border-radius: 6px;
    width: fit-content;
}

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

.align-btn {
    position: relative;
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.align-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
}

.align-hover-label {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: black;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.align-btn:hover .align-hover-label {
    opacity: 1;
}

.align-btn:hover {
    background: #f5f5f5;
}

.align-btn.active {
    background: black;
    border-color: black;
    color: white;
}

/* Remove old typeface styles */
.typeface-controls,
.typeface-buttons,
.typeface-btn,
.typeface-sample,
.typeface-label {
    display: none;
}

.style-control {
    margin-top: 0.5rem;
}

.style-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.style-label {
    font-size: 0.75rem;
    color: #666;
}

.style-slider {
    width: 100%;
    height: 2px;
    background: #e0e0e0;
    -webkit-appearance: none;
    outline: none;
    border-radius: 2px;
}

.style-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #000;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.style-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #000;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.style-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.style-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
}

/* Level 1: All text same size */
.poster-canvas[data-style="0"] .poster-content h1,
.poster-canvas[data-style="0"] .poster-content p {
    font-size: 3.825rem;
    letter-spacing: -0.04em;
    line-height: 1;
}

/* Level 2: Labels */
.poster-canvas[data-style="1"] .content-label {
    opacity: 1;
}

/* Level 3: Crop marks */
.poster-canvas[data-style="2"] .poster-content::before,
.poster-canvas[data-style="3"] .poster-content::before,
.poster-canvas[data-style="4"] .poster-content::before {
    content: '';
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

.crop-mark {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.crop-mark::before,
.crop-mark::after {
    content: '';
    position: absolute;
    background: rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease;
}

/* Top Left */
.crop-mark.top-left { 
    top: 1rem; 
    left: 1rem; 
}
.crop-mark.top-left::before {
    width: 1px;
    height: 1rem;
    bottom: 0;
    left: 0;
}
.crop-mark.top-left::after {
    width: 1rem;
    height: 1px;
    right: 0;
    top: 0;
}

/* Top Right */
.crop-mark.top-right { 
    top: 1rem; 
    right: 1rem; 
}
.crop-mark.top-right::before {
    width: 1px;
    height: 1rem;
    bottom: 0;
    right: 0;
}
.crop-mark.top-right::after {
    width: 1rem;
    height: 1px;
    left: 0;
    top: 0;
}

/* Bottom Left */
.crop-mark.bottom-left { 
    bottom: 1rem; 
    left: 1rem; 
}
.crop-mark.bottom-left::before {
    width: 1px;
    height: 1rem;
    top: 0;
    left: 0;
}
.crop-mark.bottom-left::after {
    width: 1rem;
    height: 1px;
    right: 0;
    bottom: 0;
}

/* Bottom Right */
.crop-mark.bottom-right { 
    bottom: 1rem; 
    right: 1rem; 
}
.crop-mark.bottom-right::before {
    width: 1px;
    height: 1rem;
    top: 0;
    right: 0;
}
.crop-mark.bottom-right::after {
    width: 1rem;
    height: 1px;
    left: 0;
    bottom: 0;
}

.poster-canvas[data-style="2"] .crop-mark,
.poster-canvas[data-style="3"] .crop-mark,
.poster-canvas[data-style="4"] .crop-mark {
    opacity: 1;
}

.poster-canvas.inverted .crop-mark::before,
.poster-canvas.inverted .crop-mark::after {
    background: rgba(255, 255, 255, 0.2);
}

.poster-canvas.inverted .poster-content::before {
    border-color: rgba(255, 255, 255, 0.1);
}

/* Level 4: Basic grid */
.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
}

.grid-line {
    position: absolute;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.3s ease;
}

.poster-canvas.inverted .grid-line {
    background: rgba(255, 255, 255, 0.3);
}

.grid-line.vertical {
    width: 1px;
    height: 100%;
}

.grid-line.horizontal {
    height: 1px;
    width: 100%;
}

.poster-canvas[data-style="3"] .grid-overlay,
.poster-canvas[data-style="4"] .grid-overlay {
    opacity: 1;
}

/* Level 5: Detailed grid */
.poster-canvas[data-style="4"] .grid-overlay {
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 0.5rem 0.5rem;
    transition: background-image 0.3s ease;
}

.poster-canvas.inverted[data-style="4"] .grid-overlay {
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
}

.poster-item {
    display: grid;
    grid-template-columns: 1.75rem 1fr;
    align-items: start;
    gap: 1.5rem;
    padding-left: 0;
}

.content-label {
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: left;
    color: black;
    padding-left: 0;
    margin-left: -0.5rem;
    padding-top: 0.5rem;
}

.poster-canvas.inverted .content-label {
    color: white;
}

@media (max-width: 600px) {
    .content-label {
        margin-left: -0.5rem;
        padding-top: 0.25rem;
    }
}

.color-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.color-btn {
    flex: 1;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.color-btn:hover {
    background: #f5f5f5;
}

.color-btn.active {
    background: black;
    border-color: black;
    padding: 4px;
}

.color-icon {
    width: 100%;
    height: 24px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.color-btn.active .color-icon {
    border-radius: 3px;
}

.color-hover-label {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: black;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.color-btn:hover .color-hover-label {
    opacity: 1;
}

.editable-label {
    color: #444444;
    font: 12.8px "Helvetica Neue", -apple-system-ui, system-ui, sans-serif;
    margin: 0 0 8px;
    padding: 2px 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-weight: normal;
}

.editable-label:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.editable-label[contenteditable="true"] {
    background-color: #fff;
    outline: 2px solid #0066cc;
    outline-offset: -2px;
}

/* All editable labels same size */
.editable-label.h1-style,
.editable-label.h2-style,
.editable-label.h3-style {
    font-size: 12.8px;
    font-weight: normal;
}

/* Remove old container and button styles */
.label-container,
.edit-label-btn,
.animation-controls,
.animation-btn,
.animation-label {
    display: none;
}

.color-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
} 