/* Enhanced Frontend Features for TSS Platform */

/* Global Enhancements */
.page-transition {
    animation: fadeSlideIn 0.6s ease-out;
}

@keyframes fadeSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Card Hover Effects */
.enhanced-hover-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
}

.enhanced-hover-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    border: 1px solid rgba(26, 188, 156, 0.2);
}

/* Statistics Counter Section */
.stats-section {
    background: linear-gradient(135deg, var(--tss-teal) 0%, var(--tss-navy) 100%);
    position: relative;
    overflow: hidden;
}

.stats-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="white" opacity="0.1"/></svg>') repeat;
    background-size: 50px 50px;
}

.counter {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.stat-item {
    position: relative;
    z-index: 2;
}

/* Testimonials Enhancement */
.testimonials-section {
    position: relative;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.testimonial-card {
    padding: 2.5rem;
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.testimonial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--tss-teal), var(--tss-orange), var(--tss-green));
}

.avatar-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Floating Action Buttons - HIDDEN */
.floating-actions {
    display: none !important; /* Hide all FABs */
}

/* Chat Widget - HIDDEN */
.floating-chat-widget {
    display: none !important; /* Hide chat widget */
}

.chat-toggle-btn {
    display: none !important; /* Hide chat button */
}

.fab-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: white;
    font-size: 1.3rem;
    position: relative;
    overflow: hidden;
}

.fab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fab:hover::before {
    opacity: 1;
}

.fab-emergency {
    background: linear-gradient(135deg, var(--tss-red), #c0392b);
}

.fab-contact {
    background: linear-gradient(135deg, var(--tss-teal), #16a085);
}

.fab-referral {
    background: linear-gradient(135deg, var(--tss-orange), #e67e22);
}

.fab:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    color: white;
}

.fab-label {
    position: absolute;
    right: 75px;
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(15px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.fab-label::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid rgba(0,0,0,0.85);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.fab-container:hover .fab-label {
    opacity: 1;
    transform: translateX(0);
}

/* Service Availability Indicator */
.availability-indicator {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 1040;
    background: white;
    padding: 15px 25px 15px 15px;
    border-radius: 0 30px 30px 0;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    border-left: 5px solid var(--tss-teal);
    transition: all 0.3s ease;
}

.availability-indicator:hover {
    transform: translateY(-50%) translateX(5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.18);
}

.availability-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    animation: statusPulse 2s infinite;
    position: relative;
}

.status-dot::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background: inherit;
    opacity: 0.3;
    animation: statusRipple 2s infinite;
}

.status-dot.online {
    background: #4CAF50;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes statusRipple {
    0% { transform: scale(1); opacity: 0.3; }
    100% { transform: scale(1.5); opacity: 0; }
}

.availability-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--tss-navy);
    letter-spacing: -0.02em;
}

/* Emergency Section Enhancement */
.emergency-section {
    position: relative;
    overflow: hidden;
}

.emergency-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%);
}

.emergency-icon {
    animation: emergencyPulse 3s infinite;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

@keyframes emergencyPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* Enhanced Carousel Controls */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    filter: none;
    background-size: 50%;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--tss-teal);
    transition: all 0.3s ease;
}

.carousel-control-prev:hover .carousel-control-prev-icon,
.carousel-control-next:hover .carousel-control-next-icon {
    background-color: var(--tss-navy);
    transform: scale(1.1);
}

.carousel-indicators button {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: none;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.carousel-indicators button.active {
    opacity: 1;
    transform: scale(1.2);
}

/* Interactive Service Cards */
.service-card-enhanced {
    position: relative;
    overflow: hidden;
    background: white;
    border-radius: 1rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
}

.service-card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--tss-teal), var(--tss-orange));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card-enhanced:hover::before {
    opacity: 0.05;
}

.service-card-enhanced:hover {
    transform: translateY(-12px) scale(1.02);
    border-color: var(--tss-teal);
    box-shadow: 0 25px 50px rgba(26, 188, 156, 0.15);
}

/* Pulse Animation for Emergency Elements */
@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

/* PC Screen Size Responsive Breakpoints */

/* Extra Large Screens (1920px+) */
@media (min-width: 1920px) {
    .floating-actions {
        right: 120px !important; /* More space from chat widget */
        bottom: 30px;
    }
    
    .fab {
        width: 65px;
        height: 65px;
        font-size: 1.4rem;
    }
    
    .fab-label {
        right: 80px; /* Adjust label position */
        font-size: 0.95rem;
    }
}

/* Large Screens (1440px - 1919px) */
@media (min-width: 1440px) and (max-width: 1919px) {
    .floating-actions {
        right: 110px !important;
        bottom: 25px;
    }
    
    .fab {
        width: 62px;
        height: 62px;
        font-size: 1.35rem;
    }
}

/* Standard Desktop (1024px - 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
    .floating-actions {
        right: 100px !important; /* Standard positioning */
        bottom: 20px;
        gap: 15px;
    }
    
    .fab {
        width: 60px;
        height: 60px;
        font-size: 1.3rem;
    }
    
    .fab-label {
        right: 75px;
        font-size: 0.9rem;
    }
}

/* Small Desktop/Large Tablet (769px - 1023px) */
@media (min-width: 769px) and (max-width: 1023px) {
    .floating-actions {
        right: 90px !important; /* Slightly closer to edge */
        bottom: 20px;
        gap: 12px;
    }
    
    .fab {
        width: 55px;
        height: 55px;
        font-size: 1.2rem;
    }
    
    .fab-label {
        right: 70px;
        font-size: 0.85rem;
        padding: 6px 10px;
    }
}

/* Mobile and Small Screens (≤768px) */
@media (max-width: 768px) {
    .floating-actions {
        right: 15px !important; /* Back to right edge on mobile */
        bottom: 120px !important; /* Higher to avoid chat widget */
        gap: 10px;
    }
    
    .fab {
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
    }
    
    .fab-label {
        display: none; /* Hide labels on mobile */
    }
    
    .availability-indicator {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        border-radius: 20px;
        margin: 15px auto;
        border-left: none;
        border-top: 4px solid var(--tss-teal);
        text-align: center;
        max-width: 250px;
    }
    
    .testimonial-card {
        padding: 1.5rem;
        margin: 0 10px;
    }
}

@media (max-width: 576px) {
    .fab-container {
        margin-bottom: 10px;
    }
    
    .stats-section .display-4 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .fab {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .floating-actions {
        gap: 10px;
    }
    
    .stats-section .col-6 {
        margin-bottom: 1.5rem;
    }
    
    .testimonial-card {
        padding: 1.25rem;
    }
    
    .avatar-circle {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    .hover-card,
    .enhanced-hover-card,
    .fab,
    .service-card-enhanced {
        transition: none;
    }
    
    .animate-float-up,
    .counter,
    .emergency-icon,
    .status-dot {
        animation: none;
    }
}

/* Focus States for Accessibility */
.fab:focus,
.hover-card:focus,
.enhanced-hover-card:focus {
    outline: 3px solid var(--tss-teal);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .testimonial-card {
        border: 2px solid var(--tss-navy);
    }
    
    .fab {
        border: 2px solid white;
    }
    
    .availability-indicator {
        border: 2px solid var(--tss-teal);
    }
}
