/* ==========================================================================
   BETAQA - Premium Card Maker
   Modern, Vibrant & Celebration-Focused Design System
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables - Color Palette
   -------------------------------------------------------------------------- */
:root {
    /* Primary celebration colors */
    --primary-100: #fef1f7;
    --primary-200: #fdd8eb;
    --primary-300: #fcafdb;
    --primary-400: #f975c5;
    --primary-500: #f14dae;
    --primary-600: #e0268d;
    --primary-700: #c31872;

    /* Accent warm tones */
    --accent-100: #fff7ed;
    --accent-200: #fed7aa;
    --accent-300: #fdba74;
    --accent-400: #fb923c;
    --accent-500: #f97316;
    --accent-600: #ea580c;

    /* Purple celebration tones */
    --purple-100: #faf5ff;
    --purple-200: #e9d5ff;
    --purple-300: #d8b4fe;
    --purple-400: #c084fc;
    --purple-500: #a855f7;
    --purple-600: #9333ea;

    /* Gold celebration */
    --gold-100: #fefce8;
    --gold-200: #fef08a;
    --gold-300: #fde047;
    --gold-400: #facc15;
    --gold-500: #eab308;
    --gold-600: #ca8a04;

    /* Neutral palette */
    --bg: #fffbf7;
    --surface: #ffffff;
    --surface-2: #fef7f2;
    --surface-3: #fdf2eb;
    --text: #1f1225;
    --text-secondary: #4a3c52;
    --muted: #7c6d84;

    /* Semantic colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    /* Borders & shadows */
    --stroke: rgba(225, 35, 150, 0.12);
    --stroke-light: rgba(225, 35, 150, 0.06);
    --shadow-sm: 0 2px 8px rgba(225, 35, 150, 0.08);
    --shadow-md: 0 8px 24px rgba(225, 35, 150, 0.12);
    --shadow-lg: 0 20px 50px rgba(225, 35, 150, 0.16);
    --shadow-glow: 0 0 40px rgba(241, 77, 174, 0.25);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #f14dae 0%, #c084fc 50%, #fb923c 100%);
    --gradient-warm: linear-gradient(135deg, #fb923c 0%, #f14dae 100%);
    --gradient-cool: linear-gradient(135deg, #a855f7 0%, #f14dae 100%);
    --gradient-sunset: linear-gradient(135deg, #f97316 0%, #f14dae 50%, #a855f7 100%);
    --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(254, 241, 247, 0.8) 100%);

    /* Radii */
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius: 20px;
    --radius-lg: 28px;
    --radius-xl: 36px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark Mode Theme */
body.theme-dark {
    --bg: #0f0a14;
    --surface: #1a1220;
    --surface-2: #241830;
    --surface-3: #2e203d;
    --text: #faf5ff;
    --text-secondary: #d8b4fe;
    --muted: #a78bba;
    --stroke: rgba(241, 77, 174, 0.2);
    --stroke-light: rgba(241, 77, 174, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 60px rgba(241, 77, 174, 0.3);
    --gradient-card: linear-gradient(145deg, rgba(36, 24, 48, 0.9) 0%, rgba(26, 18, 32, 0.9) 100%);
}

/* --------------------------------------------------------------------------
   Base Styles & Resets
   -------------------------------------------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Arabic/RTL font */
html[dir="rtl"] body {
    font-family: "Tajawal", "Cairo", "SF Pro Arabic", sans-serif;
}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 0% 0%, rgba(241, 77, 174, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 0%, rgba(168, 85, 247, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(249, 115, 22, 0.10) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(192, 132, 252, 0.08) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
    animation: backgroundPulse 15s ease-in-out infinite alternate;
}

@keyframes backgroundPulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Floating particles effect */
body::after {
    content: '';
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image:
        radial-gradient(2px 2px at 20px 30px, var(--primary-400), transparent),
        radial-gradient(2px 2px at 40px 70px, var(--purple-400), transparent),
        radial-gradient(2px 2px at 80px 40px, var(--accent-400), transparent),
        radial-gradient(2px 2px at 90px 80px, var(--gold-400), transparent),
        radial-gradient(2px 2px at 160px 30px, var(--primary-400), transparent),
        radial-gradient(2px 2px at 200px 100px, var(--purple-400), transparent);
    background-size: 250px 150px;
    opacity: 0.4;
    animation: sparkle 8s linear infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes sparkle {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-150px);
    }
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.2;
    font-weight: 700;
    color: var(--text);
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

h3 {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
}

/* --------------------------------------------------------------------------
   Site Header
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 5vw;
    background: rgba(255, 251, 247, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--stroke-light);
    transition: all var(--transition-normal);
}

body.theme-dark .site-header {
    background: rgba(15, 10, 20, 0.8);
}

.site-header:hover {
    background: rgba(255, 251, 247, 0.85);
}

body.theme-dark .site-header:hover {
    background: rgba(15, 10, 20, 0.9);
}

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-glow);
    animation: brandPulse 3s ease-in-out infinite;
}

.brand-mark::before {
    content: '💌';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    animation: brandFloat 2s ease-in-out infinite;
}

@keyframes brandPulse {

    0%,
    100% {
        box-shadow: var(--shadow-glow);
    }

    50% {
        box-shadow: 0 0 60px rgba(241, 77, 174, 0.4);
    }
}

@keyframes brandFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-3px) rotate(5deg);
    }
}

.brand-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation */
.site-nav {
    display: flex;
    gap: 8px;
}

.site-nav a {
    position: relative;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    transition: all var(--transition-normal);
}

.site-nav a::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--gradient-primary);
    opacity: 0;
    transform: scale(0.8);
    transition: all var(--transition-normal);
    z-index: -1;
}

.site-nav a:hover {
    color: white;
    -webkit-text-fill-color: white;
}

.site-nav a:hover::before {
    opacity: 1;
    transform: scale(1);
}

/* Site Actions */
.site-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-switch {
    display: flex;
    gap: 4px;
}

/* Pills & Buttons */
.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.pill::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: -1;
}

.pill:hover {
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pill:hover::before {
    opacity: 1;
}

.pill:active {
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Main Content Area
   -------------------------------------------------------------------------- */
.site-main {
    padding: 40px 5vw 100px;
    min-height: calc(100vh - 200px);
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero,
.occasion-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    padding: 60px 0 40px;
}

.hero-content {
    animation: slideInLeft 0.8s var(--transition-smooth) both;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--primary-600);
    background: var(--primary-100);
    border-radius: var(--radius-full);
    margin-bottom: 20px;
    animation: fadeIn 0.6s ease both 0.2s;
}

.eyebrow::before {
    content: '✨';
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

body.theme-dark .eyebrow {
    background: rgba(241, 77, 174, 0.15);
}

.hero h1 {
    margin-bottom: 20px;
    line-height: 1.1;
    animation: fadeIn 0.6s ease both 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subcopy {
    font-size: 1.125rem;
    color: var(--muted);
    max-width: 480px;
    line-height: 1.7;
    animation: fadeIn 0.6s ease both 0.4s;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    flex-wrap: wrap;
    animation: fadeIn 0.6s ease both 0.5s;
}

.stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.stat::before {
    content: '🎨';
}

.stat:nth-child(2)::before {
    content: '🔗';
}

.stat:nth-child(3)::before {
    content: '🌍';
}

.stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-300);
}

/* Hero Panel */
.hero-panel {
    position: relative;
    animation: slideInRight 0.8s var(--transition-smooth) both 0.3s;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero-panel::before {
    content: '';
    position: absolute;
    inset: -20px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    opacity: 0.15;
    filter: blur(40px);
    animation: glowPulse 4s ease-in-out infinite alternate;
    z-index: -1;
}

@keyframes glowPulse {
    0% {
        opacity: 0.1;
        transform: scale(0.95);
    }

    100% {
        opacity: 0.2;
        transform: scale(1.05);
    }
}

.hero-card {
    position: relative;
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    padding: 32px;
    min-height: 300px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: all var(--transition-smooth);
}

.hero-card:hover {
    transform: translateY(-8px) rotateX(2deg);
    box-shadow: var(--shadow-glow);
}

.hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.hero-card::after {
    content: '🎉';
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 4rem;
    opacity: 0.15;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-15px) rotate(10deg);
    }
}

.hero-card-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: white;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    animation: badgePop 0.5s var(--transition-spring) both 0.8s;
}

@keyframes badgePop {
    from {
        transform: scale(0) rotate(-20deg);
    }

    to {
        transform: scale(1) rotate(0);
    }
}

html[dir="rtl"] .hero-card-badge {
    right: auto;
    left: 20px;
}

.hero-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

.hero-card-body {
    font-size: 1.05rem;
    color: var(--muted);
    line-height: 1.8;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section {
    margin-top: 80px;
    animation: fadeIn 0.8s ease both;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
}

.section-head h2 {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-head h2::before {
    content: '🎁';
    font-size: 1.5rem;
}

/* Chip */
.chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--purple-600);
    background: var(--purple-100);
    border-radius: var(--radius-full);
    animation: chipFloat 3s ease-in-out infinite;
}

@keyframes chipFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

body.theme-dark .chip {
    background: rgba(168, 85, 247, 0.15);
    color: var(--purple-300);
}

/* --------------------------------------------------------------------------
   Grid Layout
   -------------------------------------------------------------------------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* Occasion Cards */
.occasion-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 28px;
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-smooth);
    overflow: hidden;
}

