@font-face {
    font-family: 'Alexa';
    src: url('../font/customLed/Alexa.ttf') format('truetype');
}

@font-face {
    font-family: 'Amanda';
    src: url('../font/customLed/Amanda.ttf') format('truetype');
}

@font-face {
    font-family: 'Amsterdam';
    src: url('../font/customLed/Amsterdam.ttf') format('truetype');
}

@font-face {
    font-family: 'Austin';
    src: url('../font/customLed/Austin.ttf') format('truetype');
}

@font-face {
    font-family: 'Avante';
    src: url('../font/customLed/Avante.ttf') format('truetype');
}

@font-face {
    font-family: 'Barcelona';
    src: url('../font/customLed/Barcelona.ttf') format('truetype');
}

@font-face {
    font-family: 'Bayview';
    src: url('../font/customLed/Bayview.ttf') format('truetype');
}

@font-face {
    font-family: 'Beachfront';
    src: url('../font/customLed/Beachfront.ttf') format('truetype');
}

@font-face {
    font-family: 'Bellview';
    src: url('../font/customLed/Bellview.ttf') format('truetype');
}

@font-face {
    font-family: 'Buttercup';
    src: url('../font/customLed/Buttercup.ttf') format('truetype');
}

@font-face {
    font-family: 'Chelsea';
    src: url('../font/customLed/Chelsea.ttf') format('truetype');
}

@font-face {
    font-family: 'Classic Type';
    src: url('../font/customLed/ClassicType.ttf') format('truetype');
}

@font-face {
    font-family: 'Florence';
    src: url('../font/customLed/Florence.ttf') format('truetype');
}

@font-face {
    font-family: 'Freehand';
    src: url('../font/customLed/Freehand.ttf') format('truetype');
}

@font-face {
    font-family: 'Freespirit';
    src: url('../font/customLed/Freespirit.ttf') format('truetype');
}

@font-face {
    font-family: 'Greenworld';
    src: url('../font/customLed/Greenworld.ttf') format('truetype');
}

@font-face {
    font-family: 'Lazy Sunday';
    src: url('../font/customLed/LazySunday.ttf') format('truetype');
}

@font-face {
    font-family: 'Los Angeles';
    src: url('../font/customLed/LosAngeles.ttf') format('truetype');
}

@font-face {
    font-family: 'LoveNeon';
    src: url('../font/customLed/LoveNeon.ttf') format('truetype');
}

@font-face {
    font-family: 'LoveNote';
    src: url('../font/customLed/LoveNote.ttf') format('truetype');
}

@font-face {
    font-family: 'Majorca';
    src: url('../font/customLed/Majorca.ttf') format('truetype');
}

@font-face {
    font-family: 'Manchester';
    src: url('../font/customLed/Manchester.ttf') format('truetype');
}

@font-face {
    font-family: 'Manhattan';
    src: url('../font/customLed/Manhattan.ttf') format('truetype');
}

@font-face {
    font-family: 'Marquee';
    src: url('../font/customLed/Marquee.ttf') format('truetype');
}

@font-face {
    font-family: 'Mayfair';
    src: url('../font/customLed/Mayfair.ttf') format('truetype');
}

@font-face {
    font-family: 'Melbourne';
    src: url('../font/customLed/Melbourne.ttf') format('truetype');
}

@font-face {
    font-family: 'Milan';
    src: url('../font/customLed/Milan.ttf') format('truetype');
}

@font-face {
    font-family: 'Monaco';
    src: url('../font/customLed/Monaco.ttf') format('truetype');
}

@font-face {
    font-family: 'NeoTokyo';
    src: url('../font/customLed/NeoTokyo.ttf') format('truetype');
}

@font-face {
    font-family: 'Neon Glow';
    src: url('../font/customLed/NeonGlow.ttf') format('truetype');
}

@font-face {
    font-family: 'Neon Lite';
    src: url('../font/customLed/NeonLite.ttf') format('truetype');
}

@font-face {
    font-family: 'Neonscript';
    src: url('../font/customLed/Neonscript.ttf') format('truetype');
}

@font-face {
    font-family: 'Neontrace';
    src: url('../font/customLed/Neontrace.ttf') format('truetype');
}

@font-face {
    font-family: 'Nevada';
    src: url('../font/customLed/Nevada.ttf') format('truetype');
}

@font-face {
    font-family: 'New Cursive';
    src: url('../font/customLed/NewCursive.ttf') format('truetype');
}

@font-face {
    font-family: 'Northshore';
    src: url('../font/customLed/Northshore.ttf') format('truetype');
}

@font-face {
    font-family: 'Notting Hill';
    src: url('../font/customLed/NottingHill.ttf') format('truetype');
}

@font-face {
    font-family: 'Olivia';
    src: url('../font/customLed/Olivia.ttf') format('truetype');
}

@font-face {
    font-family: 'Photogenic';
    src: url('../font/customLed/Photogenic.ttf') format('truetype');
}

@font-face {
    font-family: 'Rocket';
    src: url('../font/customLed/Rocket.ttf') format('truetype');
}

