/**
 * Mystic Theme Customizer - Frontend Styles
 * Base styles that work alongside dynamic CSS variables
 */

/* ========================================
   Base Reset & Defaults
   ======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* ========================================
   Links & Buttons
   ======================================== */
a {
    color: var(--mtc-primary);
    text-decoration: none;
    transition: color var(--mtc-animation-duration, 0.3s) ease;
}

a:hover {
    color: var(--mtc-primary-light);
}

.btn,
button,
.button,
input[type="submit"],
input[type="button"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--mtc-primary);
    color: var(--mtc-text-primary);
    border: none;
    border-radius: var(--mtc-border-radius, 8px);
    font-family: var(--mtc-font-body);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--mtc-animation-duration, 0.3s) ease;
}

.btn:hover,
button:hover,
.button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background: var(--mtc-primary-light);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--mtc-secondary);
}

.btn-secondary:hover {
    background: var(--mtc-secondary-light);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--mtc-primary);
    color: var(--mtc-primary);
}

.btn-outline:hover {
    background: var(--mtc-primary);
    color: var(--mtc-text-primary);
}

/* ========================================
   Forms
   ======================================== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    background: var(--mtc-surface);
    border: 1px solid var(--mtc-border);
    border-radius: var(--mtc-border-radius, 8px);
    color: var(--mtc-text-primary);
    font-family: var(--mtc-font-body);
    font-size: 1rem;
    transition: border-color var(--mtc-animation-duration, 0.3s) ease,
                box-shadow var(--mtc-animation-duration, 0.3s) ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--mtc-primary);
    box-shadow: 0 0 0 3px rgba(var(--mtc-primary-rgb), 0.2);
}

::placeholder {
    color: var(--mtc-text-muted);
}

/* ========================================
   Cards
   ======================================== */
.mtc-card {
    background: var(--mtc-surface);
    border: 1px solid var(--mtc-border);
    border-radius: var(--mtc-border-radius, 8px);
    padding: var(--mtc-card-padding, 24px);
    transition: all var(--mtc-animation-duration, 0.3s) ease;
}

/* ========================================
   Mystic Effects
   ======================================== */

/* Gradient Text */
.mtc-gradient-text {
    background: linear-gradient(135deg, var(--mtc-primary), var(--mtc-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glow Text */
.mtc-glow-text {
    text-shadow: 0 0 10px rgba(var(--mtc-primary-rgb), 0.5),
                 0 0 20px rgba(var(--mtc-primary-rgb), 0.3),
                 0 0 30px rgba(var(--mtc-primary-rgb), 0.2);
}

/* Mystic Border */
.mtc-mystic-border {
    position: relative;
}

.mtc-mystic-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, var(--mtc-primary), var(--mtc-secondary), var(--mtc-primary));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    background-size: 300% 300%;
    animation: mtc-border-gradient 5s ease infinite;
}

@keyframes mtc-border-gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Floating Animation */
.mtc-float {
    animation: mtc-float 3s ease-in-out infinite;
}

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

/* Pulse Glow */
.mtc-pulse-glow {
    animation: mtc-pulse-glow 2s ease-in-out infinite;
}

@keyframes mtc-pulse-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(var(--mtc-glow-color-rgb), 0.5); }
    50% { box-shadow: 0 0 25px rgba(var(--mtc-glow-color-rgb), 0.8); }
}

/* Shimmer Effect */
.mtc-shimmer {
    position: relative;
    overflow: hidden;
}

.mtc-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: mtc-shimmer 2s infinite;
}

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

/* ========================================
   Particles Container
   ======================================== */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* ========================================
   Scroll Animations
   ======================================== */
.mtc-animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.mtc-animate-on-scroll.mtc-visible {
    opacity: 1;
    transform: translateY(0);
}

.mtc-animate-on-scroll.mtc-fade-left {
    transform: translateX(-30px);
}

.mtc-animate-on-scroll.mtc-fade-left.mtc-visible {
    transform: translateX(0);
}

.mtc-animate-on-scroll.mtc-fade-right {
    transform: translateX(30px);
}

.mtc-animate-on-scroll.mtc-fade-right.mtc-visible {
    transform: translateX(0);
}

.mtc-animate-on-scroll.mtc-scale {
    transform: scale(0.9);
}

.mtc-animate-on-scroll.mtc-scale.mtc-visible {
    transform: scale(1);
}

/* ========================================
   Custom Cursor
   ======================================== */
.mtc-cursor-glow {
    position: fixed;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, rgba(var(--mtc-primary-rgb), 0.4) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s;
    mix-blend-mode: screen;
}

.mtc-cursor-glow.mtc-cursor-hover {
    width: 50px;
    height: 50px;
}

/* ========================================
   WooCommerce Product Cards
   ======================================== */
.mtc-product-card {
    position: relative;
    overflow: hidden;
}

.mtc-product-card img {
    transition: transform var(--mtc-animation-duration, 0.3s) ease;
}

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

/* Mystic Product Card Style */
.mtc-product-card--mystic {
    background: linear-gradient(145deg, var(--mtc-surface), var(--mtc-surface-light));
}

.mtc-product-card--mystic::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(var(--mtc-secondary-rgb), 0.1),
        transparent
    );
    transition: left 0.5s ease;
}

.mtc-product-card--mystic:hover::after {
    left: 100%;
}

/* Elegant Product Card Style */
.mtc-product-card--elegant {
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.mtc-product-card--elegant:hover {
    box-shadow: 0 8px 40px rgba(var(--mtc-primary-rgb), 0.3);
}

/* Floating Product Card Style */
.mtc-product-card--floating {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.mtc-product-card--floating:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(var(--mtc-primary-rgb), 0.4);
}

/* Overlay Product Card Style */
.mtc-product-card--overlay .mtc-product-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(var(--mtc-background-rgb), 0.95));
    transform: translateY(50%);
    opacity: 0;
    transition: all var(--mtc-animation-duration, 0.3s) ease;
}

.mtc-product-card--overlay:hover .mtc-product-info {
    transform: translateY(0);
    opacity: 1;
}

/* ========================================
   Sale Badges
   ======================================== */
.mtc-sale-badge {
    font-family: var(--mtc-font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========================================
   Add to Cart Buttons
   ======================================== */
.mtc-add-to-cart--glowing:hover {
    box-shadow: 0 0 20px rgba(var(--mtc-primary-rgb), 0.6),
                0 0 40px rgba(var(--mtc-primary-rgb), 0.3);
}

.mtc-add-to-cart--gradient {
    background: linear-gradient(135deg, var(--mtc-primary), var(--mtc-secondary));
}

.mtc-add-to-cart--animated {
    position: relative;
    overflow: hidden;
}

.mtc-add-to-cart--animated::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.mtc-add-to-cart--animated:hover::before {
    width: 300%;
    height: 300%;
}

/* ========================================
   Utility Classes
   ======================================== */
.mtc-text-primary { color: var(--mtc-primary); }
.mtc-text-secondary { color: var(--mtc-secondary); }
.mtc-text-accent { color: var(--mtc-accent); }

.mtc-bg-primary { background-color: var(--mtc-primary); }
.mtc-bg-secondary { background-color: var(--mtc-secondary); }
.mtc-bg-surface { background-color: var(--mtc-surface); }

.mtc-border-primary { border-color: var(--mtc-primary); }
.mtc-border-secondary { border-color: var(--mtc-secondary); }

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .mtc-product-card {
        padding: calc(var(--mtc-card-padding, 24px) * 0.75);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
