:root {
    --bg-color: #0d1117;
    --surface: #161b22;
    --surface-glass: rgba(255, 255, 255, 0.03);
    --text-color: #f0f6fc;
    --text-muted: #8b949e;
    --accent: #d4af37; /* Golden Hour / Premium Gold */
    --accent-glow: rgba(212, 175, 55, 0.4);
    --accent-dark: #b8860b;
    --secondary: #30363d;
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-shine: rgba(255, 255, 255, 0.05);
    
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Outfit', sans-serif;
}

/* Custom Template Fonts */
@font-face {
    font-family: 'Aboreto';
    src: url('fonts/Aboreto.ttf');
    font-display: swap;
}

@font-face {
    font-family: 'AlexBrush';
    src: url('fonts/AlexBrush.ttf');
    font-display: swap;
}

@font-face {
    font-family: 'AnticDidone';
    src: url('fonts/AnticDidone.ttf');
    font-display: swap;
}

@font-face {
    font-family: 'BodoniModa';
    src: url('fonts/BodoniModa.ttf');
    font-display: swap;
}

@font-face {
    font-family: 'BodoniModa9pt';
    src: url('fonts/BodoniModa.ttf');
    font-display: swap;
}

@font-face {
    font-family: 'Callheart';
    src: url('fonts/Callheart.ttf');
    font-display: swap;
}

@font-face {
    font-family: 'Gotu';
    src: url('fonts/Gotu.ttf');
    font-display: swap;
}

@font-face {
    font-family: 'Italiana';
    src: url('fonts/Italiana.ttf');
    font-display: swap;
}

@font-face {
    font-family: 'NotoSerif';
    src: url('fonts/NotoSerif.ttf');
    font-display: swap;
}

@font-face {
    font-family: 'PetitFormalScript';
    src: url('fonts/PetitFormalScript.ttf');
    font-display: swap;
}

@font-face {
    font-family: 'PlayfairDisplay';
    src: url('fonts/PlayfairDisplay.ttf');
    font-display: swap;
}

@font-face {
    font-family: 'RougeScript';
    src: url('fonts/RougeScript.ttf');
    font-display: swap;
}

@font-face {
    font-family: 'WindSong';
    src: url('fonts/WindSong.ttf');
    font-display: swap;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100dvh; /* Use Dynamic Viewport Height for mobile stability */
    overflow-x: hidden;
    line-height: 1.6;
    background-image: 
        radial-gradient(at 0% 0%, rgba(212, 175, 55, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(13, 17, 23, 1) 0px, transparent 50%);
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.6;
    animation: drift 25s infinite alternate ease-in-out;
    pointer-events: none;
    will-change: transform;
}

.orb-1 {
    width: 900px;
    height: 900px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.15) 0%, transparent 70%);
    top: -20%;
    left: -10%;
}

.orb-2 {
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
    bottom: -15%;
    right: -10%;
    animation-delay: -5s;
}

.orb-3 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.05) 0%, transparent 70%);
    top: 25%;
    left: 35%;
    animation-delay: -10s;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

/* Header */
.glass-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--surface-glass);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    padding: 1.25rem 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-header.scrolled {
    padding: 0.75rem 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    color: var(--text-color);
}

.header-logo {
    height: 100px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.05);
}

.logo span {
    color: var(--accent);
    letter-spacing: -0.5px;
}

.filter-nav {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: 0.65rem 1.6rem;
    border-radius: 14px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.02em;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
}

.filter-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    box-shadow: 0 8px 25px var(--accent-glow);
    font-weight: 600;
}

/* Mobile Toggle Styles */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    transition: all 0.3s ease;
    border-radius: 2px;
}

@media (max-width: 992px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .filter-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--bg-color);
        flex-direction: column;
        justify-content: center;
        padding: 2rem;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
    }

    .filter-nav.active {
        right: 0;
    }

    .filter-btn {
        width: 100%;
        padding: 1.25rem;
        font-size: 1.1rem;
        text-align: center;
        border-radius: 16px;
    }

    #user-info {
        margin: 1rem 0 0 0 !important;
        width: 100%;
        justify-content: center;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