@font-face {
    font-family: 'Rockstar';
    src: url('../font/customLed/Rockstar.ttf') format('truetype');
}

@font-face {
    font-family: 'Royalty';
    src: url('../font/customLed/Royalty.ttf') format('truetype');
}

@font-face {
    font-family: 'San Diego';
    src: url('../font/customLed/SanDiego.ttf') format('truetype');
}

@font-face {
    font-family: 'SciFi';
    src: url('../font/customLed/SciFi.ttf') format('truetype');
}

@font-face {
    font-family: 'Signature';
    src: url('../font/customLed/Signature.ttf') format('truetype');
}

@font-face {
    font-family: 'Simplicity';
    src: url('../font/customLed/Simplicity.ttf') format('truetype');
}

@font-face {
    font-family: 'Sorrento';
    src: url('../font/customLed/Sorrento.ttf') format('truetype');
}

@font-face {
    font-family: 'Submarine';
    src: url('../font/customLed/Submarine.ttf') format('truetype');
}

@font-face {
    font-family: 'Typewriter';
    src: url('../font/customLed/Typewriter.ttf') format('truetype');
}

@font-face {
    font-family: 'Vancouver';
    src: url('../font/customLed/Vancouver.ttf') format('truetype');
}

@font-face {
    font-family: 'Venetian';
    src: url('../font/customLed/Venetian.ttf') format('truetype');
}

@font-face {
    font-family: 'Vintage';
    src: url('../font/customLed/Vintage.ttf') format('truetype');
}

@font-face {
    font-family: 'Waikiki';
    src: url('../font/customLed/Waikiki.ttf') format('truetype');
}

@font-face {
    font-family: 'Weekender';
    src: url('../font/customLed/Weekender.ttf') format('truetype');
}

@font-face {
    font-family: 'West Coast';
    src: url('../font/customLed/Westcoast.ttf') format('truetype');
}

@font-face {
    font-family: 'Wild Script';
    src: url('../font/customLed/WildScript.ttf') format('truetype');
}

:root {
    --primary-color: #4da6ff;
    --panel-bg: rgba(255, 255, 255, 0.9);
    --panel-border: rgba(255, 255, 255, 0.5);
    --text-color: #333;
    --neon-off: #e0e0e0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    overflow: hidden;
    /* Prevent body scroll, handle in panel */
    height: 100vh;
    background: #000;
}

/* Layout */
.app-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
}

/* Preview Area */
.preview-area {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    background: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
}

.room-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.room-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
    /* Dim background slightly for pop */
}

.neon-sign-container {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    cursor: grab;
    user-select: none;
    transition: transform 0.1s ease;
    /* Optional: emulate acrylic backboard */
    background: transparent;
}

.neon-text {
    font-size: 5rem;
    line-height: 1.2;
    color: #fff;
    white-space: pre-wrap;
    transition: text-shadow 0.3s ease, font-family 0.3s ease, transform 0.3s ease;
    /* Default Neon Glow */
    text-shadow:
        0 0 5px #fff,
        0 0 10px #fff,
        0 0 20px #ff00de,
        0 0 40px #ff00de,
        0 0 80px #ff00de;
}

/* Controls Panel */
.controls-panel {
    width: 450px;
    height: 100%;
    background: var(--panel-bg);
    border-left: 1px solid var(--panel-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
}

.panel-header {
    padding: 20px 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.panel-header h2 {
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.panel-header p {
    font-size: 0.9rem;
    color: #666;
}

.controls-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 30px;
    padding-bottom: 250px;
    /* Increased to prevent overlap */
}

/* RGB Button Style */
.rgb-mode-btn {
    background: linear-gradient(45deg, #ff0000, #00ff00, #0000ff);
    color: white;
    font-weight: bold;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    margin-bottom: 10px;
    transition: transform 0.2s;
}

.rgb-mode-btn:active {
    transform: scale(0.95);
}

.rgb-mode-btn.active {
    box-shadow: 0 0 0 3px #333;
}

.control-group {
    margin-bottom: 30px;
    animation: fadeIn 0.5s ease forwards;
}

.control-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #444;
}

/* Form Styles Override */
.form-control {
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid #ddd;
    font-family: inherit;
    font-size: 1.1rem;
    height: auto;
    padding: 15px;
}

.form-control:focus {
    background: #fff;
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(77, 166, 255, 0.2);
}

/* Font Grid - Scrollable */
.font-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom Scrollbar for font grid */
.font-grid::-webkit-scrollbar {
    width: 6px;
}

.font-grid::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.font-option {
    border: 2px solid #eee;
    background: rgba(255, 255, 255, 0.6);
    padding: 10px;
    text-align: center;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 1.1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50px;
}

/* Background Selector */
.bg-selector {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.bg-option {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform 0.2s;
}

.bg-option:hover {
    transform: scale(1.05);
}

.bg-option.selected {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

/* Drag Hint */
.drag-hint {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    pointer-events: none;
    z-index: 2;
}

/* Color Grid */
.color-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.color-option {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: #333;
    /* Or contrasting border */
    transform: scale(1.1);
}

.color-tooltip {
    /* Optional tooltips for colors */
}

/* Size Options */
.size-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.size-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.6);
    transition: all 0.2s;
}

.size-option:hover {
    border-color: #bbb;
    background: #fff;
}

.size-option.selected {
    border-color: var(--primary-color);
    background: #f0f7ff;
}

.size-name {
    font-weight: 600;
}

.size-dims {
    font-size: 0.85rem;
    color: #666;
}

.size-price {
    font-weight: 700;
    color: var(--text-color);
}

/* Option Row (Toggle) */
.option-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.6);
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #eee;
}

