@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;800&display=swap');

:root {
    --primary: #ff3b5c;
    --primary-hover: #e63552;
    --bg-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-main: #1a1a1a;
    --text-muted: #666;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    overflow-x: hidden;
}

/* Background Animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 59, 92, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.15) 0%, transparent 40%);
    z-index: -1;
    animation: pulse 10s infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

#inviteBadge {
    animation: badgePulse 1.5s infinite;
}

@keyframes badgePulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ContentEditable Placeholder */
[contenteditable]:empty:before {
    content: attr(placeholder);
    color: rgba(255,255,255,0.3);
    font-weight: 600;
    font-style: italic;
    pointer-events: none;
    display: block; /* For Firefox */
}

.premium-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 8px 16px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.premium-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: white;
}

.premium-btn:active {
    transform: scale(0.95);
}

.container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    perspective: 1000px;
}

.card {
    background: transparent;
    border-radius: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    text-align: left;
    overflow: hidden;
    width: 100%;
    max-width: 500px;
    animation: fadeIn 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.card-header {
    background: white;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    background: #eee;
    display: block;
    border: 2px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.dashboard-container .profile-img {
    width: 100px;
    height: 100px;
    border: 4px solid #fff;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.header-text {
    display: flex;
    flex-direction: column;
}

.username {
    font-weight: 800;
    font-size: 1.1rem;
    color: #000;
    margin: 0;
}

.prompt {
    font-size: 1.1rem;
    font-weight: 700;
    color: #000;
}

.card-body {
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(15px);
    padding: 40px 24px;
    position: relative;
    min-height: 220px;
}

textarea {
    width: 100%;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 1.8rem;
    font-weight: 700;
    resize: none;
    height: 140px;
    outline: none;
    color: rgba(0, 0, 0, 0.6);
}

textarea::placeholder {
    color: rgba(0, 0, 0, 0.3);
}

.dice-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s;
}

.dice-btn:hover {
    transform: rotate(15deg) scale(1.1);
}

.submit-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 20px rgba(255, 59, 92, 0.3);
}

.submit-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
    box-shadow: 0 10px 25px rgba(255, 59, 92, 0.4);
}

.submit-btn:active {
    transform: scale(0.98);
}

.footer {
    margin-top: 24px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Success Message */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.success-card {
    background: white;
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    max-width: 320px;
    animation: fadeIn 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.success-icon {
    font-size: 48px;
    color: #4CAF50;
    margin-bottom: 16px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* GIF Grid */
.gif-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
}

.gif-item {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.gif-item:hover {
    transform: scale(1.05);
}

/* Background Patterns */
.bg-1 { background: linear-gradient(135deg, #6366f1, #a855f7) !important; }
.bg-2 { background: linear-gradient(135deg, #ec4899, #f97316) !important; }
.bg-3 { background: linear-gradient(135deg, #22c55e, #14b8a6) !important; }
.bg-4 { background: #000000 !important; }
.bg-5 { background: #3b82f6 !important; }
.bg-6 { 
    background: #1e293b !important;
    background-image: radial-gradient(circle at 2px 2px, rgba(255,255,255,0.1) 1px, transparent 0) !important;
    background-size: 20px 20px !important;
}

/* Share Sticker Styles */
#shareStickerWrapper {
    font-family: 'Outfit', sans-serif;
    user-select: none;
    transition: transform 0.3s ease;
}

#shareStickerWrapper:active {
    transform: scale(0.98);
}

#viewCardHeader h3 {
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#viewCardText {
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148,163,184,0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148,163,184,0.35);
}

@media (max-width: 480px) {
    .container {
        padding: 16px;
    }
    .gif-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
