body {
    font-family: "Geist Variable", sans-serif;
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.blur-sm {
    filter: blur(4px);
}

.modal-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.modal-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.modal-scrollbar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.modal-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.custom-select-wrapper {
    position: relative;
}

.custom-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.5em 1.5em;
}

#fullscreenPreview {
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

#previewBox {
    position: relative;
}

#previewBox:hover #fullscreenPreview {
    opacity: 1;
}

#fullscreenFontSize {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
}

#fullscreenFontSize::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#fullscreenFontSize::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#fullscreenModal, #modal {
    transition: opacity 0.3s ease-in-out;
}

#fullscreenModal.hidden, #modal.hidden {
    opacity: 0;
    pointer-events: none;
}

#fullscreenModal.flex, #modal.flex {
    opacity: 1;
    pointer-events: auto;
}

#fullscreenModal.flex ~ #main-content {
    filter: blur(4px);
    transition: filter 0.3s ease-in-out;
}

#fullscreenModal {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

#fullscreenTextColor {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    padding: 0;
    overflow: hidden;
}

#fullscreenTextColor::-webkit-color-swatch-wrapper {
    padding: 0;
}

#fullscreenTextColor::-webkit-color-swatch {
    border: none;
    border-radius: 10px;
}

#fullscreenBgColor {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.5)'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.5em 1.5em;
}

#fullscreenBgColor:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#fullscreenBgColor option {
    background: #1a1a1a;
    color: white;
    padding: 8px;
}

#fullscreenPreviewBox {
    min-height: 400px;
    max-height: calc(100vh - 300px);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible !important;
}

#fullscreenPreviewBox::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0.05) 100%
    );
    pointer-events: none;
}

.scale-up {
    animation: scaleUp 0.3s ease-out;
}

@keyframes scaleUp {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

#fullscreenModal .mt-6 {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    margin-top: 1.5rem;
}

#fullscreenModal br {
    height: 1rem;
    display: block;
}

#fullscreenFontSize {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
}

#fullscreenFontSize::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

#fullscreenFontSize::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#fullscreenTextColor {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
}

#fullscreenTextColor::-webkit-color-swatch-wrapper {
    padding: 0;
}

#fullscreenTextColor::-webkit-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

#fullscreenBgColor {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

#fullscreenBgColor:hover {
    background: rgba(255, 255, 255, 0.15);
}

#fullscreenModal button {
    transition: all 0.2s ease-in-out;
}

#fullscreenModal button:hover {
    transform: translateY(-1px);
}

#fullscreenModal button:active {
    transform: translateY(0);
}

#fullscreenPreviewText {
    max-width: 90%;
    margin: 0 auto;
    text-align: center;
    transition: all 0.3s ease-in-out;
}

#fullscreenModal button.active {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

#fullscreenLineHeight {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
}

#fullscreenLineHeight::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    #fullscreenPreview {
        display: none;
    }
}

/* Fullscreen Modal Styles */
#fullscreenModal {
    transition: all 0.2s ease-in-out;
}

/* Range Input Styles */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #d1d5db !important;
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #4f46e5;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-moz-range-track {
    background: #d1d5db !important;
}

/* Color Input Styles */
input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    padding: 0;
    border: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

/* Select Styles */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1em;
}

/* Active Button States */
button.active {
    background-color: #f3f4f6;
    color: #4f46e5;
}

.dark button.active {
    background-color: #374151;
    color: #818cf8;
}

/* Preview Text */
#fullscreenPreviewText {
    max-width: 90%;
    margin: 0 auto;
}

/* Hide on Mobile */
@media (max-width: 768px) {
    #fullscreenPreview {
        display: none;
    }
}

#fullscreenPreviewBox[style*="background-color: #fff"],
#fullscreenPreviewBox[style*="background-color: #ffffff"] {
    border: 1px solid #e5e7eb;
}

#fullscreenPreviewBox[style*="background-color: #000"],
#fullscreenPreviewBox[style*="background-color: #000000"] {
    border: 1px solid #374151;
}

#fullscreenPreviewBox[style*="background-color: #000"] #fullscreenPreviewText,
#fullscreenPreviewBox[style*="background-color: #000000"] #fullscreenPreviewText {
    text-shadow: 0 0 1px rgba(255,255,255,0.1);
}

/* Update fullscreen modal styles */
#fullscreenModal {
    transition: all 0.2s ease-in-out;
}

#fullscreenPreviewBox {
    min-height: 300px;
    background: #ffffff;
    transition: all 0.2s ease-in-out;
}

#fullscreenPreviewText {
    max-width: 90%;
    margin: 0 auto;
    transition: all 0.2s ease-in-out;
}

/* Improved range input styles */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #4f46e5;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Improved color input styles */
.color-input-wrapper {
    position: relative;
    width: 100%;
    height: 32px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: white;
}

.color-input-wrapper input[type="color"] {
    position: absolute;
    inset: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    border: none;
    padding: 0;
    background: transparent;
}

.color-input-wrapper .color-preview {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: 4px;
    background: linear-gradient(45deg, #f9fafb 25%, transparent 25%),
                linear-gradient(-45deg, #f9fafb 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, #f9fafb 75%),
                linear-gradient(-45deg, transparent 75%, #f9fafb 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
}

/* Hide fullscreen preview button and modal on mobile/tablet */
@media (max-width: 1024px) {
    #fullscreenPreview,
    #fullscreenModal {
        display: none !important;
    }
}

/* Ensure text remains visible on dark backgrounds */
#fullscreenPreviewBox[style*="background-color: #000"],
#fullscreenPreviewBox[style*="background-color: #000000"] {
    border-color: #374151;
}

#fullscreenPreviewBox[style*="background-color: #000"] #fullscreenPreviewText,
#fullscreenPreviewBox[style*="background-color: #000000"] #fullscreenPreviewText {
    text-shadow: 0 0 1px rgba(255,255,255,0.1);
}

/* Update color input styles for better visibility */
input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 4px;
}

/* Active button states */
button.active {
    background-color: #e5e7eb;
    color: #4f46e5;
}

#fullscreenBgColor {
    background-color: #f3f4f6 !important;
    border: 1px solid #d1d5db;
    color: #374151;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.25em;
}

#fullscreenBgColor:focus {
    border-color: #4f46e5;
    outline: none;
    outline: 2px solid #4f46e5;
}

#fullscreenBgColor option {
    background-color: white;
    color: #374151;
    padding: 0.5rem;
}

#fullscreenPreviewText {
    max-width: 90%;
    margin: 0 auto;
}
  