/* ========================================
   GLASSMORPHISM UI DESIGN SYSTEM
   Wedding Invitation Platform
   ======================================== */

/* === 1. RESET & BASE === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

* {
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* === 2. COLOR SYSTEM === */
:root {
    /* Primary Brand Colors - Teal Theme */
    --primary: #006e99;
    --primary600: #005577;
    --primarySoft: rgba(0, 110, 153, 0.14);

    /* Wedding Accent - Gold */
    --gold: #b08e45;
    --goldSoft: rgba(176, 142, 69, 0.14);

    /* Text Colors */
    --text: #0f172a;
    --muted: rgba(15, 23, 42, 0.65);

    /* Surface & Border */
    --card: rgba(255, 255, 255, 0.92);
    --line: rgba(15, 23, 42, 0.10);

    /* Status Colors */
    --success: #16a34a;
    --danger: #dc3545;
    --warning: #f59e0b;
    --info: #0ea5e9;
}

/* === 3. TYPOGRAPHY === */
body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    line-height: 1.2;
}

/* === 4. BACKGROUND TREATMENT === */
body {
    background:
        linear-gradient(180deg, rgba(44, 21, 94, 0.08), rgba(44, 21, 94, 0.12)),
        linear-gradient(135deg, #f9fafb 0%, #e5e7eb 100%);
    min-height: 100vh;
}

/* Dark overlay for public invite pages */
.bg-dark-overlay {
    background:
        linear-gradient(180deg, rgba(2, 6, 23, 0.50), rgba(2, 6, 23, 0.52)),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 800"><rect fill="%23111827" width="1200" height="800"/></svg>') center/cover no-repeat fixed;
}

/* === 5. GLASS CARD COMPONENT === */
.glass-card {
    background: var(--card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.16);
    padding: 18px;
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

/* Compact variant */
.glass-card-sm {
    padding: 14px;
    border-radius: 16px;
}

/* === 6. KPI / STAT CARDS === */
.kpi-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: var(--card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: var(--primarySoft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.kpi-content {
    flex: 1;
}

.kpi-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-value {
    font-size: 28px;
    font-weight: 900;
    color: var(--text);
    line-height: 1;
    margin-top: 4px;
}

/* === 7. BUTTONS === */
.btn {
    border-radius: 14px;
    padding: 12px 24px;
    font-weight: 900;
    font-size: 14px;
    border: none;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    transition: all .18s ease;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary600);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(44, 21, 94, 0.30);
}

.btn-gold {
    background: var(--gold);
    color: #ffffff;
}

.btn-gold:hover {
    background: #967332;
    transform: translateY(-2px);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.70);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: var(--text);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.90);
}

.btn-block {
    width: 100%;
    display: block;
}

/* === 8. FORMS & INPUTS === */
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
select,
textarea {
    width: 100%;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(15, 23, 42, 0.12);
    padding: 12px 14px;
    font-size: 14px;
    color: var(--text);
    font-family: inherit;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 21, 94, 0.20);
}

.form-group {
    margin-bottom: 16px;
}

/* === 9. TABLES === */
table {
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 16px;
    overflow: hidden;
    border-collapse: collapse;
}

thead {
    background: rgba(44, 21, 94, 0.08);
}

th {
    padding: 14px;
    font-size: 13px;
    font-weight: 900;
    color: var(--primary);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 14px;
    font-size: 13px;
    color: rgba(15, 23, 42, 0.88);
    border-top: 1px solid var(--line);
}

tr:hover {
    background: rgba(44, 21, 94, 0.05);
}

/* === 10. ALERTS & STATUS === */
.alert {
    border-radius: 16px;
    background: var(--card);
    backdrop-filter: blur(10px);
    padding: 14px 18px;
    border-left: 5px solid var(--primary);
    margin-bottom: 16px;
}

.alert-success {
    border-left-color: var(--success);
}

.alert-warning {
    border-left-color: var(--warning);
}

.alert-danger {
    border-left-color: var(--danger);
}

.alert-info {
    border-left-color: var(--info);
}

/* === 11. BADGES & STATUS === */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-success {
    background: rgba(22, 163, 74, 0.14);
    color: var(--success);
}

.badge-danger {
    background: rgba(220, 53, 69, 0.14);
    color: var(--danger);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.14);
    color: var(--warning);
}

/* === 12. SIDEBAR (Admin) === */
.sidebar {
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    color: #ffffff;
}

