/* ===================================== */
/* === COMPLETE Holographic/Cyberpunk Theme === */
/* ===================================== */
/* This theme uses a dark background, glowing elements, */
/* transparency, and futuristic fonts. */
/* ===================================== */

/* --- 1. Root Variables & Basic Setup --- */
/* :root holds all theme settings for easy customization. */
:root {
    /* Colors */
    --bg-color: #0D0221;         /* Deep Space Blue background */
    --primary-color: rgba(10, 17, 40, 0.6); /* Semi-transparent panel background */
    --accent-color: #00F6FF;       /* Cyan Glow for highlights, borders */
    --secondary-accent: #FF00E4;   /* Magenta for secondary highlights */
    --text-color: #F0F0F0;         /* Light text color for readability */
    --qr-text-color: var(--text-color); /* Added variable specifically for QR text if needed */

    /* Fonts */
    --font-heading: 'Orbitron', sans-serif; /* Futuristic heading font */
    --font-body: 'Roboto', sans-serif;      /* Clean body font */

    /* Effects */
    --border-glow: 0 0 5px var(--accent-color), 0 0 10px var(--accent-color); /* Glow effect for borders */
}

/* Basic reset: Remove default browser styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base styles for the entire page */
body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden; /* Prevent horizontal scrolling */
    min-height: 100vh; /* Ensure body takes at least full viewport height */
}

/* --- 2. Background & Layout --- */
/* Fixed background with animated grid lines */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw; /* Full viewport width */
    height: 100vh; /* Full viewport height */
    /* Create grid lines using linear gradients */
    background-image:
        linear-gradient(rgba(0, 246, 255, 0.1) 1px, transparent 1px), /* Horizontal lines */
        linear-gradient(90deg, rgba(0, 246, 255, 0.1) 1px, transparent 1px); /* Vertical lines */
    background-size: 30px 30px; /* Size of grid squares */
    z-index: -2; /* Place behind all content */
    animation: scanline 10s linear infinite; /* Add subtle movement */
}

/* Animation for the background grid */
@keyframes scanline {
    0% { background-position: 0 0; }
    100% { background-position: 0 300px; } /* Moves grid vertically */
}

/* Main content container */
.main-container,
.shop-container, /* Added shop container */
.settings-container { /* Added settings container (assuming bg.html uses this) */
    max-width: 480px; /* Limit content width */
    margin: 0 auto; /* Center horizontally */
    padding: 20px;
}

/* --- 3. Page Header & Glitch Effect Title --- */
.page-header {
    margin-bottom: 40px; /* Space below header */
}

.page-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    color: var(--accent-color);
    text-align: center;
    letter-spacing: 5px;
    /* Glow effect using text-shadow */
    text-shadow: 0 0 10px var(--accent-color), 0 0 20px var(--secondary-accent);
    position: relative; /* Needed for pseudo-elements */
}

/* Pseudo-elements create the glitch effect */
.page-title::before,
.page-title::after {
    content: attr(data-text); /* Copy the text from the data-text attribute */
    position: absolute;
    left: 0; top: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color); /* Match background to hide original text slices */
    overflow: hidden; /* Hide parts of the text */
}

/* Glitch layer 1 */
.page-title::before {
    left: 2px;
    text-shadow: -2px 0 var(--secondary-accent); /* Magenta shadow offset */
    animation: glitch-anim-1 2s infinite linear alternate-reverse; /* Glitch animation */
}

/* Glitch layer 2 */
.page-title::after {
    left: -2px;
    text-shadow: 2px 0 var(--accent-color); /* Cyan shadow offset */
    animation: glitch-anim-2 3s infinite linear alternate-reverse; /* Different timing */
}

/* Keyframes define how the text slices (clip-path) change over time */
@keyframes glitch-anim-1 {
    0% { clip-path: inset(42% 0 54% 0); }
    100% { clip-path: inset(52% 0 32% 0); }
}
@keyframes glitch-anim-2 {
    0% { clip-path: inset(86% 0 6% 0); }
    100% { clip-path: inset(16% 0 78% 0); }
}

/* --- 4. Flip Card (index.html) --- */
.card-section {
    margin-bottom: 20px; /* Space below card area */
}
.card-container {
    height: 450px; /* Fixed card height */
    position: relative;
    perspective: 1500px; /* 3D perspective for flip */
    margin-bottom: 20px; /* Space below card */
}

