/* Mystical DnD Theme - Wacky Wizard Creations */

:root {
    --primary-dark: #0d0a1a;
    --primary-purple: #1a0a2e;
    --accent-gold: #d4af37;
    --accent-purple: #9b59b6;
    --accent-teal: #1abc9c;
    --text-light: #e8e0f0;
    --text-muted: #a89bb8;
    --glow-purple: rgba(155, 89, 182, 0.5);
    --glow-gold: rgba(212, 175, 55, 0.5);
}

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

body {
    font-family: 'Crimson Text', serif;
    background: var(--primary-dark);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(155, 89, 182, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(26, 10, 46, 1) 0%, var(--primary-dark) 100%);
    z-index: -2;
}

/* Floating Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

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

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

/* Navigation */
.mystical-nav {
    background: rgba(13, 10, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 30px rgba(155, 89, 182, 0.3);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    color: var(--accent-gold);
    text-decoration: none;
    text-shadow: 0 0 20px var(--glow-gold);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo:hover {
    text-shadow: 0 0 30px var(--glow-gold), 0 0 60px var(--glow-gold);
    transform: scale(1.02);
}

.logo-icon {
    font-size: 1.8rem;
    animation: wizard-float 3s ease-in-out infinite;
}

@keyframes wizard-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
    transition: left 0.5s ease;
}

.nav-links a:hover::before {
    left: 100%;
}

.nav-links a:hover {
    color: var(--accent-gold);
    background: rgba(155, 89, 182, 0.2);
    text-shadow: 0 0 10px var(--glow-gold);
}

/* Main Content */
.mystical-main {
    min-height: calc(100vh - 200px);
    padding: 0;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 8rem 2rem 6rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(155, 89, 182, 0.2) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-family: 'Cinzel', serif;
    font-size: 4rem;
    color: var(--accent-gold);
    text-shadow: 0 0 40px var(--glow-gold), 0 0 80px rgba(212, 175, 55, 0.3);
    margin-bottom: 1.5rem;
    animation: title-glow 3s ease-in-out infinite alternate;
    line-height: 1.2;
}

@keyframes title-glow {
    from {
        text-shadow: 0 0 40px var(--glow-gold), 0 0 80px rgba(212, 175, 55, 0.3);
    }
    to {
        text-shadow: 0 0 60px var(--glow-gold), 0 0 100px rgba(212, 175, 55, 0.5), 0 0 120px rgba(155, 89, 182, 0.3);
    }
}

.tagline {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-style: italic;
    letter-spacing: 0.05em;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-view, .btn-buy {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.1rem 2.5rem;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    text-decoration: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary, .btn-buy {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #6c3483 100%);
    color: white;
    box-shadow: 0 4px 20px var(--glow-purple);
}

.btn-primary::before, .btn-buy::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.6s ease;
}

.btn-primary:hover::before, .btn-buy:hover::before {
    left: 100%;
}

.btn-primary:hover, .btn-buy:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 35px var(--glow-purple), 0 0 50px rgba(155, 89, 182, 0.3);
}

.btn-secondary, .btn-view {
    background: transparent;
    color: var(--accent-gold);
    border: 2px solid var(--accent-gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.btn-secondary:hover, .btn-view:hover {
    background: var(--accent-gold);
    color: var(--primary-dark);
    box-shadow: 0 0 40px var(--glow-gold);
    transform: translateY(-3px);
}

/* Floating Elements */
.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
}

.float {
    position: absolute;
    font-size: 2.5rem;
    opacity: 0.4;
    animation: float-icon 8s ease-in-out infinite;
    filter: drop-shadow(0 0 10px currentColor);
}

.float:nth-child(1) { left: 5%; top: 15%; animation-delay: 0s; color: var(--accent-gold); }
.float:nth-child(2) { right: 10%; top: 25%; animation-delay: 1.5s; color: var(--accent-purple); }
.float:nth-child(3) { left: 15%; top: 65%; animation-delay: 3s; color: var(--accent-teal); }
.float:nth-child(4) { right: 5%; top: 55%; animation-delay: 4.5s; color: var(--accent-gold); }
.float:nth-child(5) { left: 45%; top: 85%; animation-delay: 6s; color: var(--accent-purple); }

@keyframes float-icon {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.4; }
    25% { transform: translateY(-15px) rotate(5deg); opacity: 0.6; }
    50% { transform: translateY(-25px) rotate(0deg); opacity: 0.8; }
    75% { transform: translateY(-15px) rotate(-5deg); opacity: 0.6; }
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.feature-card {
    background: linear-gradient(135deg, rgba(45, 27, 78, 0.6) 0%, rgba(26, 10, 46, 0.8) 100%);
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(155, 89, 182, 0.4), 0 0 0 1px rgba(212, 175, 55, 0.2);
    border-color: rgba(212, 175, 55, 0.4);
}

.feature-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1.2rem;
    filter: drop-shadow(0 0 20px currentColor);
    animation: icon-bounce 3s ease-in-out infinite;
}

.feature-card:nth-child(1) .feature-icon { animation-delay: 0s; }
.feature-card:nth-child(2) .feature-icon { animation-delay: 0.5s; }
.feature-card:nth-child(3) .feature-icon { animation-delay: 1s; }

@keyframes icon-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.feature-card h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    color: var(--accent-gold);
    margin-bottom: 0.8rem;
    text-shadow: 0 0 15px var(--glow-gold);
}