.filter-select {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: 0.6rem 2.4rem 0.6rem 1.4rem;
    border-radius: 9999px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1.1rem center;
    background-size: 0.9em;
    font-family: inherit;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.filter-select:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.filter-select:focus {
    outline: none;
    border-color: var(--text-color);
}

.filter-select option {
    background: var(--bg-color);
    color: var(--text-color);
}

/* Premium Gallery Search Box */
.search-box-premium {
    position: relative;
    max-width: 350px;
    min-width: 240px;
    flex: 1;
}

.gallery-input-premium {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: 0.75rem 1.4rem 0.75rem 3rem;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    font-family: inherit;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.gallery-input-premium:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.gallery-input-premium:focus {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
    background: rgba(255, 255, 255, 0.1);
}

.search-icon-premium {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    font-size: 1.1rem;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.gallery-input-premium:focus + .search-icon-premium,
.gallery-input-premium:not(:placeholder-shown) + .search-icon-premium {
    opacity: 0.8;
}



/* Main Gallery */
.gallery-container {
    max-width: 1400px;
    margin: 3rem auto;
    padding: 0 2rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
    opacity: 1;
}

.card {
    background: var(--surface-glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    animation: entranceFade 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

@keyframes entranceFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card.deleting {
    opacity: 0 !important;
    transform: scale(0.9) !important;
    pointer-events: none !important;
    transition: all 0.4s ease !important;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 20px var(--accent-glow),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.card-img-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    min-height: 240px; /* Placeholder while image loads */
    overflow: hidden;
    background: #1e2430;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.card:has(.has-cutouts) .card-img-container {
    aspect-ratio: auto;
    height: 400px;
}

.card-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.card-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.6s ease;
}

.has-cutouts {
    background-image: url('collage-photo.png');
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.card:hover .card-img {
    transform: scale(1.05);
}

.card-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.card-info {
    padding: 1.25rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.card-type {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    z-index: 1001;
    max-width: 1200px;
    width: 95vw;
    height: 90vh;
    max-height: 90vh;
    display: grid;
    grid-template-columns: 1fr 400px;
    grid-template-rows: minmax(0, 1fr); /* Constrained height for inner items */
    gap: 0;
    overflow: hidden;
    align-items: stretch;
    background: rgba(13, 17, 23, 0.85);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(30px) saturate(160%);
    -webkit-backdrop-filter: blur(30px) saturate(160%);
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.8);
    transform: scale(0.95);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@media (max-width: 1100px) {
    .modal-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto; /* Changed from auto 1fr to allow scrolling */
        max-height: 95vh;
        overflow-y: auto;
    }
}

/* Specific optimization for modern high-end smartphones (iPhone 17 / S25) */
@media (max-width: 768px) {
    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100dvh;
        border-radius: 0; /* Fullscreen feel */
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }
    
    .modal-img-wrapper {
        width: 100% !important;
        max-height: none !important;
        aspect-ratio: auto;
        padding: 1rem;
    }

    .modal-info {
        padding: 1.25rem !important;
        border-top: 1px solid var(--glass-border);
    }
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-info {
    padding: 2.5rem;
    background: rgba(22, 27, 34, 0.4);
    border-left: 1px solid var(--glass-border);
    display: block; 
    height: 100%;
    max-height: 100%; /* Force constraint */
    overflow-y: auto !important;
    overscroll-behavior: contain;
    position: relative;
}

@media (max-width: 1100px) {
    .modal-info {
        border-left: none;
        border-top: 1px solid var(--glass-border);
        height: auto;
        padding: 1.5rem;
    }
}

.modal-info::-webkit-scrollbar {
    width: 8px;
}

.modal-info::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3); /* Increased visibility */
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.modal-info::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    z-index: 1002;
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.3s;
}

.modal-close:hover {
    transform: scale(1.1);
}

.modal-prev,
.modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(4px);
    padding: 1rem;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 1002;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-prev:hover,
.modal-next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        text-align: center;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
}

/* ─── Modal img wrapper & Canvas overlay ─────────────────────── */
.modal-img-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 80vh;
}

.modal-img-wrapper img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    display: block;
}

@media (max-width: 768px) {
    .modal-img-wrapper img {
        max-height: none; /* Let it scale with width on mobile */
    }
}

