/* Custom Font */
@font-face {
    font-family: 'Super Bubble';
    src: url('Super Bubble.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Super Bubble', 'Arial', sans-serif;
    font-weight: 400;
    background: linear-gradient(135deg, #ff69b4 0%, #ff1493 50%, #d946ef 100%);
    min-height: 100vh;
    height: 100vh;
    width: 100vw;
    color: #2d1b69;
    overflow-x: hidden;
    position: relative;
    margin: 0;
    padding: 0;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('labubu_bg.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    opacity: 0.15;
    z-index: -1;
    animation: floatBackground 20s ease-in-out infinite;
}

/* Subtle floating animation for background */
@keyframes floatBackground {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    33% {
        transform: translateY(-10px) scale(1.02);
    }
    66% {
        transform: translateY(10px) scale(0.98);
    }
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(217, 70, 239, 0.1) 0%, transparent 50%);
    z-index: -1;
    animation: shimmer 15s linear infinite;
}

/* Fallback for browsers without backdrop-filter support */
@supports not (backdrop-filter: blur(5px)) {
    .canvas-section,
    .asset-window,
    .layer-controls,
    .header {
        background: rgba(255, 255, 255, 0.98) !important;
    }
}

/* Shimmer effect */
@keyframes shimmer {
    0% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        opacity: 0.5;
    }
}

/* Color Variables */
:root {
    --primary-pink: #ff69b4;
    --deep-pink: #ff1493;
    --purple: #d946ef;
    --dark-purple: #2d1b69;
    --cream: #ffeaa7;
    --white: #ffffff;
    --light-pink: #ffb3d9;
    --shadow: rgba(45, 27, 105, 0.3);
    --border-radius: 20px;
    --bubble-shadow: 0 8px 25px rgba(45, 27, 105, 0.2);
}

/* Main Container */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 12px 25px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(45, 27, 105, 0.15), 0 0 30px rgba(255, 105, 180, 0.1);
    border: 2px solid var(--dark-purple);
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff69b4, #ff1493, #d946ef);
    z-index: 1;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    border: 2px solid var(--dark-purple);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.logo-text h1 {
    font-size: 2.5rem;
    color: var(--primary-pink);
    text-shadow: 2px 2px 0px var(--dark-purple);
    letter-spacing: 1px;
    font-weight: 400;
    margin: 0;
}

.logo-text .subtitle {
    display: block;
    font-size: 1rem;
    color: var(--dark-purple);
    margin-top: -5px;
    letter-spacing: 0.5px;
    font-weight: 400;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--white);
    border: 2px solid var(--dark-purple);
    border-radius: 8px;
    color: var(--dark-purple);
    text-decoration: none;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-link:hover {
    background: var(--primary-pink);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 105, 180, 0.3);
}

.header-link .link-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.header-link .link-text {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.export-btn {
    background: var(--primary-pink);
    color: var(--white);
    border: 2px solid var(--dark-purple);
    border-radius: 8px;
    padding: 10px 20px;
    font-family: inherit;
    font-weight: 400;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.export-btn:hover {
    background: var(--deep-pink);
}

.export-btn:active {
    background: #e91e63;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 15px;
    height: calc(100vh - 120px);
    align-items: start;
}

/* Canvas Section */
.canvas-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    border: 3px solid var(--dark-purple);
    box-shadow: var(--bubble-shadow), 0 0 30px rgba(255, 105, 180, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(5px);
    position: relative;
}

.canvas-window-header {
    background: var(--primary-pink);
    color: var(--white);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--dark-purple);
}

.canvas-window-title {
    font-size: 1rem;
    font-weight: 400;
    text-transform: lowercase;
}

.canvas-window-controls {
    display: flex;
    gap: 8px;
}

.window-control-btn {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--dark-purple);
    cursor: pointer;
    transition: all 0.2s ease;
}

