/* Typography & Base */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Roboto Condensed', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: white;
}

/* App Container & Layout */
#app-container {
    position: relative;
    width: 100%;
    height: 100%;
}

#app {
    position: absolute;
    top: 0;
    left: 0;
    width: 350px;
    min-width: 300px;
    max-width: 100%;
    height: 100%;
    background: rgba(20, 24, 30, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 10;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#app.collapsed {
    transform: translateX(-100%);
}

#iframe-container {
    position: absolute;
    top: 0;
    left: 350px;
    right: 0;
    height: 100%;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

#iframe-container.expanded {
    left: 0;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Option Cards */
.option {
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-transform: uppercase;
    cursor: pointer;
    letter-spacing: 0.5px;
    transform: translateZ(0);
    position: relative;
    overflow: hidden;
}

.option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: #fff;
}

.selected {
    background: rgba(0, 217, 255, 0.15);
    border-color: rgba(0, 217, 255, 0.6);
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.2), inset 0 0 0 1px rgba(0, 217, 255, 0.1);
}

.selected::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: inset 0 0 20px rgba(0, 217, 255, 0.1);
    pointer-events: none;
    border-radius: 10px;
}

/* Category Headers */
.category-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    background: transparent;
    padding: 0.5rem 0.25rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    box-shadow: none;
    letter-spacing: 1.5px;
}

.category-number {
    font-size: 1rem;
    font-weight: 900;
    margin-right: 0.75rem;
    color: rgba(0, 217, 255, 0.8);
    flex-shrink: 0;
}

.category-text {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.category-name {
    font-size: 0.9rem;
    line-height: 1.2;
}

.category-subtitle {
    font-size: 0.65rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.2rem;
    line-height: 1;
}

.category-content {
    margin-bottom: 2rem;
    animation: fadeInUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.category-locked {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(100%);
}

.category-title-locked {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.category-title-completed .category-number {
    color: #22c55e;
}

.check-icon {
    font-size: 1rem;
    margin-left: auto;
    color: #22c55e;
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

.lock-icon {
    font-size: 0.9rem;
    margin-left: auto;
    opacity: 0.5;
}

/* Progress Indicator */
#progress-indicator {
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}

#progress-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-align: center;
    letter-spacing: 1px;
    text-transform: uppercase;
}

#progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

#progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00d9ff, #0096cc);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.6);
}

#step-info {
    margin-top: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    text-align: center;
    font-weight: 500;
}

/* Layout Containers */
.options-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.pattern-options-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    justify-content: center;
    padding: 0.25rem 0;
}

.color-options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.25rem 0;
}

.color-preview-display {
    width: 100%;
    height: 120px;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 2px 8px rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.color-preview-display::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.color-preview-display.updated::after {
    left: 100%;
}

.color-swatches-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Specific Option Overrides */
.brand-model-option {
    width: calc(50% - 0.25rem);
    height: 50px;
    padding: 4px;
    background-size: 70%;
    background-repeat: no-repeat;
    background-position: center;
    background-color: rgba(255, 255, 255, 0.05);
    filter: invert(1) brightness(2);
}

.brand-model-option:hover {
    background-size: 70% !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-color: rgba(255, 255, 255, 0.1);
}

.brand-model-option.selected {
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.2);
    background-size: 70%;
    background-repeat: no-repeat;
    background-position: center;
}

.basecolor-option {
    width: 70px;
    height: 40px;
    border-radius: 6px;
}

/* Specific fix for White base color option to show black text */
.basecolor-option[data-option="white"] {
    color: #000 !important;
    font-weight: 800;
}

/* Fix white color options in primary/secondary colors to show black text */
.color-option[data-option="#FFFFFF"] {
    color: #000 !important;
    font-weight: 700;
}

.color-option[data-option="#FFFFFF"]::before {
    color: #000 !important;
}

.pattern-option {
    width: 100%;
    height: 80px;
    border-radius: 10px;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.pattern-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: inherit;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    transform: translateY(100%);
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
}

.pattern-label {
    color: #fff;
    font-weight: 900;
    font-size: 1rem;
    text-transform: uppercase;
    mix-blend-mode: difference;
    text-align: center;
    line-height: 1;
    width: 100%;
    padding: 0.5rem;
    z-index: 2;
    pointer-events: none;
    position: relative;
}

