/**
 * ========================================================================
 * LOST ITEMS SOCIAL SHARING STYLES - TASK 3.10
 * ========================================================================
 * Comprehensive styling for social sharing features
 * 
 * Features:
 * - Social media button styles
 * - QR code modal styling
 * - Share toast notifications
 * - Responsive layouts
 * - Accessibility features
 * - Print styles for flyers
 * - Animation effects
 * ========================================================================
 */

/* ========================================================================
   SOCIAL SHARE CONTAINER
   ======================================================================== */

.social-share-container {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.social-share-container h3 {
    margin-bottom: 0.5rem;
}

/* ========================================================================
   SOCIAL SHARE BUTTONS - Enhanced Styling
   ======================================================================== */

.social-share-container button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 44px; /* Touch-friendly */
    min-height: 44px;
}

.social-share-container button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.social-share-container button:active {
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Button ripple effect */
.social-share-container button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.social-share-container button:active::after {
    width: 300px;
    height: 300px;
}

/* Platform-specific button enhancements */
.social-share-container button[onclick*="Facebook"]:hover {
    background: linear-gradient(135deg, #1877f2 0%, #0e5bb5 100%);
}

.social-share-container button[onclick*="Twitter"]:hover {
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
}

.social-share-container button[onclick*="LinkedIn"]:hover {
    background: linear-gradient(135deg, #0077b5 0%, #005885 100%);
}

.social-share-container button[onclick*="WhatsApp"]:hover {
    background: linear-gradient(135deg, #25d366 0%, #1da851 100%);
}

/* ========================================================================
   QR CODE MODAL
   ======================================================================== */

#qr-code-modal {
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#qr-code-modal .bg-white {
    animation: slideUp 0.3s ease-out;
}

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

#qr-code-container {
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

#qr-code-container img,
#qr-code-container canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================================================
   SUCCESS TOAST NOTIFICATION
   ======================================================================== */

#share-success-toast {
    animation: toastSlideIn 0.5s ease-out;
}

#share-success-toast.show {
    display: flex !important;
    align-items: center;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Toast auto-hide animation */
@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ========================================================================
   SHARE STATISTICS
   ======================================================================== */

.social-share-container .text-sm.text-gray-600 strong {
    color: #10b981;
    font-size: 1.125rem;
}

/* ========================================================================
   RESPONSIVE LAYOUTS
   ======================================================================== */

/* Mobile-first: Stack buttons vertically on small screens */
@media (max-width: 640px) {
    .social-share-container [class*="flex"] {
        flex-direction: column;
        width: 100%;
    }
    
    .social-share-container button {
        width: 100%;
        justify-content: center;
    }
    
    .social-share-container button span {
        display: inline !important;
    }
}

/* Tablet: 2 columns */
@media (min-width: 641px) and (max-width: 1024px) {
    .social-share-container [class*="grid-cols"] {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: Full layout */
@media (min-width: 1025px) {
    .social-share-container [class*="grid-cols"] {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========================================================================
   PRINT STYLES - For Flyers and QR Codes
   ======================================================================== */

@media print {
    /* Hide everything except the QR code when printing */
    body * {
        visibility: hidden;
    }
    
    #qr-code-modal,
    #qr-code-modal * {
        visibility: visible;
    }
    
    #qr-code-modal {
        position: fixed;
        left: 0;
        top: 0;
        background: white;
        backdrop-filter: none;
    }
    
    /* Hide modal overlay and buttons */
    #qr-code-modal .bg-black,
    #qr-code-modal button {
        display: none;
    }
    
    /* Enhance QR code for printing */
    #qr-code-container {
        border: 4px solid #000;
        padding: 2rem;
        page-break-inside: avoid;
    }
    
    /* Print flyer styles */
    .print-flyer {
        width: 100%;
        max-width: 8.5in;
        margin: 0 auto;
        page-break-after: always;
    }
    
    .print-flyer img {
        max-width: 100%;
        height: auto;
    }
    
    .print-flyer .qr-code {
        width: 3in;
        height: 3in;
        margin: 1rem auto;
    }
}

/* ========================================================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================================================== */

/* Focus indicators for keyboard navigation */
.social-share-container button:focus {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .social-share-container button,
    #qr-code-modal,
    #qr-code-modal .bg-white,
    #share-success-toast {
        animation: none !important;
        transition: none !important;
    }
    
    .social-share-container button:hover {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .social-share-container {
        border: 2px solid currentColor;
    }
    
    .social-share-container button {
        border: 2px solid currentColor;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .social-share-container {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        border-color: #334155;
    }
    
    .social-share-container h3 {
        color: #f1f5f9;
    }
    
    .social-share-container p {
        color: #cbd5e1;
    }
    
    #qr-code-modal .bg-white {
        background: #1e293b;
        color: #f1f5f9;
    }
}

/* ========================================================================
   LOADING STATES
   ======================================================================== */

.social-share-container button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.social-share-container button.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================================================
   HOVER EFFECTS - Platform Colors
   ======================================================================== */

.social-share-container button:hover i {
    transform: scale(1.2);
    transition: transform 0.3s ease;
}

/* ========================================================================
   MOBILE OPTIMIZATION
   ======================================================================== */

/* Touch-friendly tap targets */
@media (max-width: 768px) {
    .social-share-container button {
        min-height: 48px;
        min-width: 48px;
        font-size: 0.95rem;
    }
    
    .social-share-container {
        padding: 1rem;
    }
    
    #qr-code-modal .bg-white {
        max-width: calc(100% - 2rem);
        margin: 1rem;
    }
}

/* Prevent text selection on buttons */
.social-share-container button {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

/* ========================================================================
   ANIMATION UTILITIES
   ======================================================================== */

.pulse-once {
    animation: pulse 1s ease-in-out;
}

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

/* Success state */
.success-flash {
    animation: successFlash 0.5s ease-in-out;
}

@keyframes successFlash {
    0%, 100% {
        background-color: inherit;
    }
    50% {
        background-color: #10b981;
    }
}