.feature-card p {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* About Section */
.about {
    max-width: 900px;
    margin: 4rem auto;
    padding: 3rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(45, 27, 78, 0.4) 0%, rgba(13, 10, 26, 0.8) 100%);
    border-radius: 20px;
    border: 1px solid rgba(155, 89, 182, 0.3);
    position: relative;
    overflow: hidden;
}

.about::before,
.about::after {
    content: '✨';
    position: absolute;
    font-size: 2rem;
    opacity: 0.3;
}

.about::before {
    top: 1rem;
    left: 1.5rem;
}

.about::after {
    bottom: 1rem;
    right: 1.5rem;
}

.about h2 {
    font-family: 'Cinzel', serif;
    font-size: 2.2rem;
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
    text-shadow: 0 0 30px var(--glow-gold);
}

.about p {
    font-size: 1.25rem;
    line-height: 1.9;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
}

/* Shop Hero */
.shop-hero {
    text-align: center;
    padding: 4rem 2rem 2rem;
    background: linear-gradient(180deg, rgba(155, 89, 182, 0.1) 0%, transparent 100%);
}

.shop-hero h1 {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    color: var(--accent-gold);
    text-shadow: 0 0 40px var(--glow-gold);
    margin-bottom: 0.5rem;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.product-card {
    background: linear-gradient(135deg, rgba(45, 27, 78, 0.8) 0%, rgba(26, 10, 46, 0.9) 100%);
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s ease;
}

.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 60px rgba(155, 89, 182, 0.4), 0 0 0 1px rgba(212, 175, 55, 0.3);
    border-color: var(--accent-gold);
}

.product-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.placeholder-image {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-dark) 100%);
}

.product-info {
    padding: 1.5rem;
}

.product-info h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
}

.product-category {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-style: italic;
}

.product-price {
    font-size: 1.6rem;
    color: var(--accent-gold);
    margin: 0.8rem 0;
    text-shadow: 0 0 15px var(--glow-gold);
}

.empty-shop {
    text-align: center;
    padding: 6rem 2rem;
    grid-column: 1 / -1;
}

.empty-shop p {
    font-size: 1.4rem;
    color: var(--text-muted);
    margin: 0.8rem 0;
}

.empty-shop p:first-child {
    font-size: 1.8rem;
}

/* Product Detail */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
}