/* Base style for card front and back */
.greeting-card,
.customization-form {
    background: var(--primary-color); /* Semi-transparent background */
    backdrop-filter: blur(10px);      /* Blur effect */
    -webkit-backdrop-filter: blur(10px); /* Safari blur */
    border: 1px solid var(--accent-color); /* Glowing border */
    border-radius: 15px;
    box-shadow: var(--border-glow);     /* Apply glow effect */
    padding: 30px;
    position: absolute; width: 100%; height: 100%; top: 0; left: 0;
    transform-style: preserve-3d;     /* Enable 3D positioning */
    transition: transform 0.7s ease; /* Flip animation */
    backface-visibility: hidden;    /* Hide the back when facing away */
    display: flex; flex-direction: column; /* Use flexbox for layout */
}

/* Back face starts rotated */
.customization-form {
    transform: rotateY(180deg);
}
/* Flip classes added by JS */
.card-container.flipped .greeting-card {
    transform: rotateY(-180deg);
}
.card-container.flipped .customization-form {
    transform: rotateY(0deg);
}

/* Content wrapper inside the front face */
.card-content-wrapper {
    text-align: center;
    justify-content: center; /* Center content vertically */
    flex-grow: 1; /* Take available space */
    display: flex;
    flex-direction: column;
}
.quote { /* Greeting message */
    font-size: 1.8rem;
    font-weight: 300; /* Lighter font weight */
    line-height: 1.6;
    text-shadow: 0 0 5px rgba(255,255,255,0.5); /* Subtle text glow */
    overflow-y: auto; /* Add scroll if text is too long */
}
.from-name { /* Sender name */
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-top: 25px;
    color: var(--secondary-accent); /* Use magenta color */
    text-shadow: 0 0 5px var(--secondary-accent); /* Magenta glow */
}

/* Styles for the customization form (back face) */
.customization-form h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 15px; /* Added margin */
}
.customization-form textarea,
.customization-form input {
    width: 100%;
    background: rgba(0,0,0,0.3); /* Darker transparent background */
    border: 1px solid var(--accent-color);
    color: var(--text-color);
    padding: 12px;
    font-size: 1rem;
    margin-bottom: 15px;
    border-radius: 5px;
    font-family: var(--font-body); /* Ensure correct font */
}
.customization-form textarea {
    min-height: 100px; /* Ensure minimum height */
    height: 40%;     /* Adjust height relative to form */
    resize: vertical; /* Allow vertical resize */
}
/* Placeholder text style */
.customization-form textarea::placeholder,
.customization-form input::placeholder {
    color: rgba(240,240,240,0.5); /* Lighter placeholder */
}

/* Close button (X) on the form */
.customization-form .close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2.5rem; /* Larger close icon */
    color: var(--accent-color); /* Use accent color */
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
    line-height: 1; /* Adjust line height for better positioning */
}
.customization-form .close-btn:hover {
    transform: scale(1.2); /* Slightly enlarge on hover */
}

/* --- 5. Tools/Features Section (index.html) --- */
.tools-section {
    display: grid;
    /* Responsive columns: min 120px wide, max 1fr (equal) */
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

/* Individual box for each tool/link */
.feature-box {
    background: var(--primary-color);
    backdrop-filter: blur(10px);
    border: 1px solid var(--accent-color);
    border-radius: 10px;
    text-align: center;
    padding: 20px 10px; /* Vertical and horizontal padding */
    cursor: pointer;
    transition: box-shadow 0.3s ease, transform 0.3s ease; /* Smooth hover effect */
}
.feature-box:hover {
    box-shadow: var(--border-glow); /* Add glow on hover */
    transform: translateY(-3px); /* Lift slightly on hover */
}
.feature-box h4 { /* Text inside the box */
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--accent-color);
    margin: 0; /* Remove default margin */
}

/* Make entire feature box clickable if it's a link */
.feature-link {
    display: block; /* Make link fill the box */
    text-decoration: none;
    color: inherit; /* Inherit text color */
}
.feature-link:hover .feature-box { /* Apply hover effect via link */
     box-shadow: var(--border-glow);
     transform: translateY(-3px);
}

/* --- 6. Buttons --- */
/* General action button style */
.action-button {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    background-color: var(--accent-color);
    color: #000000; /* Black text for contrast on cyan */
    border: none;
    border-radius: 5px;
    padding: 10px 25px;
    text-decoration: none;
    display: inline-block; /* Correct display type */
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-color); /* Glow effect */
    transition: all 0.2s ease;
    text-align: center; /* Ensure text is centered */
}
.action-button:hover {
    filter: brightness(1.2); /* Make brighter on hover */
}