.window-control-btn.minimize { background: #ffeaa7; }
.window-control-btn.maximize { background: #00b894; }
.window-control-btn.close { background: #ff4757; }

.window-control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Upload Button */
.upload-btn {
    background: var(--primary-pink);
    color: white;
    border: 2px solid var(--dark-purple);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 8px;
}

.upload-btn:hover {
    background: var(--deep-pink);
    transform: scale(1.05);
}

/* Upload Modal */
.upload-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-top: 15px;
}

.upload-preview {
    flex: 1;
    min-height: 200px;
    border: 2px dashed var(--dark-purple);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-pink);
    overflow: hidden;
}

.upload-preview img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
}

.upload-preview.empty {
    color: var(--dark-purple);
    font-style: italic;
}

.upload-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.upload-form label {
    font-weight: 700;
    color: var(--dark-purple);
    font-size: 0.9rem;
}

.upload-form input,
.upload-form select {
    padding: 8px 12px;
    border: 2px solid var(--dark-purple);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    background: white;
}

.upload-form input:focus,
.upload-form select:focus {
    outline: none;
    border-color: var(--primary-pink);
    box-shadow: 0 0 0 2px rgba(217, 70, 239, 0.2);
}

.upload-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.upload-action-btn {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid var(--dark-purple);
    border-radius: 8px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-action-btn.upload {
    background: var(--primary-pink);
    color: white;
}

.upload-action-btn.upload:hover {
    background: var(--deep-pink);
    transform: translateY(-1px);
}

.upload-action-btn.cancel {
    background: white;
    color: var(--dark-purple);
}

.upload-action-btn.cancel:hover {
    background: var(--light-pink);
    transform: translateY(-1px);
}

.canvas-container {
    position: relative;
    align-self: center;
    background: linear-gradient(45deg, var(--light-pink), var(--cream));
    border-radius: 8px;
    padding: 15px;
    margin: 20px;
    border: 2px solid var(--dark-purple);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.1);
}

#pfpCanvas {
    display: block;
    border-radius: 10px;
    background: var(--white);
    border: 2px solid var(--dark-purple);
    cursor: crosshair;
    max-width: 100%;
    height: auto;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.canvas-overlay {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border-radius: 10px;
    pointer-events: none;
    z-index: 10;
}

/* Layer Controls */
.layer-controls {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    border: 3px solid var(--dark-purple);
    box-shadow: var(--bubble-shadow), 0 0 20px rgba(0, 184, 148, 0.15);
    overflow: hidden;
    backdrop-filter: blur(3px);
    position: relative;
}

.layer-controls::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00b894, #00d4aa, #00e6b8);
    z-index: 1;
}

.layer-window-header {
    background: #00b894;
    color: var(--white);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--dark-purple);
}

.layer-window-title {
    font-size: 1rem;
    font-weight: 400;
    text-transform: lowercase;
}

.layer-content {
    padding: 15px;
    background: var(--white);
}

.layer-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
    background: var(--light-pink);
    border-radius: 10px;
    border: 2px solid var(--dark-purple);
}

.layer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--light-pink);
    cursor: pointer;
    transition: background 0.2s ease;
}

.layer-item:hover {
    background: var(--light-pink);
}

.layer-item.selected {
    background: var(--primary-pink);
    color: var(--white);
}

.layer-item:last-child {
    border-bottom: none;
}

.layer-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.layer-icon {
    font-size: 1.2rem;
}

.layer-name {
    font-weight: 700;
    font-size: 0.9rem;
}

.layer-type {
    font-size: 0.7rem;
    opacity: 0.8;
    text-transform: uppercase;
    display: block;
    margin-top: 2px;
}

.layer-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.layer-z-index {
    background: var(--dark-purple);
    color: var(--white);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.7rem;
    min-width: 20px;
    text-align: center;
}

.layer-visibility-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 2px;
    border-radius: 4px;
    transition: background 0.2s ease;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layer-visibility-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.layer-empty {
    padding: 20px;
    text-align: center;
    color: var(--dark-purple);
    font-style: italic;
}

