/* ============================
   BENEFITS/COMMUNITY WELCOME MODAL
   ============================ */

.benefits-modal .benefits-container {
    max-width: min(95vw, 460px);
    max-height: min(90vh, 700px);
   background: var(--bg-home-page);
}

.benefits-modal .benefits-header {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    padding: var(--space-md);
    text-align: center;
    color: white;
    position: relative;
}

/* Animated sparkles effect */
.benefits-modal .benefits-header::before,
.benefits-modal .benefits-header::after {
    content: '✨';
    position: absolute;
    font-size: 1.5rem;
    animation: sparkle 3s ease-in-out infinite;
}

.benefits-modal .benefits-header::before {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.benefits-modal .benefits-header::after {
    top: 30%;
    right: 10%;
    animation-delay: 1.5s;
}

@keyframes sparkle {
    0%, 100% { 
        opacity: 0;
        transform: scale(0.5) rotate(0deg);
    }
    50% { 
        opacity: 1;
        transform: scale(1) rotate(180deg);
    }
}

.benefits-modal .avatar-display {
    display: inline-block;
    width: clamp(60px, 15vw, 80px);
    height: clamp(60px, 15vw, 80px);
    background: white;
    border-radius: 50%;
    font-size: clamp(2rem, 6vw, 2.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: avatarBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes avatarBounce {
    0% { transform: scale(0) rotate(-180deg); }
    50% { transform: scale(1.1) rotate(90deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.benefits-modal .benefits-header h2 {
    font-size: clamp(1.4rem, 4vw, 1.7rem);
    margin: 0 0 0.5rem;
    color: white;
}

.benefits-modal .benefits-header h2 span {
    color: #fbbf24;
    font-weight: 700;
}

.benefits-modal .benefits-header p {
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    opacity: 0.95;
    margin: 0;
}

.benefits-modal .benefits-body {
   padding: clamp(1.5rem, 4vw, 2rem);
   overflow: auto;
}

.benefits-modal .welcome-bonus {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #fbbf24;
    border-radius: 16px;
    padding: clamp(1rem, 3vw, 1.25rem);
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    animation: slideInLeft 0.5s ease;
}

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

.benefits-modal .welcome-bonus::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.1) 0%, transparent 70%);
    animation: rotate 10s linear infinite;
}

.benefits-modal .bonus-icon {
    font-size: clamp(2rem, 6vw, 2.5rem);
    animation: giftWiggle 2s ease-in-out infinite;
}

@keyframes giftWiggle {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.benefits-modal .bonus-text {
    flex: 1;
}

.benefits-modal .bonus-text strong {
    display: block;
    font-size: clamp(1rem, 3vw, 1.1rem);
    color: #92400e;
    margin-bottom: 0.25rem;
}

.benefits-modal .bonus-text span {
    font-size: clamp(0.85rem, 2.5vw, 0.95rem);
    color: #78350f;
}

.benefits-modal .benefits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(0.75rem, 2vw, 1rem);
    margin-bottom: 1.5rem;
}

.benefits-modal .benefit {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: clamp(1rem, 3vw, 1.25rem);
    text-align: center;
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease backwards;
}

.benefits-modal .benefit:nth-child(1) { animation-delay: 0.1s; }
.benefits-modal .benefit:nth-child(2) { animation-delay: 0.2s; }
.benefits-modal .benefit:nth-child(3) { animation-delay: 0.3s; }
.benefits-modal .benefit:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.benefits-modal .benefit:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    background: white;
}

.benefits-modal .benefit-icon {
    display: block;
    font-size: clamp(2rem, 5vw, 2.5rem);
    margin-bottom: 0.5rem;
}

.benefits-modal .benefit strong {
    display: block;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    color: #111827;
    margin-bottom: 0.25rem;
}

.benefits-modal .benefit small {
    display: block;
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    color: #6b7280;
}

.benefits-modal .first-badge {
    background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 100%);
    border-radius: 16px;
    padding: clamp(1.25rem, 3vw, 1.5rem);
    text-align: center;
    margin-bottom: 1.5rem;
    border: 2px solid #a78bfa;
    animation: badgeReveal 0.6s ease backwards;
    animation-delay: 0.5s;
}

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

.benefits-modal .first-badge p {
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    color: #5b21b6;
    margin: 0 0 1rem;
    font-weight: 600;
}

.benefits-modal .badge-showcase {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: white;
    border-radius: 12px;
    padding: clamp(0.75rem, 2vw, 1rem);
}

.benefits-modal .badge-showcase > span {
    animation: badgeBounce 1s ease infinite alternate;
}

@keyframes badgeBounce {
    from { transform: translateY(0); }
    to { transform: translateY(-5px); }
}

.benefits-modal .badge-info {
    text-align: left;
}

.benefits-modal .badge-info strong {
    display: block;
    font-size: clamp(1rem, 3vw, 1.1rem);
    color: #5b21b6;
    margin-bottom: 0.25rem;
}

.benefits-modal .badge-info small {
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    color: #7c3aed;
}

.benefits-modal .benefits-body .btn-large {
    width: 100%;
    padding: clamp(1rem, 3vw, 1.25rem);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: clamp(1rem, 3vw, 1.1rem);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.benefits-modal .benefits-body .btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.benefits-modal .benefits-body .btn-large::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.benefits-modal .benefits-body .btn-large:hover::before {
    width: 300px;
    height: 300px;
}



/* ============================
   ANIMATIONS
   ============================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ============================
   PWA INSTALL MODALS
   ============================ */

/* Android Install Modal Styling */
.android-install-modal .modal-body {
    padding: 1.5rem;
}

.android-guide-content {
   text-align: center;
   padding: var(--space-md);
   overflow: auto;
}

.install-ready-text {
    font-size: 1.1rem;
    color: #4b5563;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Big install button */
.android-guide-content .btn-large {
    width: 100%;
    padding: 1.2rem;
    font-size: 1.2rem;
    font-weight: 600;
    background: var(--primary-gradient);
    border: none;
    border-radius: 16px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-xl);
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.android-guide-content .btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Benefits list */
.android-benefits {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.benefit-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.95rem;
    color: #374151;
}

.benefit-row:last-child {
    border-bottom: none;
}

.benefit-row span:first-child {
    font-size: 1.25rem;
    width: 28px;
    flex-shrink: 0;
}

.install-note {
    font-size: 0.85rem;
    color: #6b7280;
    text-align: center;
    line-height: 1.4;
    opacity: 0.9;
}

/* Simple Post-Install Modal */
.post-install-container {
    max-width: min(95vw, 420px);
    max-height: min(90vh, 650px);
}

.post-install-header {
    background: var(--green-gradient);
    padding: var(--space-lg);
    text-align: center;
    color: white;
    position: relative;
}

.success-checkmark {
    display: block;
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    animation: checkPop 0.5s ease;
}

@keyframes checkPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.post-install-header h2 {
    font-size: 1.5rem;
    margin: 0 0 0.25rem;
    color: white;
}

.post-install-header p {
    font-size: 0.95rem;
    opacity: 0.95;
    margin: 0;
}

.post-install-body {
    padding: 1.5rem;
}

.install-message {
    text-align: center;
}

.app-icon-display {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.install-message h3 {
    font-size: 1.25rem;
    color: #111827;
    margin: 0 0 0.5rem;
}

.install-message > p {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0 0 1.5rem;
    line-height: 1.4;
}

.next-steps {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: #374151;
}

.step:not(:last-child) {
    border-bottom: 1px solid #e5e7eb;
}

.step-emoji {
    font-size: 1.25rem;
    width: 24px;
}

.app-benefits-box {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.app-benefits-box p {
    margin: 0.25rem 0;
    font-size: 0.85rem;
    color: #166534;
}

.app-benefits-box p:first-child {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.post-install-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.post-install-actions .btn {
    width: 100%;
    padding: 0.9rem;
    font-size: 0.95rem;
    border-radius: 12px;
}

.post-install-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-weight: 600;
}

.post-install-actions .btn-ghost {
    background: transparent;
    color: #6b7280;
    border: none;
    font-size: 0.85rem;
    padding: 0.5rem;
}

.goodbye-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10000;
}

.goodbye-message.show {
    opacity: 1;
}

.goodbye-content {
    text-align: center;
}

.goodbye-content span {
    display: block;
    font-size: 3rem;
    margin-bottom: 0.5rem;
    animation: wave 0.5s ease;
}

.goodbye-content p {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

/* Success Toast for completion */
.success-toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: bottom 0.3s ease;
    z-index: 10000;
}

.success-toast.show {
    bottom: 30px;
}

.success-toast .toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.success-toast .toast-content span {
    font-size: 1.5rem;
}

.success-toast .toast-content p {
    margin: 0;
    font-weight: 600;
}

/* ============================
   RESPONSIVE BREAKPOINTS
   ============================ */

/* Small phones */
@media (max-width: 360px) {
    .stats-showcase {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .privacy-section {
        grid-template-columns: 1fr;
    }
    
    .age-gate-buttons,
    .nickname-actions {
        flex-direction: column;
    }
    
    .age-gate-buttons .btn,
    .nickname-actions .btn {
        width: 100%;
    }
    
    .cookie-actions {
        gap: 0.5rem;
    }
    
    .cookie-actions .btn {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
}

/* Responsive for sign in modal */
@media (max-width: 400px) {
    .signin-actions {
        flex-direction: column;
    }
    
    .passcode-input {
        padding-right: 1rem;
        font-size: 1.1rem;
    }
    
    .passcode-format-hint {
        position: static;
        transform: none;
        text-align: center;
        margin-top: 0.5rem;
    }
    
    .passcode-actions {
        flex-direction: column;
    }
    
    .passcode-actions .btn-secondary {
        width: 100%;
    }
    
    #passcodeValue {
        font-size: 1.5rem;
        letter-spacing: 0.2em;
    }
    
    .passcode-display {
        flex-direction: column;
        text-align: center;
    }
    
    .passcode-display .btn-sm {
        width: 100%;
    }
    
    .benefits-grid {
        grid-template-columns: 1fr;
    }
    
    .badge-showcase {
        flex-direction: column;
    }
}

/* Tablets */
@media (min-width: 768px) {
    .modal-container {
        max-height: 85vh;
    }
    
    .welcome-container {
        max-width: 550px;
    }
    
    .nickname-container {
        max-width: 500px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .modal-overlay {
        padding: 2rem;
    }
    
    .modal-container {
        max-height: 80vh;
    }
    
    .age-gate-container {
        max-width: 480px;
    }
    
    .welcome-container {
        max-width: 600px;
    }
}

/* Landscape on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .modal-container {
        max-height: 95vh;
        max-height: 95dvh;
    }
    
    .age-gate-header,
    .welcome-header,
    .nickname-header {
        padding: 1rem;
    }
    
    .age-gate-emoji,
    .welcome-emoji,
    .nickname-emoji {
        display: none;
    }
}

/* Dark mode support - keeping essential parts */
@media (prefers-color-scheme: dark) {
    .signin-modal .modal-container {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .signin-input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .signin-input:focus {
        border-color: #818cf8;
    }
    
    .signin-form label {
        color: #d1d5db;
    }
    
    .input-hint {
        color: #9ca3af;
    }
    
    .signin-help {
        background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
    }
    
    .help-content p {
        color: #f3f4f6;
    }
    
    .help-content small {
        color: #d1d5db;
    }
    
    .benefit strong {
        color: #f3f4f6;
    }
    
    .benefit small {
        color: #d1d5db;
    }
}