.text-overlay-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    z-index: 10;
    pointer-events: all;
    touch-action: none; /* Prevents scrolling while dragging text fields */
}

/* Floating edit input */
.text-field-input {
    position: absolute;
    z-index: 20;
    border: 2px solid rgba(99, 102, 241, 0.8);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.5);
    color: inherit;
    text-align: center;
    outline: none;
    padding: 0 4px;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
    backdrop-filter: blur(4px);
}

.text-field-input::selection {
    background: rgba(99, 102, 241, 0.4);
}

/* Personalization hint */
.modal-hint {
    font-size: 0.78rem;
    color: rgba(99, 102, 241, 0.8);
    margin-top: 0.25rem;
    letter-spacing: 0.02em;
}

/* Glass Card Helper */
.glass-card {
    background: var(--surface-glass);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.4),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

/* ─── Login Overlay ─────────────────────────────────────────── */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: url('login-bg.png') no-repeat center center;
    background-size: cover;
    display: flex;
    overflow-y: auto;
    padding: 2rem 1rem;
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-overflow-scrolling: touch;
}

.login-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.login-content {
    background: linear-gradient(135deg, rgba(22, 27, 34, 0.92) 0%, rgba(13, 17, 23, 0.98) 100%);
    padding: 3.5rem;
    margin: auto;
    border-radius: 32px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    border: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.9), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    transform: translateY(30px);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 10;
}

.login-logo {
    width: 320px;
    height: auto;
    margin-bottom: 2rem;
    object-fit: contain;
}

.login-overlay.active .login-content {
    transform: translateY(0);
}

.login-content h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--gold-primary);
    margin-bottom: 1.5rem;
}

.login-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-form input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1.1rem;
    color: white;
    font-size: 1rem;
    font-family: var(--font-body);
    transition: all 0.3s ease;
}

.login-form input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.15);
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #000;
    border: none;
    padding: 1.1rem;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 20px var(--accent-glow);
    margin-top: 1rem;
}

.primary-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 30px rgba(212, 175, 55, 0.3);
    filter: brightness(1.1);
}

.primary-btn:active {
    transform: translateY(-1px);
}

.login-note {
    font-size: 0.8rem;
    margin-top: 1.5rem;
    display: block;
    color: var(--text-muted);
}

/* ─── Save Button ───────────────────────────────────────────── */
.modal-actions {
    margin-top: 1.5rem;
}

.save-btn {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #000;
    border: none;
    padding: 1rem 2rem;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
    filter: brightness(1.1);
}

/* ─── Toast ─────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(212, 175, 55, 0.95);
    color: #000;
    padding: 1rem 2rem;
    border-radius: 12px;
    z-index: 3000;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
}

.toast.active {
    transform: translateX(-50%) translateY(0);
}

/* ─── Text Controls ─────────────────────────────────────────── */
.text-controls {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.text-controls label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

#font-size-slider {
    width: 100%;
    accent-color: #6366f1;
    cursor: pointer;
}

/* ─── Save & Star ───────────────────────────────────────────── */
.star-icon {
    font-size: 1.2rem;
    margin-right: 0.5rem;
    color: #ffd700;
}

/* ─── Delete Button ─────────────────────────────────────────── */
.card-delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.card:hover .card-delete-btn {
    opacity: 1;
}

.card-delete-btn:hover {
    transform: scale(1.1);
    background: #ef4444;
}
/* --- Dynamic Text Controls ----------------------------------- */
.dynamic-controls-container {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.control-group {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
    .control-group {
        padding: 0.8rem;
    }
    
    .dynamic-controls-container {
        gap: 1rem;
    }
}

.control-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.control-group input[type="text"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: white;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.control-group input[type="text"]:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.15);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.slider-container input[type="range"] {
    flex: 1;
    accent-color: var(--accent);
    height: 4px;
    cursor: pointer;
}

.slider-value {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 30px;
    text-align: right;
}
/* Smoothing scroll for modern mobiles */
.modal-content, .login-overlay {
    -webkit-overflow-scrolling: touch;
}

/* Prevent body scroll when modal/overlay is active */
body.modal-open {
    overflow: hidden;
    height: 100dvh;
}