/* Primary buttons use the secondary accent color */
.action-button.primary {
    background-color: var(--secondary-accent);
    color: #FFFFFF; /* White text for contrast on magenta */
    box-shadow: 0 0 10px var(--secondary-accent);
}

/* Control button (Music Toggle) */
.control-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    border: 1px solid var(--accent-color);
    width: 50px;
    height: 50px;
    border-radius: 50%; /* Circular */
    z-index: 100; /* Keep on top */
    font-size: 1.5rem;
    box-shadow: var(--border-glow);
    color: var(--accent-color);
    cursor: pointer;
    display: flex; /* Center icon */
    align-items: center;
    justify-content: center;
}

/* General close button (used in Modal) */
.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: var(--accent-color);
    background: transparent;
    border: none;
    cursor: pointer;
    line-height: 1; /* Adjust positioning */
}


/* --- 7. Modal (Share Popup) --- */
/* Modal overlay styling */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    /* Semi-transparent background with blur */
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px); /* Safari */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0; /* Hidden by default */
    pointer-events: none;
    transition: opacity 0.3s ease; /* Fade effect */
}
.modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Modal content box */
.modal-content {
    background: var(--primary-color); /* Match card background */
    backdrop-filter: blur(10px);
    border: 1px solid var(--accent-color);
    border-radius: 15px;
    box-shadow: var(--border-glow);
    padding: 30px;
    width: 90%; /* Responsive width */
    max-width: 450px; /* Max width */
    max-height: 85vh; /* Limit height */
    overflow-y: auto; /* Allow scrolling */
    text-align: center; /* Center content */
}
.modal-content h2 { /* Modal title */
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}
.modal-share-actions { /* Container for share buttons */
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}
/* Ensure modal buttons use correct styling */
.modal-share-actions .action-button {
     font-size: 1.2rem; /* Slightly smaller font in modal */
     padding: 12px 20px;
}


/* --- 8. Specific Page Styles (BG / Settings / Shop) --- */
/* Container for settings options */
.settings-box {
    background: var(--primary-color);
    backdrop-filter: blur(10px);
    border: 1px solid var(--accent-color);
    border-radius: 15px;
    box-shadow: var(--border-glow);
    padding: 25px;
    margin-bottom: 30px;
}
.settings-box h2, .settings-box h3 { /* Titles inside settings box */
    font-family: var(--font-heading);
    text-align: center;
    color: var(--accent-color);
    margin-bottom: 20px;
}

/* Grid for music selection */
.music-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}
.music-item { /* Individual music choice item */
    border: 1px solid var(--accent-color);
    padding: 15px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    background: rgba(0,0,0,0.2); /* Slight background */
}
.music-item h4 { /* Text inside music item */
    font-family: var(--font-heading);
    color: var(--text-color);
    font-size: 1rem;
    margin: 0; /* Remove default margin */
}
.music-item:hover {
    background-color: rgba(0, 246, 255, 0.2); /* Light cyan on hover */
}
.music-item.selected { /* Style for the selected music item */
    background-color: var(--accent-color);
    box-shadow: var(--border-glow);
}
.music-item.selected h4 {
    color: #000; /* Black text on cyan background */
    text-shadow: none;
}

/* Grid for shop products */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}
.product-card-shop { /* Individual product card */
    background: var(--primary-color);
    backdrop-filter: blur(10px);
    /* Use accent color for border */
    border: 1px solid var(--accent-color);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    display: flex; /* Enable flexbox for alignment */
    flex-direction: column; /* Stack vertically */
    box-shadow: var(--border-glow); /* Add glow */
}
.product-card-shop img {
    width: 100%;
    height: 180px; /* Fixed image height */
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 15px;
}
.product-card-shop h3 { /* Product title */
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--accent-color); /* Use accent color for title */
    margin-bottom: 5px;
}
.product-card-shop p { /* Product description */
    font-size: 0.9rem;
    color: #ccc; /* Lighter color for description */
    margin: 10px 0 20px;
    flex-grow: 1; /* Push button to the bottom */
}
.product-card-shop .price { /* Price styling */
     background-color: var(--secondary-accent); /* Use magenta */
     padding: 5px 10px;
     margin-bottom: 15px; /* Space above button */
     color: white;
     border-radius: 5px;
     font-size: 1.1rem;
     font-weight: bold;
     display: inline-block; /* Allow padding */
}
.product-card-shop .action-button { /* Ensure button uses correct style */
    margin-top: auto; /* Push button to bottom if flex-grow is used on p */
}