.occasion-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-smooth);
}

.occasion-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-300);
}

.occasion-card:hover::before {
    transform: scaleX(1);
}

.occasion-card:nth-child(even)::before {
    background: var(--gradient-cool);
}

.occasion-card:nth-child(3n)::before {
    background: var(--gradient-sunset);
}

.occasion-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: var(--radius);
    color: white;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-spring);
}

.occasion-card:hover .occasion-icon {
    transform: scale(1.1) rotate(5deg);
}

.occasion-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--gold-600);
    background: var(--gold-100);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    width: fit-content;
}

body.theme-dark .occasion-badge {
    background: rgba(234, 179, 8, 0.15);
    color: var(--gold-300);
}

.occasion-card h3 {
    font-size: 1.125rem;
    margin: 0;
}

.occasion-card p {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
}

.cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary-600);
    margin-top: auto;
    transition: all var(--transition-normal);
}

.cta::after {
    content: '→';
    transition: transform var(--transition-normal);
}

html[dir="rtl"] .cta::after {
    content: '←';
}

.occasion-card:hover .cta {
    color: var(--primary-500);
}

.occasion-card:hover .cta::after {
    transform: translateX(4px);
}

html[dir="rtl"] .occasion-card:hover .cta::after {
    transform: translateX(-4px);
}

