/* MCBuilder - Unique Themed Styles */

:root {
    --bg-dark: #0a0a12;
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #252540;
    --bg-card: #1e1e32;

    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;

    --accent-cyan: #00d4ff;
    --accent-blue: #4a90d9;
    --accent-purple: #9b59b6;
    --accent-magenta: #ff44aa;
    --accent-green: #2ecc71;
    --accent-orange: #e67e22;
    --accent-gold: #ffd700;

    --border-color: #2a2a40;
    --border-radius: 8px;
    --border-radius-lg: 16px;

    --transition: all 0.2s ease;
}

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

body {
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ============================================
   HEADER
   ============================================ */

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
    background: rgba(15, 15, 26, 0.95);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.header-brand h1 {
    font-size: 1.2rem;
    font-weight: 800;
    background: linear-gradient(
        135deg,
        var(--accent-cyan),
        var(--accent-purple)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-tabs {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-secondary);
    padding: 0.25rem;
    border-radius: 12px;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.credits-display {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: linear-gradient(
        135deg,
        rgba(155, 89, 182, 0.2),
        rgba(74, 144, 217, 0.2)
    );
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: 20px;
    cursor: pointer;
}

#creditsAmount {
    font-weight: 700;
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-ghost:hover {
    color: var(--text-primary);
}

.btn-signup {
    background: linear-gradient(
        135deg,
        var(--accent-purple),
        var(--accent-magenta)
    );
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-signup:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(155, 89, 182, 0.3);
}

#authButtons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tab-panels {
    flex: 1;
    overflow: hidden;
}

.tab-content {
    display: none;
    height: 100%;
}

.tab-content.active {
    display: block;
}

/* ============================================
   MODELS TAB - Holographic Blueprint Theme
   ============================================ */

.models-page {
    height: 100%;
    background: linear-gradient(180deg, #050810 0%, #0a1020 100%);
    position: relative;
    overflow: hidden;
}

/* Animated Grid Background */
.holo-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

.models-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
    height: 100%;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

/* Viewport */
.viewport-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.viewport-frame {
    flex: 1;
    position: relative;
    background: rgba(0, 20, 40, 0.6);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

/* Scanline Effect */
.viewport-scanline {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 212, 255, 0.5),
        transparent
    );
    animation: scanline 3s linear infinite;
    z-index: 10;
    pointer-events: none;
}

@keyframes scanline {
    0% {
        top: 0;
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

/* Corner Brackets */
.viewport-corners .corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-cyan);
}

.corner.tl {
    top: 8px;
    left: 8px;
    border-right: none;
    border-bottom: none;
}
.corner.tr {
    top: 8px;
    right: 8px;
    border-left: none;
    border-bottom: none;
}
.corner.bl {
    bottom: 8px;
    left: 8px;
    border-right: none;
    border-top: none;
}
.corner.br {
    bottom: 8px;
    right: 8px;
    border-left: none;
    border-top: none;
}

.viewport-label {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    font-family: "Orbitron", sans-serif;
    font-size: 0.7rem;
    color: var(--accent-cyan);
    letter-spacing: 3px;
    opacity: 0.7;
}

.viewport-3d {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewport-3d canvas {
    width: 100% !important;
    height: 100% !important;
}

.viewport-placeholder {
    text-align: center;
}

/* Holographic Rings */
.holo-cube {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    position: relative;
}

.holo-ring {
    position: absolute;
    border: 2px solid var(--accent-cyan);
    border-radius: 50%;
    opacity: 0.5;
}

.ring1 {
    width: 80px;
    height: 80px;
    animation: ring1 3s linear infinite;
}

.ring2 {
    width: 60px;
    height: 60px;
    top: 10px;
    left: 10px;
    animation: ring2 2.5s linear infinite;
}

.ring3 {
    width: 40px;
    height: 40px;
    top: 20px;
    left: 20px;
    animation: ring3 2s linear infinite;
}

@keyframes ring1 {
    0% {
        transform: rotateX(60deg) rotateZ(0deg);
    }
    100% {
        transform: rotateX(60deg) rotateZ(360deg);
    }
}

@keyframes ring2 {
    0% {
        transform: rotateX(60deg) rotateZ(120deg);
    }
    100% {
        transform: rotateX(60deg) rotateZ(480deg);
    }
}

@keyframes ring3 {
    0% {
        transform: rotateX(60deg) rotateZ(240deg);
    }
    100% {
        transform: rotateX(60deg) rotateZ(600deg);
    }
}

.viewport-placeholder p {
    font-family: "Orbitron", sans-serif;
    font-size: 0.75rem;
    color: var(--accent-cyan);
    letter-spacing: 2px;
    opacity: 0.6;
}

.viewport-stats {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: flex;
    gap: 1.5rem;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.65rem;
    color: var(--accent-cyan);
    opacity: 0.5;
}

.viewport-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.holo-btn {
    padding: 0.6rem 1.2rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 4px;
    color: var(--accent-cyan);
    font-family: "Orbitron", sans-serif;
    font-size: 0.7rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
}

.holo-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--accent-cyan);
}

.holo-btn.primary {
    background: var(--accent-cyan);
    color: #000;
}

/* Control Panel */
.control-panel {
    background: rgba(10, 15, 30, 0.9);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 4px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.panel-indicator {
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-cyan);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.panel-header span {
    font-family: "Orbitron", sans-serif;
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: var(--accent-cyan);
}

.panel-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.holo-label {
    font-family: "Orbitron", sans-serif;
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.holo-input {
    width: 100%;
    height: 80px;
    padding: 0.75rem;
    background: rgba(0, 20, 40, 0.5);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.9rem;
    resize: none;
    transition: var(--transition);
}

.holo-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

.holo-input::placeholder {
    color: var(--text-muted);
}

.holo-select-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.holo-select {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.75rem;
    background: rgba(0, 20, 40, 0.5);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 4px;
    color: var(--text-secondary);
    font-family: "Orbitron", sans-serif;
    font-size: 0.65rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
}

.holo-select:hover {
    border-color: var(--accent-cyan);
}

.holo-select.active {
    background: rgba(0, 212, 255, 0.15);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.select-icon {
    font-size: 1.25rem;
}

.scale-selector {
    display: flex;
    gap: 0.5rem;
}

.scale-btn {
    flex: 1;
    padding: 0.6rem;
    background: rgba(0, 20, 40, 0.5);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 4px;
    color: var(--text-secondary);
    font-family: "Orbitron", sans-serif;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.scale-btn:hover {
    border-color: var(--accent-cyan);
}

.scale-btn.active {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: #000;
}

/* Premium Section */
.premium-section {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.premium-label {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
}

.premium-models-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.premium-model-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.6rem;
    background: linear-gradient(
        135deg,
        rgba(255, 215, 0, 0.05),
        rgba(255, 140, 0, 0.05)
    );
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 4px;
    color: rgba(255, 215, 0, 0.7);
    font-family: "Orbitron", sans-serif;
    font-size: 0.6rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.premium-model-btn:hover {
    background: linear-gradient(
        135deg,
        rgba(255, 215, 0, 0.15),
        rgba(255, 140, 0, 0.1)
    );
    border-color: rgba(255, 215, 0, 0.5);
}

.premium-model-btn.unlocked {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.premium-model-btn.unlocked .lock-icon {
    display: none;
}

.premium-model-btn.active {
    background: linear-gradient(
        135deg,
        rgba(255, 215, 0, 0.25),
        rgba(255, 140, 0, 0.2)
    );
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.premium-model-btn .lock-icon {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.6rem;
    opacity: 0.7;
}

.premium-model-btn .select-icon {
    font-size: 1.1rem;
}

.generate-holo-btn {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(
        135deg,
        rgba(0, 212, 255, 0.2),
        rgba(0, 150, 255, 0.1)
    );
    border: 1px solid var(--accent-cyan);
    border-radius: 4px;
    color: var(--accent-cyan);
    font-family: "Orbitron", sans-serif;
    font-size: 0.85rem;
    letter-spacing: 2px;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition);
}

.generate-holo-btn:hover {
    background: linear-gradient(
        135deg,
        rgba(0, 212, 255, 0.3),
        rgba(0, 150, 255, 0.2)
    );
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        left: 100%;
    }
}

.btn-cost {
    opacity: 0.7;
    font-size: 0.75rem;
}

.quick-access {
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 212, 255, 0.1);
}

.quick-label {
    font-family: "Orbitron", sans-serif;
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.preset-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.preset-list button {
    padding: 0.35rem 0.7rem;
    background: transparent;
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 3px;
    color: var(--text-muted);
    font-size: 0.7rem;
    cursor: pointer;
    transition: var(--transition);
}

.preset-list button:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* Premium Models Library */
.premium-library {
    margin-top: 1.5rem;
    padding: 1rem;
    background: linear-gradient(
        135deg,
        rgba(255, 215, 0, 0.05),
        rgba(255, 140, 0, 0.03)
    );
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 6px;
}

.premium-library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.15);
}

.premium-library-header .premium-label {
    font-family: "Orbitron", sans-serif;
    font-size: 0.7rem;
    letter-spacing: 2px;
}

.premium-unlock-hint {
    font-size: 0.6rem;
    color: rgba(255, 215, 0, 0.6);
    background: rgba(255, 215, 0, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
}

.premium-model-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.premium-model-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.premium-model-item:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.4);
    transform: translateX(4px);
}

.premium-model-item .model-icon {
    font-size: 1.2rem;
}

.premium-model-item .model-name {
    flex: 1;
    font-family: "Orbitron", sans-serif;
    font-size: 0.7rem;
    color: rgba(255, 215, 0, 0.8);
    letter-spacing: 1px;
}

.premium-model-item .lock-badge {
    font-size: 0.7rem;
    opacity: 0.6;
}

.premium-model-item.unlocked .lock-badge {
    display: none;
}

.premium-model-item.unlocked::after {
    content: "↓";
    color: var(--accent-gold);
    font-weight: bold;
}

/* ============================================
   PLUGINS TAB - Magic Spell Card Theme
   ============================================ */

.plugins-page {
    height: 100%;
    background: linear-gradient(180deg, #1a0a20 0%, #0f0515 100%);
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
}

/* Floating Particles */
.magic-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-magenta);
    border-radius: 50%;
    opacity: 0.6;
    animation: float 10s infinite;
}

.p1 {
    left: 10%;
    animation-delay: 0s;
}
.p2 {
    left: 30%;
    animation-delay: 2s;
}
.p3 {
    left: 50%;
    animation-delay: 4s;
}
.p4 {
    left: 70%;
    animation-delay: 6s;
}
.p5 {
    left: 90%;
    animation-delay: 8s;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
    }
}

.plugins-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Spellbook */
.spellbook {
    background: linear-gradient(
        180deg,
        rgba(40, 20, 50, 0.9),
        rgba(20, 10, 30, 0.95)
    );
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 0 40px rgba(155, 89, 182, 0.2),
        inset 0 0 60px rgba(155, 89, 182, 0.05);
}

.book-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.book-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.book-header h2 {
    font-size: 1.5rem;
    background: linear-gradient(
        135deg,
        var(--accent-purple),
        var(--accent-magenta)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.book-header p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.spell-input-area {
    flex: 1;
    position: relative;
}

.spell-runes {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.rune {
    font-size: 1.25rem;
    color: var(--accent-purple);
    animation: runeGlow 2s ease-in-out infinite;
}

.rune:nth-child(2) {
    animation-delay: 0.3s;
}
.rune:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes runeGlow {
    0%,
    100% {
        opacity: 0.4;
    }
    50% {
        opacity: 1;
    }
}

.spell-textarea {
    width: 100%;
    height: 150px;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    resize: none;
    transition: var(--transition);
}

.spell-textarea:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 30px rgba(155, 89, 182, 0.3);
}

.spell-textarea::placeholder {
    color: var(--text-muted);
}

.spell-config {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.config-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.config-icon {
    font-size: 1.1rem;
}

.config-item select {
    flex: 1;
    padding: 0.6rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.cast-spell-btn {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(
        135deg,
        var(--accent-purple),
        var(--accent-magenta)
    );
    border: none;
    border-radius: var(--border-radius);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition);
}

.cast-spell-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(155, 89, 182, 0.4);
}

.spell-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s;
}

.cast-spell-btn:active .spell-effect {
    width: 300px;
    height: 300px;
    opacity: 0;
}

.spell-cost {
    opacity: 0.8;
    font-size: 0.85rem;
}

.spell-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
}

.spell-suggestions button {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: rgba(155, 89, 182, 0.1);
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.spell-suggestions button:hover {
    background: rgba(155, 89, 182, 0.2);
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

/* Result Scroll */
.result-scroll {
    background: linear-gradient(
        180deg,
        rgba(40, 20, 50, 0.9),
        rgba(20, 10, 30, 0.95)
    );
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 0 40px rgba(155, 89, 182, 0.2),
        inset 0 0 60px rgba(155, 89, 182, 0.05);
}

.scroll-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(155, 89, 182, 0.2);
    color: var(--accent-purple);
    font-size: 0.9rem;
    font-weight: 600;
}

.scroll-ornament {
    opacity: 0.5;
}

.scroll-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 1rem;
    overflow-y: auto;
}

.scroll-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.placeholder-orb {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: radial-gradient(circle, var(--accent-purple), transparent);
    border-radius: 50%;
    opacity: 0.3;
    animation: orbPulse 2s infinite;
}

@keyframes orbPulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.5;
    }
}