/* --- 9. Footer --- */
.site-footer {
    padding: 40px 20px 20px 20px; /* Padding top, sides, bottom */
    text-align: center;
    margin-top: 30px; /* Space above footer */
    border-top: 1px solid rgba(0, 246, 255, 0.2); /* Subtle top border */
}

.footer-links {
    display: flex; /* Align links horizontally */
    justify-content: center; /* Center the links */
    gap: 20px; /* Space between links */
    margin-bottom: 15px;
}

.footer-links a {
    color: var(--accent-color); /* Use accent color for links */
    text-decoration: underline; /* Add underline */
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--secondary-accent); /* Change to magenta on hover */
    text-decoration-color: var(--secondary-accent);
}

.footer-copyright { /* Copyright text */
    font-size: 0.8rem;
    opacity: 0.6;
}

/* --- 10. Colorful Scrollbar Style --- */
/* Set the width of the scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

/* Style the track (background) */
::-webkit-scrollbar-track {
    background: var(--bg-color); /* Match page background */
    border-radius: 10px;
    border: 1px solid rgba(0, 246, 255, 0.2); /* Subtle border */
}

/* Style the handle (the draggable part) */
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-color), var(--secondary-accent)); /* Cyan to Magenta gradient */
    border-radius: 10px;
    border: 2px solid var(--bg-color); /* Creates padding effect */
}

/* Make handle brighter on hover */
::-webkit-scrollbar-thumb:hover {
    filter: brightness(1.2);
}

/* --- 11. QR Code Styles (DO NOT CHANGE per user request) --- */
#modal-qrcode-display-area {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
#qr-code-sticker-preview {
    background-color: var(--primary-color);
    color: var(--qr-text-color); /* Use specific QR text color variable */
    padding: 20px;
    border-radius: 15px; /* Match other elements */
    box-shadow: var(--border-glow); /* Add glow */
    border: 1px solid var(--accent-color); /* Add border */
    width: fit-content;
    text-align: center;
}
#qr-code-sticker-preview .qr-code-title {
    color: var(--accent-color);
    font-weight: 700;
    font-family: var(--font-heading);
}
#qr-code-sticker-preview .qr-code-from {
    opacity: 0.8;
    margin-top: 5px; /* Added margin */
}
#qr-code-sticker-preview #qr-code-image {
    padding: 8px;
    background-color: white;
    border-radius: 10px; /* Slightly less rounded */
    margin: 15px auto;
    display: inline-block; /* Center */
    line-height: 0;
}
#qr-code-sticker-preview #qr-code-image img,
#qr-code-sticker-preview #qr-code-image canvas {
    display: block;
    max-width: 100%;
}
/* Download button styling is handled by .action-button */
#modal-download-qr-btn {
    width: auto;
}
/* === END QR Code Styles === */

/* --- 12. Custom Color Picker (Theme Editor) --- */
/* Container for color picker elements */
.custom-color-picker {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

/* Visually hide the default color input */
.color-input-hidden {
    opacity: 0;
    position: absolute;
    width: 0; height: 0;
    pointer-events: none;
}

/* The clickable color preview button */
.color-preview-swatch {
    width: 60px; height: 60px;
    border-radius: 15px; /* Match other elements */
    border: 1px solid var(--accent-color);
    cursor: pointer;
    box-shadow: var(--border-glow);
    transition: transform 0.1s, box-shadow 0.1s;
    display: flex; justify-content: center; align-items: center;
    background-color: var(--primary-color); /* Default background */
}
.color-preview-swatch:active {
    transform: translateY(2px); /* Press down effect */
    box-shadow: none; /* Remove glow when pressed */
}
.color-preview-swatch i { /* Icon inside swatch */
    font-size: 1.8rem;
    color: var(--accent-color);
}

/* HEX input field */
.hex-input {
    width: 140px; height: 60px;
    border: 1px solid var(--accent-color);
    border-radius: 15px;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    text-align: center;
    background: rgba(0,0,0,0.3);
    color: var(--text-color);
    box-shadow: var(--border-glow);
    text-transform: uppercase;
}