/* --------------------------------------------------------------------------
   Form Layout
   -------------------------------------------------------------------------- */
.layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    align-items: start;
}

/* Card Form */
.card-form {
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.form-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.form-title h3 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-title h3::before {
    content: '🖼️';
}

.form-block {
    margin-bottom: 36px;
}

.form-block:last-of-type {
    margin-bottom: 28px;
}

/* Template Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 14px;
}

.template {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background: var(--surface-2);
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-smooth);
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
}

.template input {
    display: none;
}

.template img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
}

.template:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.template.active {
    border-color: var(--primary-500);
    background: var(--primary-100);
    box-shadow: 0 0 0 4px rgba(241, 77, 174, 0.15);
}

body.theme-dark .template.active {
    background: rgba(241, 77, 174, 0.1);
}

.template .check {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    color: white;
    opacity: 0;
    transform: scale(0);
    transition: all var(--transition-spring);
    box-shadow: var(--shadow-sm);
}

html[dir="rtl"] .template .check {
    left: auto;
    right: 8px;
}

.template.active .check {
    opacity: 1;
    transform: scale(1);
}

/* Upload */
.upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 28px;
    margin-top: 20px;
    background: var(--surface-2);
    border: 2px dashed var(--stroke);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--muted);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.upload::before {
    content: '📷';
    font-size: 2rem;
    margin-bottom: 4px;
}