.pattern-option:hover {
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

.pattern-option.selected::before {
    transform: translateY(0);
}

.pattern-option.selected {
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    box-shadow: 0 0 40px rgba(0, 217, 255, 0.8),
        0 0 60px rgba(0, 217, 255, 0.5),
        0 15px 50px rgba(0, 217, 255, 0.4),
        inset 0 0 30px rgba(0, 217, 255, 0.3);
    border-color: rgba(0, 217, 255, 0.9);
}

.color-option {
    width: 100%;
    height: 50px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.color-option:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

.color-option.selected {
    border-color: rgba(0, 217, 255, 0.9);
    box-shadow: 0 0 25px rgba(0, 217, 255, 0.6),
        0 8px 20px rgba(0, 0, 0, 0.3),
        inset 0 0 20px rgba(0, 217, 255, 0.2);
}

/* Visual Logo Placement Icons */
.logo-option-visual {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
}

.logo-preview {
    width: 30px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    position: relative;
}

.dot {
    width: 6px;
    height: 6px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
}

.pos-1 .dot {
    top: 2px;
    left: 2px;
}

.pos-2 .dot {
    top: 2px;
    right: 2px;
}

.pos-3 .dot {
    bottom: 2px;
    left: 2px;
}

.pos-4 .dot {
    bottom: 2px;
    right: 2px;
}

.logo-extra-option {
    width: 140px;
    height: 40px;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.save-design-button {
    width: 100%;
    height: 60px;
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, #00d9ff 0%, #0074D9 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.save-design-button:hover {
    box-shadow: 0 15px 40px rgba(0, 217, 255, 0.5);
    transform: translateY(-2px);
}

/* Toggle Button */
#sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 370px;
    width: 50px;
    height: 50px;
    background: rgba(20, 24, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 12;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.2);
}

#sidebar-toggle.collapsed {
    left: 20px;
}

/* Screenshot Button */
#screenshot-button {
    position: fixed;
    top: 80px;
    left: 370px;
    width: 50px;
    height: 50px;
    background: rgba(20, 24, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 12;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: white;
    opacity: 1;
}

#screenshot-button:hover {
    background: rgba(0, 217, 255, 0.15);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
    border-color: rgba(0, 217, 255, 0.5);
}

#screenshot-button.hidden {
    opacity: 0;
    pointer-events: none;
}

#screenshot-button svg {
    width: 24px;
    height: 24px;
}

.toggle-line {
    width: 24px;
    height: 3px;
    background: white;
    border-radius: 2px;
    margin: 3px 0;
    transition: all 0.3s ease;
}

#sidebar-toggle.collapsed .toggle-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

#sidebar-toggle.collapsed .toggle-line:nth-child(2) {
    opacity: 0;
}

#sidebar-toggle.collapsed .toggle-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Annotations Button */
#annotations {
    position: fixed;
    top: 50%;
    left: 349px;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(20, 24, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 0 12px 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 11;
    overflow: hidden;
    transition: left 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    opacity: 1;
}

#annotations.hidden {
    left: -51px;
    opacity: 0;
    pointer-events: none;
}

#annotations:hover {
    box-shadow: 0 4px 16px rgba(0, 217, 255, 0.4);
    border: 1px solid rgba(0, 217, 255, 0.3);
}

#annotations::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(45deg);
    pointer-events: none;
}

#annotations.animate::before {
    animation: sheen 0.5s forwards;
}

@keyframes sheen {
    100% {
        transform: rotate(45deg) translateY(200%);
    }
}

.circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 217, 255, 0.2);
    border: 2px solid rgba(0, 217, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 20px;
    color: #00d9ff;
    z-index: 2;
    text-shadow: 0 0 8px rgba(0, 217, 255, 0.6);
    font-family: 'Roboto Condensed', sans-serif;
}

/* Popups & Notifiers */
#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 100;
}

#popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #00a8e8;
    color: white;
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 101;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
}

#popup.show {
    display: block;
    opacity: 1;
}

#notifier {
    position: fixed;
    bottom: 10px;
    left: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
    display: none;
    z-index: 1000;
}

.start-message {
    text-align: center;
    font-size: 0.9rem;
    color: #aaa;
    margin-top: 0.5rem;
}

/* Scrollbar */
#app::-webkit-scrollbar {
    width: 5px;
}

#app::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

#app::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

#app::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        max-height: 500px;
        margin-bottom: 2rem;
    }

    to {
        opacity: 0;
        max-height: 0;
        margin-bottom: 0;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #app {
        width: 100%;
        max-width: 100%;
    }

    #iframe-container {
        left: 0;
        z-index: 0;
    }

    #app.collapsed {
        transform: translateY(100%);
    }

    #sidebar-toggle {
        left: auto;
        right: 20px;
    }
}