html, body {
    padding: 0;
    border: 0;
    margin: 0;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.container {
    position: relative;
    overflow: hidden;
    margin: auto;
    width: 100%;
    height: 100%;
    background: #1a1a2e;
}

.container.hidden {
    display: none;
}

.canvas {
    cursor: grab;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
    touch-action: none;
}

.canvas.hidden {
    display: none;
}

.canvas:active {
    cursor: grabbing;
}

.drop-zone {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    background: rgba(26, 26, 46, 0.95);
    transition: background 0.3s ease;
}

.drop-zone.drag-over {
    background: rgba(26, 26, 46, 0.98);
}

.drop-zone.drag-over .drop-zone-content {
    border-color: #0052d9;
    transform: scale(1.02);
}

.drop-zone.hidden {
    display: none;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 420px;
    height: 280px;
    padding: 60px 80px;
    border: 2px dashed #555;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.drop-zone-content:hover {
    border-color: #777;
    background: rgba(255, 255, 255, 0.04);
}

.drop-zone-content.hidden {
    display: none;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo {
    width: 120px;
    height: 120px;
}

.title {
    color: #fff;
    font-size: 36px;
    font-weight: 600;
    margin: 20px 0 0 0;
    text-align: center;
}

.drop-icon {
    width: 64px;
    height: 64px;
    color: #888;
    margin-bottom: 20px;
}

.drop-text {
    color: #ccc;
    font-size: 20px;
    margin: 0 0 8px 0;
}

.drop-subtext {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.nav-btns {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 150;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.nav-btns.hidden {
    display: none;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 80px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-btn svg {
    width: 16px;
    height: 16px;
    color: #aaa;
}

.nav-btn:hover svg {
    color: #ccc;
}

.nav-btn span {
    color: #aaa;
    font-size: 13px;
}

.nav-btn:hover span {
    color: #ccc;
}

/* Dropdown menu */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    width: 100%;
    cursor: pointer;
    font-family: inherit;
}

.nav-dropdown-arrow {
    width: 12px;
    height: 12px;
    margin-left: -2px;
    margin-right: -4px;
    transition: transform 0.2s ease;
}

.nav-dropdown.open .nav-dropdown-arrow,
.nav-dropdown:hover .nav-dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 0;
    padding: 4px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.15s ease;
}

.nav-dropdown.open .nav-dropdown-menu,
.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s ease;
}

.nav-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-dropdown-item svg {
    width: 16px;
    height: 16px;
    color: #aaa;
    flex-shrink: 0;
}

.nav-dropdown-item:hover svg {
    color: #ccc;
}

.nav-dropdown-item span {
    color: #aaa;
    font-size: 13px;
    white-space: nowrap;
}

.nav-dropdown-item:hover span {
    color: #ccc;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 420px;
    height: 280px;
    border: 2px solid transparent;
    border-radius: 16px;
    box-sizing: border-box;
}

.loading-content.hidden {
    display: none;
}

.loading-text {
    color: #ccc;
    font-size: 20px;
    margin: 0 0 24px 0;
}

.progress-container {
    width: 280px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #0052d9, #0062e9);
    border-radius: 3px;
    transition: width 0.15s ease-out;
}

.progress-text {
    color: #888;
    font-size: 14px;
    margin: 12px 0 0 0;
}

.error-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 420px;
    height: 280px;
    border: 2px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    box-sizing: border-box;
}

.error-content:hover .error-icon {
    color: #ff6b5b;
}

.error-content.hidden {
    display: none;
}

.error-icon {
    width: 64px;
    height: 64px;
    color: #e74c3c;
    margin-bottom: 20px;
}

.error-title {
    color: #ccc;
    font-size: 20px;
    margin: 0 0 12px 0;
}

.error-message {
    color: #888;
    font-size: 14px;
    margin: 0 0 24px 0;
    max-width: 400px;
    text-align: center;
    word-break: break-word;
    white-space: pre-line;
}

.toolbar {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 150;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    backdrop-filter: blur(8px);
}

.toolbar.hidden {
    display: none;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 6px;
    box-sizing: border-box;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease;
}

.toolbar-btn svg {
    width: 24px;
    height: 24px;
    color: #ccc;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.toolbar-btn:hover svg {
    color: #fff;
}

.toolbar-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

.toolbar-btn.hidden {
    display: none;
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
}

.file-name {
    color: #aaa;
    font-size: 14px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mobile */
@media (max-width: 600px) {
    .drop-zone {
        padding: 0 24px;
    }

    .drop-zone-content {
        max-width: 100%;
        box-sizing: border-box;
        padding: 60px 40px;
    }

    .drop-text {
        text-align: center;
    }

    .error-content {
        max-width: 100%;
        box-sizing: border-box;
        padding: 60px 40px;
    }

    .file-name {
        max-width: 150px;
    }
}

/* Samples page */
.samples-page {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    background: #1a1a2e;
    overflow-y: auto;
    padding: 0 24px 40px;
}

.samples-page.hidden {
    display: none;
}

.samples-header {
    display: flex;
    align-items: center;
    padding: 16px 0;
    position: sticky;
    top: 0;
    background: #1a1a2e;
    z-index: 10;
}

.samples-header-btns {
    position: fixed;
    top: 16px;
    right: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    z-index: 10;
}

.samples-title {
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.samples-list {
    padding: 0;
    margin: 0 auto;
    max-width: 1200px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.samples-list > a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.15s ease;
}

.samples-list > a:hover {
    background: rgba(255, 255, 255, 0.12);
}

.samples-list .sample-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background:
        repeating-conic-gradient(#ccc 0% 25%, #fff 0% 50%) 0 0 / 16px 16px;
    border-radius: 6px;
    object-fit: contain;
}

.samples-list .sample-name {
    color: #999;
    font-size: 12px;
    font-weight: 400;
    text-align: center;
    word-break: break-all;
    line-height: 1.3;
}

/* Mobile - Samples */
@media (max-width: 600px) {
    .samples-page {
        padding: 0 16px 24px;
    }

    .samples-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .samples-list > a {
        padding: 6px;
        gap: 6px;
    }

    .samples-list .sample-image {
        border-radius: 4px;
    }

    .samples-list .sample-name {
        font-size: 10px;
    }
}