.layer-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

    .layer-btn {
        background: var(--primary-pink);
        color: var(--white);
        border: 2px solid var(--dark-purple);
        border-radius: 6px;
        padding: 6px 12px;
        font-family: inherit;
        font-weight: 400;
        font-size: 0.8rem;
        cursor: pointer;
        transition: all 0.2s ease;
        flex: 1;
        text-transform: uppercase;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

.layer-btn:hover {
    background: var(--deep-pink);
}

.layer-btn.delete {
    background: #ff4757;
}

.layer-btn.delete:hover {
    background: #ff3742;
}

/* Layer Scaling Controls */
.layer-scaling {
    margin-top: 15px;
    padding: 12px;
    background: var(--light-pink);
    border-radius: 8px;
    border: 2px solid var(--dark-purple);
}

.scaling-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 8px;
}

.scale-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--dark-purple);
    background: var(--white);
    color: var(--dark-purple);
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.scale-btn:hover {
    background: var(--primary-pink);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.scale-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.scale-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #ccc;
    color: #666;
}

.scale-btn.disabled:hover {
    transform: none;
    box-shadow: none;
    background: #ccc;
    color: #666;
}

.scale-info {
    text-align: center;
    font-size: 0.9rem;
    color: var(--dark-purple);
    font-weight: 500;
}

/* Layer Rotation Controls */
.layer-rotation {
    margin-top: 15px;
    padding: 12px;
    background: var(--light-pink);
    border-radius: 8px;
    border: 2px solid var(--dark-purple);
}

.rotation-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 8px;
}

.rotation-btn {
    width: 45px;
    height: 45px;
    border: 2px solid var(--dark-purple);
    background: var(--white);
    color: var(--dark-purple);
    border-radius: 8px;
    font-size: 1.4rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    touch-action: manipulation;
}

.rotation-btn:hover {
    background: var(--primary-pink);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.rotation-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.rotation-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #ccc;
    color: #666;
}

.rotation-btn:disabled:hover {
    transform: none;
    box-shadow: none;
    background: #ccc;
    color: #666;
}

.rotation-info {
    text-align: center;
    font-size: 0.9rem;
    color: var(--dark-purple);
    font-weight: 500;
}

.layer-positioning {
    margin-top: 15px;
    padding: 12px;
    background: var(--light-pink);
    border-radius: 8px;
    border: 2px solid var(--dark-purple);
}

.positioning-controls {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    margin-bottom: 8px;
}

.position-row {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.position-btn {
    width: 45px;
    height: 45px;
    border: 2px solid var(--dark-purple);
    background: var(--white);
    color: var(--dark-purple);
    border-radius: 8px;
    font-size: 1.4rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    touch-action: manipulation;
}

.position-btn:hover {
    background: var(--primary-pink);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.position-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.position-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #ccc;
    color: #666;
}

.position-btn:disabled:hover {
    transform: none;
    box-shadow: none;
    background: #ccc;
    color: #666;
}

.position-info {
    text-align: center;
    font-size: 0.9rem;
    color: var(--dark-purple);
    font-weight: 500;
}

/* Asset Panel */
.asset-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: fit-content;
}