@media (max-width: 900px) {
    .product-detail {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.product-image-large img {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(155, 89, 182, 0.4);
    transition: transform 0.4s ease;
}

.product-image-large img:hover {
    transform: scale(1.02);
}

.placeholder-image-large {
    height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8rem;
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-dark) 100%);
    border-radius: 16px;
}

.product-info-detail {
    padding: 1rem;
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    display: inline-block;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--accent-gold);
    transform: translateX(-5px);
}

.product-info-detail h1 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 30px var(--glow-gold);
}

.price-large {
    font-size: 3rem;
    color: var(--accent-gold);
    margin: 1.5rem 0;
    text-shadow: 0 0 20px var(--glow-gold);
}

.description {
    font-size: 1.2rem;
    line-height: 1.9;
    margin-bottom: 2rem;
    color: var(--text-light);
}

.out-of-stock {
    color: #e74c3c;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Chat */
.chat-container {
    max-width: 900px;
    margin: 0 auto;
    height: calc(100vh - 180px);
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.chat-header {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(180deg, rgba(155, 89, 182, 0.2) 0%, transparent 100%);
    border-radius: 16px 16px 0 0;
}

.chat-header h1 {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: var(--accent-gold);
    text-shadow: 0 0 30px var(--glow-gold);
}

.chat-header p {
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: rgba(13, 10, 26, 0.8);
    border-radius: 0;
}

.message {
    display: flex;
    margin-bottom: 1.2rem;
    gap: 1rem;
    animation: message-appear 0.3s ease;
}

@keyframes message-appear {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    justify-content: flex-end;
}

.message-avatar {
    font-size: 2.2rem;
    flex-shrink: 0;
}

.message-content {
    background: linear-gradient(135deg, rgba(45, 27, 78, 0.9) 0%, rgba(26, 10, 46, 0.9) 100%);
    padding: 1rem 1.3rem;
    border-radius: 16px;
    max-width: 70%;
    border: 1px solid rgba(155, 89, 182, 0.2);
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #6c3483 100%);
    border-color: rgba(155, 89, 182, 0.4);
}

.message-content p {
    line-height: 1.6;
    font-size: 1.05rem;
}

.chat-input-container {
    padding: 1.5rem;
    background: rgba(13, 10, 26, 0.9);
    border-radius: 0 0 16px 16px;
    border: 1px solid rgba(155, 89, 182, 0.2);
    border-top: none;
}

#chat-form {
    display: flex;
    gap: 1rem;
}

#chat-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 2px solid rgba(155, 89, 182, 0.4);
    background: rgba(26, 10, 46, 0.8);
    color: var(--text-light);
    font-size: 1.1rem;
    font-family: 'Crimson Text', serif;
    transition: all 0.3s ease;
}

#chat-input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
}

#chat-input::placeholder {
    color: var(--text-muted);
}

#send-button {
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--accent-purple) 0%, #6c3483 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#send-button:hover {
    box-shadow: 0 5px 30px rgba(155, 89, 182, 0.6);
    transform: translateY(-2px);
}

/* Footer */
.mystical-footer {
    background: rgba(13, 10, 26, 0.95);
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    padding: 2.5rem;
    text-align: center;
    position: relative;
}

.footer-content p {
    margin: 0.5rem 0;
    color: var(--text-muted);
}

.footer-content p:first-child {
    font-family: 'Cinzel', serif;
    color: var(--accent-gold);
    font-size: 1.2rem;
}

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

::-webkit-scrollbar-track {
    background: var(--primary-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-purple);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero {
        padding: 5rem 1.5rem 4rem;
    }

    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links a {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .features {
        padding: 2rem 1rem;
    }

    .product-detail {
        padding: 1rem;
    }

    .tagline {
        font-size: 1.2rem;
    }

    .btn-primary, .btn-secondary {
        padding: 0.9rem 1.8rem;
        font-size: 1rem;
    }
}