body {
    font-family: 'Montserrat', sans-serif;
}

.preview-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Default to hidden, will be controlled by JS */
    padding: 20px;
}
.preview-area {
    background-image:
        linear-gradient(45deg, #ccc 25%, transparent 25%),
        linear-gradient(-45deg, #ccc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ccc 75%),
        linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
    transform-origin: top center;
    transition: transform 0.3s ease;
}

/* Dark mode preview area */
.dark .preview-area {
    background-image:
        linear-gradient(45deg, #555 25%, transparent 25%),
        linear-gradient(-45deg, #555 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #555 75%),
        linear-gradient(-45deg, transparent 75%, #555 75%);
}

/* Theme toggle button styles */
#themeToggle {
    transition: all 0.3s ease;
}

#themeToggle:hover {
    transform: scale(1.05);
}

/* Smooth transitions for theme changes */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Enhanced dark mode input styles */
.dark input[type="color"]::-webkit-color-swatch {
    border: 2px solid #4b5563;
}

/* Dark mode range slider styles */
.dark input[type="range"]::-webkit-slider-track {
    background: #4b5563;
}

.dark input[type="range"]::-webkit-slider-thumb {
    background: #3b82f6;
}

.dark input[type="range"]::-moz-range-track {
    background: #4b5563;
}

.dark input[type="range"]::-moz-range-thumb {
    background: #3b82f6;
    border: none;
}
#preview {
    position: relative; /* This is the key fix for guide positioning */
    background-color: #f0f0f0;
    background-size: cover;
    background-position: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
}

#backgroundLayer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Place it above the base layer but below text */
    background-size: cover;
    background-position: center;
}
.btn {
    transition: all 0.3s ease;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
}
input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}
input[type="color"]::-webkit-color-swatch {
    border: 2px solid #e2e8f0;
    border-radius: 50%;
}
#textPreview {
    cursor: grab;
    user-select: none;
    position: absolute; 
}
#textPreview.dragging {
    cursor: grabbing;
}
.snap-guide {
    position: absolute;
    background-color: rgba(255, 0, 150, 0.8);
    display: none;
    z-index: 10;
    pointer-events: none; /* Ensures guides don't interfere with mouse events */
}
.snap-guide.vertical {
    width: 2px;
    height: 100%;
    top: 0;
    left: 50%; /* Center it horizontally */
    transform: translateX(-50%); /* Adjust for true centering */
}
.snap-guide.horizontal {
    height: 2px;
    width: 100%;
    left: 0;
    top: 50%; /* Center it vertically */
    transform: translateY(-50%); /* Adjust for true centering */
}
#pattern-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2; /* Place it above the background layer but below text */
}

.footer {
    text-align: center;
}