.upload:hover {
    border-color: var(--primary-400);
    background: var(--primary-100);
    color: var(--primary-600);
}

body.theme-dark .upload:hover {
    background: rgba(241, 77, 174, 0.1);
}

.upload input[type="file"] {
    width: 100%;
    cursor: pointer;
}

/* Fields */
.field {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
    font-size: 0.9rem;
}

.field span {
    font-weight: 600;
    color: var(--text-secondary);
}

.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 16px 20px;
    font: inherit;
    font-size: 1rem;
    color: var(--text);
    background: var(--surface);
    border: 2px solid var(--stroke);
    border-radius: var(--radius);
    transition: all var(--transition-normal);
    outline: none;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--primary-400);
    box-shadow: 0 0 0 4px rgba(241, 77, 174, 0.1);
}

.field textarea {
    resize: vertical;
    min-height: 120px;
}

/* Message List */
.message-list {
    display: grid;
    gap: 12px;
}

.message {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px 20px;
    background: var(--surface);
    border: 2px solid var(--stroke);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: start;
    font-size: 0.9rem;
    line-height: 1.6;
    transition: all var(--transition-normal);
}

.message:hover {
    border-color: var(--primary-300);
    transform: translateX(4px);
}

html[dir="rtl"] .message:hover {
    transform: translateX(-4px);
}

.message.active {
    border-color: var(--primary-500);
    background: var(--primary-100);
    box-shadow: 0 0 0 4px rgba(241, 77, 174, 0.1);
}

body.theme-dark .message.active {
    background: rgba(241, 77, 174, 0.1);
}

.message .tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--purple-600);
    background: var(--purple-100);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    width: fit-content;
}

body.theme-dark .message .tag {
    background: rgba(168, 85, 247, 0.15);
    color: var(--purple-300);
}

/* Primary Button */
.primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px 28px;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%, rgba(255, 255, 255, 0.1) 100%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.primary:hover::before {
    opacity: 1;
}

.primary:active {
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Preview Section
   -------------------------------------------------------------------------- */
.preview {
    position: sticky;
    top: 100px;
}

.preview-frame {
    position: relative;
    aspect-ratio: 3/4;
    background: linear-gradient(135deg, var(--surface-3) 0%, var(--surface-2) 100%);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.preview-frame img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all var(--transition-smooth);
}

.preview-frame:hover img {
    transform: scale(1.02);
}

.preview-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 1;
}

.preview-text,
.preview-sender {
    position: absolute;
    z-index: 2;
    color: white;
    padding: 0 28px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.preview-text {
    bottom: 80px;
    left: 0;
    right: 0;
    font-size: 1.1rem;
    line-height: 1.7;
}

.preview-sender {
    bottom: 40px;
    left: 0;
    right: 0;
    font-size: 0.9rem;
    opacity: 0.85;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Card View Page
   -------------------------------------------------------------------------- */
.card-view {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 40px;
    align-items: start;
    padding-top: 40px;
    animation: fadeIn 0.8s ease both;
}

.card-media {
    position: relative;
}

.card-media img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-smooth);
}

.card-media:hover img {
    transform: scale(1.02);
    box-shadow: var(--shadow-glow);
}

.card-details {
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-lg);
}

.card-details h1 {
    margin-bottom: 16px;
    font-size: 2rem;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--muted);
    font-size: 0.875rem;
    margin-bottom: 24px;
}

.card-details .message {
    background: var(--primary-100);
    border: 1px solid var(--primary-200);
    padding: 20px 24px;
    border-radius: var(--radius);
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text);
    margin: 20px 0;
}

body.theme-dark .card-details .message {
    background: rgba(241, 77, 174, 0.1);
    border-color: rgba(241, 77, 174, 0.2);
}