.scroll-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(155, 89, 182, 0.2);
}

.scroll-btn {
    flex: 1;
    padding: 0.75rem;
    background: rgba(155, 89, 182, 0.1);
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.scroll-btn:hover {
    background: rgba(155, 89, 182, 0.2);
    color: var(--text-primary);
}

.scroll-btn.primary {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
}

/* Ability Cards in Output */
.ability-card {
    background: rgba(155, 89, 182, 0.1);
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.ability-card h4 {
    color: var(--accent-magenta);
    margin-bottom: 0.5rem;
}

.ability-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* AI Config Section for Plugins */
.ai-config-section {
    margin-top: 1.5rem;
    border: 1px solid rgba(180, 100, 255, 0.2);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

.ai-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background: linear-gradient(
        135deg,
        rgba(180, 100, 255, 0.1),
        rgba(255, 100, 200, 0.05)
    );
    cursor: pointer;
    transition: var(--transition);
    font-family: "Cinzel", serif;
    font-size: 0.85rem;
    color: var(--accent-magenta);
}

.ai-config-header:hover {
    background: linear-gradient(
        135deg,
        rgba(180, 100, 255, 0.15),
        rgba(255, 100, 200, 0.1)
    );
}

.ai-toggle-icon {
    transition: transform 0.3s ease;
}

.ai-config-section.expanded .ai-toggle-icon {
    transform: rotate(180deg);
}

.ai-config-body {
    padding: 1rem;
    border-top: 1px solid rgba(180, 100, 255, 0.1);
}

.ai-config-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.ai-provider-select {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ai-provider-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    background: transparent;
    border: 1px solid rgba(180, 100, 255, 0.3);
    border-radius: 4px;
    color: var(--text-muted);
    font-family: "Cinzel", serif;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.ai-provider-btn:hover {
    border-color: rgba(180, 100, 255, 0.5);
    color: var(--text-secondary);
}

.ai-provider-btn.active {
    background: linear-gradient(
        135deg,
        rgba(180, 100, 255, 0.2),
        rgba(255, 100, 200, 0.1)
    );
    border-color: var(--accent-magenta);
    color: var(--accent-magenta);
}

.ai-key-input {
    display: flex;
    gap: 0.5rem;
}

.ai-key-input input {
    flex: 1;
    padding: 0.6rem 0.8rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(180, 100, 255, 0.2);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.8rem;
}

.ai-key-input input:focus {
    outline: none;
    border-color: var(--accent-magenta);
}

.ai-key-input input::placeholder {
    color: var(--text-muted);
}

.ai-key-save {
    padding: 0.6rem 1rem;
    background: linear-gradient(
        135deg,
        var(--accent-magenta),
        var(--accent-purple)
    );
    border: none;
    border-radius: 4px;
    color: #fff;
    font-family: "Cinzel", serif;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.ai-key-save:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(180, 100, 255, 0.4);
}

.ai-key-status {
    margin-top: 0.75rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.ai-key-status.success {
    color: #4ade80;
}

.ai-key-status.error {
    color: #f87171;
}

/* ============================================
   TEXTURES TAB - Artistic Paint Theme
   ============================================ */

.textures-page {
    height: 100%;
    background: linear-gradient(135deg, #1a1520, #15101a);
    padding: 1.5rem;
}

.canvas-workspace {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.canvas-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.canvas-frame {
    background: linear-gradient(135deg, #2a2035, #1f1825);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow:
        0 0 0 1px rgba(155, 89, 182, 0.2),
        0 20px 60px rgba(0, 0, 0, 0.4),
        inset 0 0 60px rgba(155, 89, 182, 0.05);
}

.texture-canvas {
    width: 300px;
    height: 300px;
    background: repeating-conic-gradient(#1a1520 0% 25%, #15101a 0% 50%) 50% /
        20px 20px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.canvas-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.paint-splash {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: linear-gradient(
        135deg,
        var(--accent-purple),
        var(--accent-orange)
    );
    border-radius: 50%;
    opacity: 0.3;
    filter: blur(10px);
    animation: pulse 2s infinite;
}

.texture-result {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.texture-result canvas {
    image-rendering: pixelated;
    border-radius: 4px;
}

.canvas-sizes {
    display: flex;
    gap: 1.5rem;
}

.size-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.size-preview canvas {
    background: var(--bg-tertiary);
    border-radius: 4px;
    image-rendering: pixelated;
}

.size-preview span {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.canvas-actions {
    display: flex;
    gap: 0.75rem;
}

.canvas-btn {
    padding: 0.6rem 1.2rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.canvas-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.canvas-btn.primary {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
}

.canvas-btn.gold {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    border-color: transparent;
    color: #000;
    font-weight: 600;
}

/* Tools Panel */
.tools-panel {
    background: rgba(30, 25, 35, 0.9);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    border: 1px solid rgba(155, 89, 182, 0.2);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.tools-panel h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.tool-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tool-section label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.texture-textarea {
    width: 100%;
    height: 80px;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    resize: none;
}

.texture-textarea:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 20px rgba(155, 89, 182, 0.2);
}

.style-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.style-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.style-btn:hover {
    border-color: var(--accent-purple);
}

.style-btn.active {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
}

.style-preview {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.style-preview.infuse {
    background: linear-gradient(135deg, #ff6b6b, #ffd93d);
}
.style-preview.vanilla {
    background: linear-gradient(135deg, #8b7355, #d4a574);
}
.style-preview.modern {
    background: linear-gradient(135deg, #667eea, #764ba2);
}
.style-preview.pixel {
    background: linear-gradient(135deg, #00d4ff, #00ff88);
}

.color-swatches {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.swatch {
    width: 32px;
    height: 32px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.swatch:hover {
    transform: scale(1.1);
}

.swatch.active {
    border-color: white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.tool-select {
    width: 100%;
    padding: 0.6rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.generate-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.generate-btn.texture-generate {
    background: linear-gradient(
        135deg,
        var(--accent-purple),
        var(--accent-orange)
    );
    color: white;
}

.generate-btn.texture-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(155, 89, 182, 0.3);
}

.texture-ideas {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: auto;
}

.texture-ideas button {
    padding: 0.35rem 0.6rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.7rem;
    cursor: pointer;
    transition: var(--transition);
}

.texture-ideas button:hover {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.toast {
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    animation: slideIn 0.3s ease;
}

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

/* ============================================
   MODALS
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
    animation: fadeIn 0.2s ease;
}

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

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

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

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.modal-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal-desc {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Auth Modal */
.auth-modal {
    text-align: center;
}

.auth-modal h2 {
    background: linear-gradient(
        135deg,
        var(--accent-cyan),
        var(--accent-purple)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.2);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-error {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(231, 76, 60, 0.1);
    border-radius: var(--border-radius);
}

.btn-full {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(
        135deg,
        var(--accent-purple),
        var(--accent-magenta)
    );
    color: white;
    border: none;
    padding: 0.85rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(155, 89, 182, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-switch {
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-switch a {
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Credits/Plans Modal */
.credits-modal {
    max-width: 900px;
    text-align: center;
}

.credits-modal-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.credits-modal-header p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.current-plan-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.tier-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.tier-badge.tier-free {
    background: var(--bg-card);
    color: var(--text-muted);
}

.tier-badge.tier-starter {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.tier-badge.tier-creator {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
}

.tier-badge.tier-studio {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.tier-badge.tier-pro_modder {
    background: linear-gradient(135deg, #f39c12, #d68910);
    color: white;
}

.tier-badge.tier-pioneer {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
}

.credits-count {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.plan-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    position: relative;
    transition: var(--transition);
}

.plan-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-purple);
}

.plan-card.popular {
    border-color: var(--accent-purple);
    box-shadow: 0 0 30px rgba(155, 89, 182, 0.2);
}

.plan-card.special {
    border-color: var(--accent-gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}

.plan-card.current {
    opacity: 0.7;
}

.popular-badge,
.special-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.popular-badge {
    background: var(--accent-purple);
    color: white;
}

.special-badge {
    background: linear-gradient(135deg, var(--accent-gold), #ff8c00);
    color: #000;
}

.plan-header {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.plan-header h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
}

.plan-price .price {
    font-size: 1.5rem;
    font-weight: 700;
}

.plan-price .period {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.plan-credits {
    font-size: 0.8rem;
    color: var(--accent-cyan);
    margin-top: 0.25rem;
}

.plan-features {
    list-style: none;
    text-align: left;
    margin-bottom: 1rem;
}

.plan-features li {
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
}

.plan-btn {
    width: 100%;
    padding: 0.6rem;
    border: 2px solid;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.plan-btn:hover:not(.current) {
    transform: scale(1.05);
}

.plan-btn.current {
    cursor: default;
}

.credits-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.credits-footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.secure-badge {
    color: var(--accent-green) !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .models-layout,
    .plugins-layout,
    .canvas-workspace {
        grid-template-columns: 1fr;
    }

    .control-panel,
    .result-scroll {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .app-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .main-tabs {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .tab-text {
        display: none;
    }
}
