:root {
    --primary-color: #00f0ff;
    /* Neon Cyan */
    --secondary-color: #7000ff;
    /* Neon Purple */
    --accent-color: #ff0055;
    /* Neon Pink */
    --bg-color: #050510;
    /* Deep Space Black */
    --card-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #a0a0b0;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --glow-primary: 0 0 20px rgba(0, 240, 255, 0.5);
    --glow-secondary: 0 0 20px rgba(112, 0, 255, 0.5);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-main);
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.glass-header {
    background: rgba(5, 5, 16, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

/* Buttons */
.btn-neon {
    display: inline-block;
    padding: 12px 30px;
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.btn-neon:hover {
    background: var(--primary-color);
    color: #000;
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.6);
}

.btn-glow {
    background: linear-gradient(45deg, var(--secondary-color), var(--accent-color));
    color: white;
    padding: 12px 30px;
    border-radius: 30px;
    border: none;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(112, 0, 255, 0.4);
}

.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(112, 0, 255, 0.6);
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 80px;
    background: radial-gradient(circle at 50% 50%, #1a1a2e 0%, var(--bg-color) 70%);
}

.hero-content {
    text-align: center;
    z-index: 2;
    max-width: 800px;
    padding: 20px;
}

.hero-title {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(to right, #fff, #a0a0b0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

/* 3D Card Preview Container */
.card-preview-3d {
    width: 300px;
    height: 180px;
    margin: 40px auto;
    perspective: 1200px;
    perspective-origin: center center;
    position: relative;
    z-index: 1;
    display: block;
    /* Ensure no flex-related shifts */
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    /* Explicitly lock height */
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    transform-origin: center center;
}

.card-preview-3d.hover-rotate:hover .card-inner {
    transform: rotateY(180deg) !important;
}

.card-front,
.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background: #111;
    display: flex;
    /* Flex centers content by default, might fight absolute positioning */
    /* Remove flex centering if we are using absolute positioning for everything */
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-back {
    background: #000;
    transform: rotateY(180deg);
    color: white;
}


/* --- Editor Styles & Fixes --- */

/* Fix Dropdown & Input colors (Prevent white-on-white) */
.form-control,
select.form-control {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: #ffffff;
    /* Ensure text is always white */
    padding: 10px 15px;
    border-radius: 8px;
    width: 100%;
    margin-bottom: 15px;
}

/* Fix option visibility in some browsers */
select.form-control option {
    background-color: #050510;
    color: #ffffff;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

/* Remove resize handles as requested (Using slider instead) */
.resize-handle {
    display: none !important;
}

/* Element Highlighting and Positioning */
.draggable-item {
    position: absolute;
    cursor: grab;
    user-select: none;
    border: 1px solid transparent;
    transition: border 0.2s, box-shadow 0.2s;
}

.draggable-item.selected {
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
    z-index: 100 !important;
    /* Ensure selected is on top */
}

/* QR Link Options */
.qr-link-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.qr-link-btn {
    flex: 1;
    padding: 8px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: #ccc;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
}

.qr-link-btn.active {
    background: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
}

/* Modal Z-Index and Alignment Fix */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    /* Darker backdrop */
    backdrop-filter: blur(10px);
    z-index: 9999;
    /* Higher priority */
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #0a0a1a;
    border: 1px solid var(--primary-color);
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 850px;
    box-shadow: 0 0 50px rgba(0, 240, 255, 0.15);
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

/* Text Stylers */
.text-stylers {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
}

.styler-btn {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.styler-btn.active {
    background: var(--primary-color);
    color: #000;
}

/* Template Card Styles */
.template-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.template-card:hover {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
}

.template-preview {
    width: 100%;
    height: 100px;
    border-radius: 8px;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.template-card h4 {
    margin: 0;
    font-size: 1rem;
    color: #fff;
}

.template-card p {
    margin: 5px 0 0;
    font-size: 0.75rem;
    color: #888;
}

/* Navigation & Mobile Menu */
.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s;
    position: relative;
    padding: 5px 0;
}

.nav-links a:hover,
.nav-links a.active {
    color: white;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    font-size: 1.4rem;
    color: white;
    cursor: pointer;
    z-index: 1001;
    transition: transform 0.3s;
}

.menu-toggle:hover {
    color: var(--primary-color);
}

@media (max-width: 992px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: rgba(5, 5, 16, 0.98);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        gap: 35px;
        box-shadow: -15px 0 35px rgba(0, 0, 0, 0.8);
        border-left: 1px solid var(--glass-border);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        font-size: 1.5rem;
        font-weight: 700;
        color: white;
        font-family: var(--font-heading);
    }

    .nav-links a:hover {
        color: var(--primary-color);
        transform: scale(1.1);
    }

    .nav-links a::after {
        display: none;
    }

    .hide-mobile {
        display: none !important;
    }
}

/* Blog Section Styles */
.blog-section {
    padding: 100px 0;
    background: #050510;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.blog-card {
    padding: 30px;
    transition: all 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
}

.blog-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
}

.blog-date {
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

.blog-link {
    margin-top: auto;
    padding-top: 20px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.blog-link:hover {
    color: var(--primary-color);
}