.toggle-group {
    display: flex;
    gap: 15px;
}

.toggle-group input {
    margin-right: 5px;
    accent-color: var(--primary-color);
    transform: scale(1.2);
}

/* Backboard Options */
.backboard-options {
    display: flex;
    gap: 15px;
}

.backboard-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.backboard-option:hover,
.backboard-option.selected {
    opacity: 1;
}

.backboard-option .color-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.backboard-option.selected .color-circle {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.backboard-option span {
    font-size: 0.8rem;
}


/* Action Area (Bottom Fixed) */
.action-area {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    padding: 20px 30px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
}

.price-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.btn-primary {
    background: #4A90E2;
    color: white;
    border: none;
    padding: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-shadow: none;
    border-radius: 8px;
    transition: transform 0.1s, background 0.2s;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:hover {
    background: #357abd;
}

/* Shimmer Effect */
.shimmer-btn {
    position: relative;
    overflow: hidden;
}

.shimmer-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: skewX(-20deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    20% {
        left: 200%;
    }

    100% {
        left: 200%;
    }
}

.terms {
    font-size: 0.75rem;
    color: #999;
    text-align: center;
    margin: 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar Customization */
.controls-content::-webkit-scrollbar {
    width: 8px;
}

.controls-content::-webkit-scrollbar-track {
    background: transparent;
}

.controls-content::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

.controls-content::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* On/Off Toggle */
.on-off-toggle {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #333;
    border-radius: 20px;
    display: flex;
    overflow: hidden;
    z-index: 4;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.toggle-btn {
    padding: 8px 15px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #888;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: #fff;
    color: #333;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Measurements Overlay */
.measurements {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    pointer-events: none;
    /* Make clicks pass through to text */
    opacity: 0;
    transition: opacity 0.3s;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    /* Box outline */
}

.neon-sign-container:hover .measurements {
    opacity: 1;
}

.measure-width {
    position: absolute;
    bottom: -15px;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.measure-width .line {
    height: 1px;
    background: #fff;
    flex-grow: 1;
    margin: 0 5px;
    position: relative;
}

.measure-width .line::after {
    /* Ticks */
    content: '';
    position: absolute;
    top: -3px;
    height: 7px;
    width: 1px;
    background: #fff;
}

.measure-width .line:first-child::after {
    left: 0;
}

.measure-width .line:last-child::after {
    right: 0;
}


.measure-height {
    position: absolute;
    right: -15px;
    top: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8rem;
    writing-mode: vertical-rl;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.measure-height .line {
    width: 1px;
    background: #fff;
    flex-grow: 1;
    margin: 5px 0;
    position: relative;
}

.measure-height .line::after {
    /* Ticks */
    content: '';
    position: absolute;
    left: -3px;
    width: 7px;
    height: 1px;
    background: #fff;
}

.measure-height .line:first-child::after {
    top: 0;
}

.measure-height .line:last-child::after {
    bottom: 0;
}

/* Watermark Logo */
.watermark-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    opacity: 0.05;
    pointer-events: none;
    z-index: 1;
}

/* Neon Off State - 3D White Effect */
.neon-text.off {
    text-shadow:
        1px 1px 0px #ccc,
        2px 2px 0px #bbb,
        3px 3px 0px #aaa,
        4px 4px 5px rgba(0, 0, 0, 0.3) !important;
    color: #f0f0f0 !important;
    -webkit-text-stroke: 1px #e0e0e0;
    filter: none;
    /* Remove grayscale to keep white color */
}

/* Responsive Styles */
@media screen and (max-width: 850px) {
    body {
        overflow: auto;
        /* Allow scrolling on mobile */
        height: auto;
    }

    .app-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow-y: visible;
    }

    .preview-area {
        height: 50vh;
        flex-grow: 0;
        min-height: 400px;
        position: relative;
        /* Ensure z-index context */
    }

    .drag-hint {
        top: 70px;
        /* Move down to avoid ON/OFF toggle */
        font-size: 0.7rem;
    }

    .controls-panel {
        width: 100%;
        height: auto;
        border-left: none;
        box-shadow: none;
        overflow: visible;
    }

    .controls-content {
        padding-bottom: 150px;
        /* Space for action area */
        overflow-y: visible;
        height: auto;
    }

    .neon-text {
        font-size: 2.5rem;
    }

    .panel-header {
        position: static;
        /* Remove sticky on mobile if it causes issues, or keep simple */
        background: var(--panel-bg);
    }

    /* Ensure Action Area is fixed at bottom of screen */
    .action-area {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 10;
        padding: 15px;
    }
}