:root {
    --color-rose-50: #FFF5F7;
    --color-rose-100: #FFE5EC;
    --color-rose-200: #FFCCD9;
    --color-rose-300: #FFB3C6;
    --color-rose-400: #FF8FAB;
    --color-rose-500: #FF6B9D;
    --color-rose-600: #E85A8A;
    
    --color-lilac-100: #EFE5F1;
    --color-lilac-400: #C266A0;
    
    --color-text-primary: #2D1B2E;
    --color-text-secondary: #6B4F6D;
    --color-text-light: #9B7E9D;
    --color-white: #FFFFFF;
    --color-error: #E63946;
    
    --bg-gradient-primary: linear-gradient(135deg, var(--color-rose-100) 0%, var(--color-lilac-100) 100%);
    
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    
    --shadow-md: 0 4px 6px -1px rgba(212, 175, 55, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(212, 175, 55, 0.15);
    --shadow-xl: 0 20px 25px -5px rgba(212, 175, 55, 0.2);
    --shadow-glow: 0 0 30px rgba(255, 107, 157, 0.4);
    
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--color-text-primary);
    background: var(--bg-gradient-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Partículas flotantes de corazones */
.floating-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.heart-particle {
    position: absolute;
    font-size: 20px;
    opacity: 0;
    animation: floatHeart 8s infinite ease-in-out;
}

@keyframes floatHeart {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

.hidden { 
    display: none !important; 
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-strong {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn {
    padding: 1rem 2rem;
    border-radius: var(--radius-full);
    border: none;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-rose-500) 0%, var(--color-lilac-400) 100%);
    color: var(--color-white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transform: translateY(-2px) scale(1.02);
}

.btn-secondary {
    background: var(--color-white);
    color: var(--color-text-primary);
    border: 2px solid var(--color-rose-300);
}

.btn-secondary:hover {
    background: var(--color-rose-50);
    border-color: var(--color-rose-400);
}

.btn-danger {
    background: var(--color-error);
    color: var(--color-white);
}

.input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--color-rose-200);
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-text-primary);
    background: var(--color-white);
    transition: all 0.3s;
}

.input:focus {
    outline: none;
    border-color: var(--color-rose-400);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
}

textarea.input {
    resize: vertical;
    min-height: 100px;
}

.label {
    display: block;
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Tarjetas mejoradas */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.phrase-card {
    position: relative;
    height: 280px;
    perspective: 1000px;
    cursor: pointer;
    animation: cardAppear 0.6s ease-out backwards;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-style: preserve-3d;
}

.phrase-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.card-front {
    background: linear-gradient(135deg, #fff 0%, var(--color-rose-50) 100%);
    border: 2px solid var(--color-rose-200);
}

.card-front::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 107, 157, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { 
        transform: translateX(-100%) translateY(-100%) rotate(45deg); 
    }
    100% { 
        transform: translateX(100%) translateY(100%) rotate(45deg); 
    }
}

.card-front h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--color-rose-600);
    margin-bottom: 0.5rem;
    text-align: center;
    position: relative;
    z-index: 1;
    line-height: 1.4;
}

.card-author {
    font-size: 0.75rem;
    color: var(--color-text-light);
    font-style: italic;
    margin-top: 0.5rem;
    position: relative;
    z-index: 1;
}

.card-emoji {
    font-size: 3rem;
    margin-top: 1rem;
    animation: pulse 2s infinite;
    position: relative;
    z-index: 1;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.1); 
    }
}

.card-back {
    background: linear-gradient(135deg, var(--color-rose-500) 0%, var(--color-lilac-400) 100%);
    transform: rotateY(180deg);
    color: white;
    text-align: center;
}

.card-back p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 1rem;
}

.card-actions {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.phrase-card:hover .card-actions {
    opacity: 1;
}

.btn-icon {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-icon:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

/* Modales */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--color-white);
    padding: 2rem;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-light);
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.close-button:hover {
    background: var(--color-rose-50);
    color: var(--color-text-primary);
}

@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .phrase-card {
        height: 260px;
    }
}