/* Good Morning Gallery Enhanced - Frontend Styles */
/* Matching the exact visual style from craftoapp.com */

/* Gallery Container */
.gmg-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
    padding: 0;
}

/* Grid Layout Variations */
.gmg-gallery.gmg-layout-grid[data-columns="2"] {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.gmg-gallery.gmg-layout-grid[data-columns="3"] {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.gmg-gallery.gmg-layout-grid[data-columns="4"] {
    grid-template-columns: repeat(4, minmax(200px, 1fr));
}

.gmg-gallery.gmg-layout-grid[data-columns="5"] {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* Card Styles - Matching craftoapp.com Design */
.gmg-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

.gmg-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Image Container */
.gmg-image-container {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gmg-image-container img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gmg-card:hover .gmg-image-container img {
    transform: scale(1.02);
}

/* Caption Styling - Matching craftoapp.com Typography */
.gmg-caption {
    padding: 12px 15px;
    background: #ffffff;
    text-align: left;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    display: flex;
    align-items: center;
    min-height: 50px;
}

.gmg-caption p {
    margin: 0;
    font-size: 12px;
    line-height: 1.3;
    color: #888888;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding-right: 25px; /* Make room for copy button */
    flex: 1;
}

/* Copy Button in Caption Area - Always Visible */
.gmg-caption-copy-btn {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    width: 18px;
    height: 18px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 1;
    z-index: 10;
    flex-shrink: 0;
}

/* Override theme CSS conflicts for copy button image */
.gmg-caption-copy-btn img {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    display: block !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
}

/* Action Buttons Container - Bottom of card */
.gmg-actions {
    display: flex;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Download and Share Buttons - Matching craftoapp.com Style */
.gmg-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border-radius: 0;
    height: 44px;
}

.gmg-btn:first-child {
    border-bottom-left-radius: 20px;
}

.gmg-btn:last-child {
    border-bottom-right-radius: 20px;
}

.gmg-btn + .gmg-btn {
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

/* Download Button - Purple/Gray color matching craftoapp */
.gmg-btn-download {
    background: #6c757d;
}

.gmg-btn-download:hover {
    background: #5a6268;
    transform: translateY(-1px);
    color: #ffffff;
    text-decoration: none;
}

/* Share Button - Green color matching WhatsApp */
.gmg-btn-share {
    background: #25D366;
}

.gmg-btn-share:hover {
    background: #128C7E;
    transform: translateY(-1px);
    color: #ffffff;
    text-decoration: none;
}

.gmg-btn svg {
    width: 14px;
    height: 14px;
    stroke-width: 2;
}

/* Toast Notification */
.gmg-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #333333;
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateX(400px);
    transition: transform 0.4s ease;
    z-index: 10000;
    font-weight: 500;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.gmg-toast.show {
    transform: translateX(0);
}

.gmg-toast-message {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gmg-gallery {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 15px;
        margin: 15px 0;
    }
    
    .gmg-gallery.gmg-layout-grid[data-columns="2"],
    .gmg-gallery.gmg-layout-grid[data-columns="3"],
    .gmg-gallery.gmg-layout-grid[data-columns="4"],
    .gmg-gallery.gmg-layout-grid[data-columns="5"] {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    .gmg-card {
        border-radius: 16px;
    }
    
    .gmg-btn:first-child {
        border-bottom-left-radius: 16px;
    }
    
    .gmg-btn:last-child {
        border-bottom-right-radius: 16px;
    }
    
    .gmg-caption {
        padding: 10px 12px;
        min-height: 45px;
    }
    
    .gmg-caption p {
        font-size: 11px;
    }
    
    .gmg-btn {
        padding: 10px 6px;
        font-size: 12px;
        height: 40px;
    }
    
    .gmg-toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        transform: translateY(100px);
    }
    
    .gmg-toast.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .gmg-gallery {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .gmg-gallery.gmg-layout-grid[data-columns="2"],
    .gmg-gallery.gmg-layout-grid[data-columns="3"],
    .gmg-gallery.gmg-layout-grid[data-columns="4"],
    .gmg-gallery.gmg-layout-grid[data-columns="5"] {
        grid-template-columns: 1fr;
    }
    
    .gmg-card {
        border-radius: 12px;
    }
    
    .gmg-btn:first-child {
        border-bottom-left-radius: 12px;
    }
    
    .gmg-btn:last-child {
        border-bottom-right-radius: 12px;
    }
    
    .gmg-btn {
        padding: 8px 4px;
        font-size: 11px;
        height: 36px;
    }
    
    .gmg-btn svg {
        width: 12px;
        height: 12px;
    }
}

/* Loading States */
.gmg-card.loading .gmg-image-container {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Accessibility */
.gmg-btn:focus,
.gmg-caption-copy-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.gmg-card:focus-within {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .gmg-actions,
    .gmg-caption-copy-btn,
    .gmg-toast {
        display: none !important;
    }
    
    .gmg-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .gmg-card {
        border: 2px solid #000;
    }
    
    .gmg-btn {
        border: 2px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .gmg-card,
    .gmg-image-container img,
    .gmg-btn,
    .gmg-toast {
        transition: none;
    }
    
    .gmg-card:hover {
        transform: none;
    }
    
    .gmg-card:hover .gmg-image-container img {
        transform: none;
    }
}



.gmg-caption-copy-btn:hover {
    background: transparent !important;
}




/* Share Modal Styles */
.gmg-share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
}

.gmg-share-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 10002;
    text-align: center;
    max-width: 90%;
    width: 400px;
}

.gmg-share-modal h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333333;
    font-size: 20px;
}

.gmg-share-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.gmg-share-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    border-radius: 8px;
    text-decoration: none;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gmg-share-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Specific Social Media Colors */
.gmg-share-facebook {
    background: #3b5998;
}

.gmg-share-twitter {
    background: #1da1f2;
}

.gmg-share-linkedin {
    background: #0077b5;
}

.gmg-share-pinterest {
    background: #bd081c;
}

.gmg-share-whatsapp {
    background: #25d366;
}

.gmg-share-telegram {
    background: #0088cc;
}

.gmg-share-email {
    background: #bb001b;
}

.gmg-share-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #888888;
}

@media (max-width: 480px) {
    .gmg-share-modal {
        padding: 15px;
    }
    .gmg-share-icon {
        width: 60px;
        height: 60px;
        font-size: 10px;
    }
}