.sidebar-link {
    display: block;
    padding: 12px 24px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all .18s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-link.active {
    background: rgba(44, 21, 94, 0.30);
    border-left: 4px solid var(--primary);
    color: #ffffff;
}

/* === 13. UTILITY CLASSES === */
.hidden {
    display: none;
}

.fixed {
    position: fixed;
}

.absolute {
    position: absolute;
}

.relative {
    position: relative;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.z-10 {
    z-index: 10;
}

.z-20 {
    z-index: 20;
}

.z-40 {
    z-index: 40;
}

.z-50 {
    z-index: 50;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.flex-col {
    flex-direction: column;
}

.flex-1 {
    flex: 1;
}

.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gap-2 {
    gap: 8px;
}

.gap-4 {
    gap: 14px;
}

.gap-6 {
    gap: 18px;
}

.min-h-screen {
    min-height: 100vh;
}

.w-full {
    width: 100%;
}

.max-w-xs {
    max-width: 20rem;
}

.max-w-sm {
    max-width: 24rem;
}

.max-w-md {
    max-width: 28rem;
}

.max-w-lg {
    max-width: 32rem;
}

.max-w-xl {
    max-width: 36rem;
}

.max-w-2xl {
    max-width: 42rem;
}

.max-w-4xl {
    max-width: 56rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.p-2 {
    padding: 8px;
}

.p-3 {
    padding: 12px;
}

.p-4 {
    padding: 14px;
}

.p-6 {
    padding: 18px;
}

.p-8 {
    padding: 24px;
}

.px-2 {
    padding-left: 8px;
    padding-right: 8px;
}

.px-3 {
    padding-left: 12px;
    padding-right: 12px;
}

.px-4 {
    padding-left: 14px;
    padding-right: 14px;
}

.px-6 {
    padding-left: 18px;
    padding-right: 18px;
}

.px-8 {
    padding-left: 24px;
    padding-right: 24px;
}

.py-2 {
    padding-top: 8px;
    padding-bottom: 8px;
}

.py-3 {
    padding-top: 12px;
    padding-bottom: 12px;
}

.py-4 {
    padding-top: 14px;
    padding-bottom: 14px;
}

.py-6 {
    padding-top: 18px;
    padding-bottom: 18px;
}

.py-8 {
    padding-top: 24px;
    padding-bottom: 24px;
}

.m-0 {
    margin: 0;
}

.mt-1 {
    margin-top: 4px;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 12px;
}

.mt-4 {
    margin-top: 14px;
}

.mt-6 {
    margin-top: 18px;
}

.mt-8 {
    margin-top: 24px;
}

.mb-1 {
    margin-bottom: 4px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-3 {
    margin-bottom: 12px;
}

.mb-4 {
    margin-bottom: 14px;
}

.mb-6 {
    margin-bottom: 18px;
}

.mb-8 {
    margin-bottom: 24px;
}

.space-y-2>*+* {
    margin-top: 8px;
}

.space-y-3>*+* {
    margin-top: 12px;
}

.space-y-4>*+* {
    margin-top: 14px;
}

.space-y-6>*+* {
    margin-top: 18px;
}

.bg-white {
    background-color: #fff;
}

.bg-gray-50 {
    background-color: #f9fafb;
}

.bg-gray-100 {
    background-color: #f3f4f6;
}

.bg-gray-900 {
    background-color: #111827;
}

.bg-black {
    background-color: #000;
}

.bg-transparent {
    background-color: transparent;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-white {
    color: #fff;
}

.text-gray-400 {
    color: #9ca3af;
}

.text-gray-500 {
    color: #6b7280;
}

.text-gray-600 {
    color: #4b5563;
}

.text-gray-700 {
    color: #374151;
}

.text-gray-800 {
    color: #1f2937;
}

.text-primary {
    color: var(--primary);
}

.text-gold {
    color: var(--gold);
}

.text-muted {
    color: var(--muted);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.font-sans {
    font-family: 'Lato', sans-serif;
}

.font-serif {
    font-family: 'Playfair Display', serif;
}

.font-normal {
    font-weight: 400;
}

.font-bold {
    font-weight: 700;
}

.font-black {
    font-weight: 900;
}

.italic {
    font-style: italic;
}

.uppercase {
    text-transform: uppercase;
}

.tracking-wide {
    letter-spacing: 0.03em;
}

.tracking-wider {
    letter-spacing: 0.05em;
}

.tracking-widest {
    letter-spacing: 0.1em;
}

.text-xs {
    font-size: 12px;
}

.text-sm {
    font-size: 13px;
}

.text-base {
    font-size: 14px;
}

.text-lg {
    font-size: 16px;
}

.text-xl {
    font-size: 18px;
}

.text-2xl {
    font-size: 22px;
}

.text-3xl {
    font-size: 28px;
}

.text-4xl {
    font-size: 32px;
}

.text-5xl {
    font-size: 40px;
}

.leading-none {
    line-height: 1;
}

.leading-tight {
    line-height: 1.25;
}

.leading-normal {
    line-height: 1.5;
}

.shadow {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.shadow-md {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.shadow-lg {
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.16);
}

.shadow-xl {
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.rounded {
    border-radius: 8px;
}

.rounded-lg {
    border-radius: 12px;
}

.rounded-xl {
    border-radius: 16px;
}

.rounded-2xl {
    border-radius: 18px;
}

.rounded-full {
    border-radius: 9999px;
}

.border {
    border-width: 1px;
}

.border-t {
    border-top-width: 1px;
}

.border-b {
    border-bottom-width: 1px;
}

.border-l {
    border-left-width: 1px;
}

.border-gray-100 {
    border-color: #f3f4f6;
}

.border-gray-200 {
    border-color: #e5e7eb;
}

.border-gray-300 {
    border-color: #d1d5db;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-x-auto {
    overflow-x: auto;
}

.overflow-y-auto {
    overflow-y: auto;
}

.cursor-pointer {
    cursor: pointer;
}

.pointer-events-none {
    pointer-events: none;
}

.opacity-0 {
    opacity: 0;
}

.opacity-50 {
    opacity: 0.5;
}

.opacity-100 {
    opacity: 1;
}

.transition {
    transition: all .18s ease;
}

.transition-opacity {
    transition: opacity .18s ease;
}

.duration-300 {
    transition-duration: 300ms;
}

.duration-1000 {
    transition-duration: 1000ms;
}

/* === 14. FOCUS STATES === */
:focus {
    outline: 3px solid rgba(44, 21, 94, 0.30);
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 3px solid rgba(44, 21, 94, 0.30);
    outline-offset: 2px;
}

/* === 15. ENVELOPE ANIMATION (Wedding Specific) === */
.envelope-container {
    position: relative;
    width: 300px;
    height: 200px;
    background: rgba(255, 255, 255, 0.08);
    perspective: 1000px;
    transition: transform 0.8s ease;
    border-radius: 8px;
}

.envelope-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(176, 142, 69, 0.20), rgba(176, 142, 69, 0.30));
    backdrop-filter: blur(10px);
    border-radius: 8px;
}

.envelope-front {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-right: 150px solid rgba(176, 142, 69, 0.40);
    border-top: 100px solid transparent;
    border-bottom: 100px solid rgba(176, 142, 69, 0.40);
    border-left: 150px solid rgba(176, 142, 69, 0.50);
    z-index: 10;
}

.envelope-front::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -150px;
    width: 300px;
    height: 100px;
    background: transparent;
    border-left: 150px solid transparent;
    border-right: 150px solid transparent;
    border-bottom: 100px solid rgba(176, 142, 69, 0.50);
    pointer-events: none;
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 150px solid transparent;
    border-right: 150px solid transparent;
    border-top: 110px solid rgba(176, 142, 69, 0.60);
    transform-origin: top;
    transition: transform 0.6s ease 0s, z-index 0s linear 0.6s;
    z-index: 20;
}

.envelope-card {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    background: var(--card);
    backdrop-filter: blur(10px);
    z-index: 5;
    transition: transform 0.8s ease 0.6s;
    padding: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-radius: 6px;
}

.envelope-open .envelope-flap {
    transform: rotateX(180deg);
    z-index: 1;
    transition: transform 0.6s ease 0s, z-index 0s linear 0.3s;
}

.envelope-open .envelope-card {
    transform: translateY(-120px) scale(0.9);
    z-index: 15;
}

/* === 16. RESPONSIVE === */
@media (max-width: 768px) {
    .glass-card {
        padding: 14px;
    }

    .kpi-value {
        font-size: 24px;
    }

    .grid-cols-2,
    .grid-cols-3 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .envelope-container {
        width: 260px;
        height: 170px;
    }

    .envelope-front {
        border-right-width: 130px;
        border-bottom-width: 85px;
        border-left-width: 130px;
        border-top-width: 85px;
    }

    .envelope-flap {
        border-left-width: 130px;
        border-right-width: 130px;
        border-top-width: 95px;
    }

    .envelope-front::after {
        left: -130px;
        width: 260px;
        height: 85px;
        border-left-width: 130px;
        border-right-width: 130px;
        border-bottom-width: 85px;
    }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .md\:flex {
        display: flex;
    }

    .md\:block {
        display: block;
    }
}