/* Modern WhatsApp Float Button */
.wts-app-floating {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
}

.modern-whatsapp-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #25D366;
    color: white;
    text-decoration: none;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1rem;
    animation: bounceWhatsapp 2s infinite;
    position: relative;
    overflow: hidden;
}

.modern-whatsapp-btn::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50px;
    background: #25D366;
    animation: rippleEffect 2s infinite;
    z-index: -1;
    left: 0;
    top: 0;
}

.modern-whatsapp-btn i {
    font-size: 1.8rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.modern-whatsapp-btn:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
    color: white;
    background: #20BA5A;
}

.modern-whatsapp-btn:hover i {
    animation: shake 0.5s ease-in-out;
}

@keyframes bounceWhatsapp {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes rippleEffect {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wts-app-floating {
        right: 15px;
        bottom: 15px;
    }

    .modern-whatsapp-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .modern-whatsapp-btn i {
        font-size: 1.5rem;
    }

    .whatsapp-text {
        display: none;
    }

    .modern-whatsapp-btn {
        width: 60px;
        height: 60px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
}

/* PWA Install App Button */
.install-app-btn {
    position: fixed;
    right: 20px;
    bottom: 100px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

.install-app-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.install-prompt {
    position: fixed;
    bottom: 170px;
    right: 20px;
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    max-width: 320px;
    width: auto;
    display: none;
    text-align: center;
}

.install-prompt.show {
    display: block;
    animation: slideUp 0.3s ease;
}

.install-prompt::before {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
}

.install-prompt h4 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #667eea;
}

.install-prompt p {
    color: #666;
    margin-bottom: 1.5rem;
}

.install-prompt-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.install-btn-yes,
.install-btn-no {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.install-btn-yes {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.install-btn-yes:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.install-btn-no {
    background: #e2e8f0;
    color: #4a5568;
}

.install-btn-no:hover {
    background: #cbd5e0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .install-app-btn {
        right: 15px;
        bottom: 85px;
        width: 55px;
        height: 55px;
    }

    .install-prompt {
        bottom: 150px;
        right: 15px;
        left: 15px;
        max-width: none;
        width: auto;
    }

    .install-prompt::before {
        right: 30px;
    }

    .install-prompt h4 {
        font-size: 1.2rem;
    }

    .install-prompt p {
        font-size: 0.9rem;
    }

    .install-prompt-buttons {
        flex-direction: column;
    }

    .install-btn-yes,
    .install-btn-no {
        width: 100%;
    }
}

/* ========== TOP CHARITIES SECTION ========== */
.top-charities-section {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(76, 175, 80, 0.05) 100%);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.top-charities-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

.top-charities-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(76, 175, 80, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

.top-charities-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    z-index: 1;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ffd700, #d4af37);
    color: #333;
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.charities-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.title-text {
    background: linear-gradient(135deg, #d4af37, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-icon {
    font-size: 2.5rem;
    animation: heartBeat 1.3s ease-in-out infinite;
}

.charities-subtitle {
    font-size: 1.1rem;
    color: rgba(26, 26, 26, 0.7);
    margin: 0;
    max-width: 700px;
    margin: 0 auto;
}

.header-decoration {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.decoration-line {
    width: 120px;
    height: 4px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
    border-radius: 2px;
}

/* Top Charities Grid */
.top-charities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 25px;
    margin-bottom: 60px;
    position: relative;
    z-index: 1;
    padding: 0 5px;
}

/* Charity Card Premium */
.charity-card-premium {
    display: flex;
    flex-direction: column;
    border: 2px solid rgba(212, 175, 55, 0.2);
    border-radius: 20px;
    overflow: hidden;
    background: white;
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.charity-card-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(76, 175, 80, 0.05));
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.charity-card-premium:hover::before {
    opacity: 1;
}

.charity-card-premium:hover {
    transform: translateY(-15px);
    box-shadow: 0 25px 50px rgba(212, 175, 55, 0.25);
    border-color: rgba(212, 175, 55, 0.5);
}

/* Rank Badge */
.rank-badge {
    position: absolute;
    top: -12px;
    right: 15px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.4rem;
    font-weight: 800;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.rank-1 {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #fff;
}

.rank-2 {
    background: linear-gradient(135deg, #C0C0C0, #808080);
    color: #fff;
}

.rank-3 {
    background: linear-gradient(135deg, #CD7F32, #996633);
    color: #fff;
}

.rank-badge:not(.rank-1):not(.rank-2):not(.rank-3) {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: #fff;
}

.rank-number {
    font-size: 1.8rem;
    line-height: 1;
}

/* Charity Image */
.charity-image-wrapper {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: #f5f5f5;
}

.charity-image-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.charity-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.charity-card-premium:hover .charity-image {
    transform: scale(1.12);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.charity-card-premium:hover .image-overlay {
    opacity: 1;
}

/* Lifetime Badge */
.lifetime-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

/* Charity Info */
.charity-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.charity-name {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 15px 0;
    line-height: 1.4;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.charity-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: rgba(26, 26, 26, 0.7);
}

.stat-item i {
    color: #d4af37;
    font-size: 0.95rem;
}

.stat-label {
    font-weight: 600;
}

.stat-value {
    color: #d4af37;
    font-weight: 700;
    font-size: 0.95rem;
}

/* Hover Button */
.charity-hover-btn {
    margin-top: auto;
    overflow: hidden;
}

.btn-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #d4af37, #ffd700);
    color: #1a1a1a;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    transition: left 0.4s ease;
}

.charity-card-premium:hover .btn-text {
    transform: scale(1.05);
}

.charity-card-premium:hover .btn-text::before {
    left: 100%;
}

/* Sparkle Effect for Top 3 */
.sparkle-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #ffd700;
    border-radius: 50%;
    opacity: 0;
}

.charity-rank-1 .sparkle:nth-child(1) {
    top: 20%;
    right: 15%;
    animation: twinkle 2s ease-in-out infinite;
}

.charity-rank-1 .sparkle:nth-child(2) {
    top: 60%;
    left: 10%;
    animation: twinkle 2s ease-in-out infinite 0.4s;
}

.charity-rank-1 .sparkle:nth-child(3) {
    bottom: 20%;
    right: 25%;
    animation: twinkle 2s ease-in-out infinite 0.8s;
}

.charity-rank-2 .sparkle:nth-child(1) {
    top: 30%;
    right: 15%;
    animation: twinkle 2.2s ease-in-out infinite;
}

.charity-rank-2 .sparkle:nth-child(2) {
    top: 55%;
    left: 15%;
    animation: twinkle 2.2s ease-in-out infinite 0.5s;
}

.charity-rank-2 .sparkle:nth-child(3) {
    bottom: 25%;
    right: 20%;
    animation: twinkle 2.2s ease-in-out infinite 0.9s;
}

.charity-rank-3 .sparkle:nth-child(1) {
    top: 25%;
    right: 20%;
    animation: twinkle 2.1s ease-in-out infinite;
}

.charity-rank-3 .sparkle:nth-child(2) {
    top: 50%;
    left: 12%;
    animation: twinkle 2.1s ease-in-out infinite 0.45s;
}

.charity-rank-3 .sparkle:nth-child(3) {
    bottom: 20%;
    right: 28%;
    animation: twinkle 2.1s ease-in-out infinite 0.85s;
}

/* Charities Footer */
.charities-footer {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.btn-view-all-charities {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #d4af37, #ffd700);
    color: #1a1a1a;
    padding: 16px 40px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-view-all-charities::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.4s ease;
}

.btn-view-all-charities:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.5);
    color: #1a1a1a;
}

.btn-view-all-charities:hover::before {
    left: 100%;
}

/* Animations */
@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    14% { transform: scale(1.15); }
    28% { transform: scale(1); }
    42% { transform: scale(1.15); }
    70% { transform: scale(1); }
}

@keyframes twinkle {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .top-charities-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 20px;
    }

    .charities-title {
        font-size: 2.3rem;
    }
}

@media (max-width: 992px) {
    .top-charities-section {
        padding: 60px 15px;
    }

    .top-charities-header {
        margin-bottom: 50px;
    }

    .top-charities-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 18px;
    }

    .charities-title {
        font-size: 2.1rem;
    }

    .title-icon {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .top-charities-section {
        padding: 50px 12px;
    }

    .top-charities-section::before {
        width: 250px;
        height: 250px;
        top: -30%;
        right: -20%;
    }

    .top-charities-section::after {
        width: 200px;
        height: 200px;
        bottom: -20%;
        left: -15%;
    }

    .top-charities-header {
        margin-bottom: 40px;
    }

    .top-charities-grid {
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: 14px;
        margin-bottom: 40px;
    }

    .charities-title {
        font-size: 1.7rem;
        gap: 12px;
        line-height: 1.3;
    }

    .title-icon {
        font-size: 1.6rem;
    }

    .charities-subtitle {
        font-size: 0.95rem;
        padding: 0 10px;
    }

    .charity-image-wrapper {
        height: 130px;
    }

    .charity-name {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }

    .rank-badge {
        width: 38px;
        height: 38px;
        font-size: 1rem;
        top: -10px;
        right: 12px;
    }

    .header-badge {
        padding: 10px 20px;
        font-size: 0.8rem;
    }

    .decoration-line {
        width: 100px;
    }
}

@media (max-width: 640px) {
    .top-charities-section {
        padding: 40px 10px;
    }

    .top-charities-section::before {
        width: 200px;
        height: 200px;
        opacity: 0.5;
    }

    .top-charities-section::after {
        width: 150px;
        height: 150px;
        opacity: 0.5;
    }

    .top-charities-header {
        margin-bottom: 35px;
    }

    .top-charities-grid {
        grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
        gap: 12px;
        margin-bottom: 35px;
    }

    .charities-title {
        font-size: 1.4rem;
        gap: 10px;
    }

    .title-icon {
        font-size: 1.4rem;
    }

    .charities-subtitle {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .header-badge {
        padding: 8px 16px;
        font-size: 0.75rem;
        margin-bottom: 15px;
    }

    .charity-card-premium {
        border-radius: 15px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

    .charity-card-premium:hover {
        transform: translateY(-10px);
        box-shadow: 0 15px 35px rgba(212, 175, 55, 0.2);
    }

    .charity-image-wrapper {
        height: 115px;
    }

    .charity-info {
        padding: 12px;
    }

    .charity-name {
        font-size: 0.8rem;
        margin-bottom: 10px;
        line-height: 1.3;
    }

    .charity-stats {
        margin-bottom: 12px;
    }

    .stat-item {
        font-size: 0.7rem;
    }

    .stat-label {
        font-weight: 600;
    }

    .stat-value {
        font-size: 0.85rem;
    }

    .btn-text {
        padding: 7px 10px;
        font-size: 0.7rem;
        gap: 4px;
    }

    .rank-badge {
        width: 33px;
        height: 33px;
        font-size: 0.9rem;
        top: -8px;
        right: 10px;
    }

    .btn-view-all-charities {
        padding: 13px 30px;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .top-charities-section {
        padding: 35px 8px;
    }

    .top-charities-section::before {
        width: 150px;
        height: 150px;
        opacity: 0.3;
    }

    .top-charities-section::after {
        width: 120px;
        height: 120px;
        opacity: 0.3;
    }

    .top-charities-header {
        margin-bottom: 30px;
    }

    .top-charities-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 10px;
        margin-bottom: 30px;
    }

    .charities-title {
        font-size: 1.2rem;
        gap: 8px;
        word-break: break-word;
    }

    .title-text {
        display: block;
    }

    .title-icon {
        font-size: 1.2rem;
    }

    .charities-subtitle {
        font-size: 0.85rem;
        padding: 0 5px;
    }

    .header-badge {
        padding: 7px 14px;
        font-size: 0.7rem;
        margin-bottom: 12px;
    }

    .header-badge i {
        font-size: 0.8rem;
    }

    .decoration-line {
        width: 80px;
        height: 3px;
    }

    .charity-card-premium {
        border: 1px solid rgba(212, 175, 55, 0.15);
    }

    .charity-card-premium:hover {
        transform: translateY(-8px);
    }

    .charity-image-wrapper {
        height: 100px;
    }

    .charity-info {
        padding: 10px;
    }

    .charity-name {
        font-size: 0.75rem;
        margin-bottom: 8px;
    }

    .charity-stats {
        margin-bottom: 10px;
        gap: 6px;
    }

    .stat-item {
        font-size: 0.65rem;
        gap: 3px;
    }

    .stat-item i {
        font-size: 0.75rem;
    }

    .stat-value {
        font-size: 0.75rem;
    }

    .btn-text {
        padding: 6px 8px;
        font-size: 0.65rem;
        gap: 3px;
        border-radius: 8px;
    }

    .btn-text i {
        font-size: 0.7rem;
    }

    .rank-badge {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
        top: -6px;
        right: 8px;
    }

    .lifetime-badge {
        font-size: 0.65rem;
        padding: 4px 8px;
        bottom: 8px;
        left: 8px;
    }

    .btn-view-all-charities {
        padding: 11px 25px;
        font-size: 0.9rem;
        gap: 8px;
    }

    .btn-view-all-charities i {
        font-size: 0.95rem;
    }
}

/* Touch and Accessibility Improvements */
@media (hover: none) and (pointer: coarse) {
    /* Mobile/Touch devices */
    .charity-card-premium:active {
        transform: scale(0.98);
    }

    .charity-card-premium:focus-visible {
        outline: 3px solid #d4af37;
        outline-offset: 2px;
    }

    .btn-view-all-charities:active {
        transform: scale(0.96);
    }

    .btn-view-all-charities:focus-visible {
        outline: 3px solid #d4af37;
        outline-offset: 2px;
    }
}

/* Keyboard Navigation Focus States */
.charity-card-premium:focus-visible {
    outline: 3px solid #d4af37;
    outline-offset: 2px;
}

.btn-view-all-charities:focus-visible {
    outline: 3px solid #d4af37;
    outline-offset: 2px;
}

/* Improved Animation Performance */
@media (prefers-reduced-motion: reduce) {
    .charity-card-premium,
    .charity-image,
    .btn-text,
    .btn-view-all-charities {
        transition: none;
        animation: none;
    }

    .title-icon {
        animation: none;
    }

    .sparkle {
        animation: none;
        opacity: 0.3;
    }
}

/* Print Styles */
@media print {
    .top-charities-section {
        page-break-inside: avoid;
    }

    .charities-footer {
        display: none;
    }

    .top-charities-grid {
        gap: 15px;
    }

    .charity-card-premium:hover {
        transform: none;
        box-shadow: none;
    }
}