.card-details .sender {
    font-weight: 600;
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

/* Share Block */
.share-block {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--stroke);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.share-link {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-link span {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.share-link input {
    width: 100%;
    padding: 14px 18px;
    font: inherit;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface-2);
    border: 2px solid var(--stroke);
    border-radius: var(--radius);
    outline: none;
}

.share-link input:focus {
    border-color: var(--primary-400);
}

.share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* --------------------------------------------------------------------------
   Alerts
   -------------------------------------------------------------------------- */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    margin-top: 20px;
    font-size: 0.9rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius);
    color: var(--error);
}

.alert::before {
    content: '⚠️';
}

/* --------------------------------------------------------------------------
   Admin Styles
   -------------------------------------------------------------------------- */
.admin {
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--stroke);
}

.admin-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-header h2::before {
    content: '⚙️';
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.admin-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 20px;
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    text-align: center;
    transition: all var(--transition-normal);
}

.admin-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-300);
}

.admin-card::before {
    content: '📊';
    font-size: 1.5rem;
}

.admin-card:nth-child(2)::before {
    content: '💌';
}

.admin-card:nth-child(3)::before {
    content: '🎨';
}

.admin-card:nth-child(4)::before {
    content: '📝';
}

.admin-form {
    display: grid;
    gap: 16px;
    margin-bottom: 32px;
}

/* Table */
.table {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-x: auto;
}

.table-head,
.table-row {
    display: grid;
    grid-template-columns: 60px 1fr 1fr 1fr 140px;
    gap: 16px;
    align-items: center;
    padding: 16px 20px;
}

.table-head {
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.table-row {
    background: var(--surface);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: all var(--transition-normal);
}

.table-row:hover {
    background: var(--primary-100);
}

body.theme-dark .table-row:hover {
    background: rgba(241, 77, 174, 0.05);
}

/* Admin Auth */
.admin-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    animation: popIn 0.5s var(--transition-spring) both;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 32px;
}

.auth-card h2::before {
    content: '🔐';
    display: block;
    font-size: 3rem;
    margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
   Icons
   -------------------------------------------------------------------------- */
.icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 28px 5vw;
    background: var(--surface);
    border-top: 1px solid var(--stroke);
    font-size: 0.875rem;
    color: var(--muted);
}

.footer-links {
    display: flex;
    gap: 16px;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   RTL Support
   -------------------------------------------------------------------------- */
html[dir="rtl"] .message,
html[dir="rtl"] .preview-text,
html[dir="rtl"] .preview-sender,
html[dir="rtl"] .card-details,
html[dir="rtl"] .field {
    text-align: right;
}

html[dir="rtl"] .cta::after {
    content: '←';
}

html[dir="rtl"] .message:hover {
    transform: translateX(-4px);
}

html[dir="rtl"] .occasion-card:hover .cta::after {
    transform: translateX(-4px);
}

/* --------------------------------------------------------------------------
   Responsive Design
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {

    .hero,
    .occasion-hero {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .layout {
        grid-template-columns: 1fr;
    }

    .card-view {
        grid-template-columns: 1fr;
    }

    .preview {
        position: static;
    }
}

@media (max-width: 768px) {
    .site-header {
        flex-wrap: wrap;
        gap: 12px;
        padding: 14px 4vw;
    }

    .site-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }

    .site-main {
        padding: 24px 4vw 60px;
    }

    .hero,
    .occasion-hero {
        padding: 30px 0 20px;
    }

    .hero-stats {
        flex-direction: column;
    }

    .section {
        margin-top: 50px;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .table-head,
    .table-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .table-head {
        display: none;
    }

    .table-row {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .brand-text {
        display: none;
    }

    .pill {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .card-form,
    .card-details,
    .admin,
    .auth-card {
        padding: 24px;
    }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */
@media print {

    .site-header,
    .site-footer,
    .site-nav,
    .site-actions,
    .share-block {
        display: none !important;
    }

    body::before,
    body::after {
        display: none !important;
    }

    .card-view {
        grid-template-columns: 1fr;
    }
}