.asset-window {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    border: 3px solid var(--dark-purple);
    box-shadow: var(--bubble-shadow), 0 0 20px rgba(217, 70, 239, 0.15);
    overflow: hidden;
    backdrop-filter: blur(3px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.asset-window:hover {
    transform: translateY(-2px);
    box-shadow: var(--bubble-shadow), 0 0 25px rgba(217, 70, 239, 0.25);
}

.asset-window-header {
    background: var(--purple);
    color: var(--white);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.asset-window-header:hover {
    background: #8b5cf6;
}

.asset-window-title {
    font-size: 0.9rem;
    font-weight: 400;
    text-transform: lowercase;
}

.asset-window-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.window-toggle-btn {
    font-size: 1rem;
    color: var(--white);
    transition: transform 0.2s ease;
    font-weight: 400;
}

.asset-window.collapsed .window-toggle-btn {
    transform: rotate(90deg);
}

.asset-window-content {
    max-height: 400px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

/* Info window specific styling */
.asset-window:has(.info-content) .asset-window-content {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
}

.asset-window.collapsed .asset-window-content {
    max-height: 0;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 15px;
    background: var(--light-pink);
}

.category-tab {
    background: var(--white);
    border: 2px solid var(--dark-purple);
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--dark-purple);
    text-transform: lowercase;
}

.category-tab:hover {
    background: var(--primary-pink);
    color: var(--white);
}

.category-tab.active {
    background: var(--primary-pink);
    color: var(--white);
}

/* Asset Grid */
.asset-grid {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 12px;
    background: var(--white);
    max-height: 300px;
    overflow-y: auto;
}

.asset-item {
    aspect-ratio: 1;
    background: var(--cream);
    border: 2px solid var(--dark-purple);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.asset-item:hover {
    border-color: var(--primary-pink);
    background: var(--light-pink);
}

.asset-item img {
    width: 85%;
    height: 85%;
    object-fit: contain;
    border-radius: 6px;
}



/* Subcategory Tabs */
.subcategory-tabs {
    display: flex;
    background: var(--light-pink);
    border-bottom: 2px solid var(--dark-purple);
    overflow-x: auto;
}

.subcategory-tab {
    background: transparent;
    border: none;
    border-right: 1px solid var(--dark-purple);
    padding: 6px 10px;
    font-family: inherit;
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--dark-purple);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-transform: lowercase;
}

.subcategory-tab:last-child {
    border-right: none;
}

.subcategory-tab:hover {
    background: rgba(255, 105, 180, 0.2);
}

.subcategory-tab.active {
    background: var(--primary-pink);
    color: var(--white);
}

/* Asset Info */
.asset-info {
    padding: 15px;
    background: var(--white);
}

.asset-info p {
    color: var(--dark-purple);
    font-size: 0.85rem;
    line-height: 1.5;
    text-align: left;
    margin: 0 0 10px 0;
    background: var(--light-pink);
    padding: 12px;
    border-radius: 6px;
    border: 2px solid var(--dark-purple);
    font-weight: 400;
}

/* Language Toggle */
.language-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    justify-content: center;
}

.lang-btn {
    padding: 8px 16px;
    border: 2px solid var(--dark-purple);
    background: var(--white);
    color: var(--dark-purple);
    border-radius: 6px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    background: var(--primary-pink);
    color: var(--white);
    transform: translateY(-1px);
}

.lang-btn.active {
    background: var(--primary-pink);
    color: var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Feature Guide */
.feature-guide {
    margin-top: 15px;
    padding: 18px;
    background: var(--light-pink);
    border-radius: 8px;
    border: 2px solid var(--dark-purple);
}

.feature-guide h4 {
    margin: 0 0 10px 0;
    color: var(--dark-purple);
    font-size: 1rem;
    font-weight: 700;
}

.feature-guide ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.feature-guide li {
    margin-bottom: 8px;
    color: var(--dark-purple);
    font-size: 0.85rem;
    line-height: 1.5;
}

.feature-guide strong {
    color: var(--primary-pink);
    font-weight: 700;
}

/* Tips Section */
.tips-section {
    margin-top: 15px;
    padding: 18px;
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border-radius: 8px;
    border: 2px solid var(--dark-purple);
}

.tips-section h4 {
    margin: 0 0 10px 0;
    color: var(--dark-purple);
    font-size: 1rem;
    font-weight: 700;
}

.tips-section ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.tips-section li {
    margin-bottom: 8px;
    color: var(--dark-purple);
    font-size: 0.85rem;
    line-height: 1.5;
}

.tips-section strong {
    color: #e17055;
    font-weight: 700;
}

/* Ensure info section is always visible */
.info-content {
    display: block !important;
}

/* Hide Chinese content by default */
.info-content[data-lang="zh"] {
    display: none !important;
}

/* Info window should not be collapsible */
.asset-window:has(.info-content) {
    min-height: auto;
}

.asset-window:has(.info-content) .asset-window-content {
    display: block !important;
    max-height: 600px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Download and Share Section */
.download-share-section {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cool-download-btn {
    background: linear-gradient(135deg, #ff69b4 0%, #ff1493 50%, #d946ef 100%);
    border: none;
    border-radius: 12px;
    padding: 14px 24px;
    color: white;
    font-family: 'Super Bubble', 'Arial', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.3);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cool-download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.cool-download-btn:hover::before {
    left: 100%;
}

.cool-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 105, 180, 0.4);
}

.cool-download-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 105, 180, 0.3);
}

.twitter-share-btn {
    background: linear-gradient(135deg, #1da1f2 0%, #0d8bd9 100%);
    border: none;
    border-radius: 12px;
    padding: 14px 24px;
    color: white;
    font-family: 'Super Bubble', 'Arial', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(29, 161, 242, 0.3);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.twitter-share-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.twitter-share-btn:hover::before {
    left: 100%;
}

.twitter-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 161, 242, 0.4);
    color: white;
    text-decoration: none;
}

.twitter-share-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(29, 161, 242, 0.3);
}

/* Mobile Controls */
.mobile-controls {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    border-radius: 20px;
    border: 3px solid var(--dark-purple);
    box-shadow: var(--bubble-shadow);
    padding: 10px;
    gap: 10px;
    z-index: 1000;
}

.mobile-btn {
    background: var(--primary-pink);
    color: var(--white);
    border: 2px solid var(--dark-purple);
    border-radius: 8px;
    padding: 8px 12px;
    font-family: inherit;
    font-weight: 400;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.mobile-btn:hover {
    background: var(--deep-pink);
}

.mobile-btn.export {
    background: var(--purple);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 27, 105, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    border: 4px solid var(--dark-purple);
    box-shadow: var(--bubble-shadow);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--light-pink);
    border-top: 5px solid var(--primary-pink);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 27, 105, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    border: 4px solid var(--dark-purple);
    box-shadow: var(--bubble-shadow);
    text-align: center;
}

.modal-content h3 {
    color: var(--dark-purple);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.export-preview {
    background: var(--light-pink);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid var(--dark-purple);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.export-preview canvas {
    max-width: 100%;
    max-height: 200px;
    border-radius: 10px;
}

.export-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.export-action-btn {
    background: var(--primary-pink);
    color: var(--white);
    border: 2px solid var(--dark-purple);
    border-radius: 12px;
    padding: 10px 15px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 120px;
}

.export-action-btn:hover {
    background: var(--deep-pink);
    transform: translateY(-1px);
}

.export-action-btn.copy {
    background: var(--purple);
}

.export-action-btn.close {
    background: #6c757d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        padding: 10px;
    }

    .header {
        padding: 10px 15px;
        flex-direction: column;
        gap: 10px;
    }

    .logo-container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .site-icon {
        width: 40px;
        height: 40px;
    }

    .logo-text h1 {
        font-size: 2rem;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header-actions {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .header-link {
        padding: 6px 12px;
        font-size: 0.8rem;
        justify-content: center;
    }

    .main-content {
        grid-template-columns: 1fr;
        gap: 10px;
        height: auto;
        padding-bottom: 100px; /* Add space for mobile controls */
    }

    .canvas-section {
        order: 1;
    }

    .asset-panel {
        order: 2;
        padding-bottom: 20px; /* Extra space for info content */
    }

    .mobile-controls {
        display: flex;
    }

    .layer-controls {
        display: none;
    }

    .layer-controls.mobile-visible {
        display: block;
        position: relative;
        margin-top: 15px;
        background: var(--white);
        border: 3px solid var(--dark-purple);
        box-shadow: var(--bubble-shadow);
        border-radius: 12px;
        overflow: hidden;
        animation: slideInUp 0.3s ease-out;
    }

    @keyframes slideInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .asset-panel.mobile-hidden {
        display: none;
    }

    #pfpCanvas {
        width: 280px;
        height: 280px;
    }

    body::before {
        background-size: cover;
        background-position: center center;
        opacity: 0.12;
        animation-duration: 25s;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 10px;
    }

    .category-tab {
        font-size: 0.7rem;
        padding: 8px 4px;
    }

    .asset-grid {
        grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
        gap: 8px;
        padding: 10px;
    }

    .asset-window-header {
        padding: 8px 12px;
    }

    .asset-window-title {
        font-size: 0.9rem;
    }

    /* Mobile upload button improvements */
    .upload-btn {
        padding: 6px 10px;
        font-size: 1.1rem;
        min-width: 40px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .subcategory-tab {
        padding: 6px 8px;
        font-size: 0.7rem;
    }

    .canvas-window-header,
    .layer-window-header {
        padding: 8px 15px;
    }

    .canvas-window-title,
    .layer-window-title {
        font-size: 1rem;
    }

    /* Mobile scaling controls */
    .layer-scaling {
        margin-top: 10px;
        padding: 8px;
    }

    .scaling-controls {
        gap: 6px;
    }

    .scale-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .layer-positioning {
        margin-top: 10px;
        padding: 8px;
    }

    .positioning-controls {
        gap: 3px;
    }

    .position-btn {
        width: 50px;
        height: 50px;
        font-size: 1.6rem;
        border-radius: 10px;
    }

    .position-row {
        gap: 6px;
    }

    .layer-rotation {
        margin-top: 10px;
        padding: 8px;
    }

    .rotation-controls {
        gap: 6px;
    }

    .rotation-btn {
        width: 50px;
        height: 50px;
        font-size: 1.6rem;
        border-radius: 10px;
    }

    /* Mobile styles for download and share buttons */
    .download-share-section {
        margin-top: 10px;
        gap: 8px;
    }

    .cool-download-btn,
    .twitter-share-btn {
        padding: 12px 20px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.5rem;
    }

    .export-btn {
        padding: 8px 15px;
        font-size: 1rem;
    }

    #pfpCanvas {
        width: 250px;
        height: 250px;
    }

    .modal-content {
        padding: 20px;
        max-width: 90vw;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Mobile upload modal improvements */
    .upload-content {
        flex-direction: column;
        gap: 15px;
    }

    .upload-preview {
        min-height: 150px;
    }

    .upload-form {
        gap: 12px;
    }

    .upload-actions {
        flex-direction: column;
        gap: 8px;
    }

    .upload-action-btn {
        padding: 12px 20px;
        font-size: 1rem;
        min-height: 44px;
    }

    .main-content {
        padding-bottom: 120px; /* Extra space for smaller screens */
    }

    body::before {
        background-attachment: scroll;
        background-size: cover;
        background-position: center center;
        opacity: 0.1;
        animation: none;
    }

    body::after {
        display: none;
    }

    .export-actions {
        flex-direction: column;
    }

    .export-action-btn {
        min-width: auto;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-pink);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-pink);
    border-radius: 10px;
    border: 1px solid var(--dark-purple);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--deep-pink);
}

/* Info window specific scrollbar */
.asset-window:has(.info-content) .asset-window-content::-webkit-scrollbar {
    width: 12px;
}

.asset-window:has(.info-content) .asset-window-content::-webkit-scrollbar-thumb {
    background: var(--purple);
    border-radius: 10px;
    border: 1px solid var(--dark-purple);
}

.asset-window:has(.info-content) .asset-window-content::-webkit-scrollbar-thumb:hover {
    background: #8b5cf6;
}

/* Selection Indicator */
.selected-asset {
    border-color: var(--purple) !important;
    box-shadow: 0 0 0 3px rgba(217, 70, 239, 0.3) !important;
    transform: scale(1.1) !important;
}

/* Drag and Drop */
.dragging {
    opacity: 0.7;
    transform: scale(1.05);
    z-index: 1000;
    pointer-events: none;
}

.drop-zone {
    position: relative;
}

.drop-zone.drag-over::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(217, 70, 239, 0.2);
    border: 3px dashed var(--purple);
    border-radius: 10px;
    pointer-events: none;
} 