/**
 * Travel Monster Gallery Link Styles
 * 
 * @package Travel Monster
 */

/* Gallery Link Wrapper in Elementor Editor */
.travel-monster-gallery-link-wrapper {
    margin-top: 15px;
    padding: 15px;
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.travel-monster-gallery-link-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 12px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.travel-monster-gallery-link-input {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    line-height: 1.5;
    background: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Selected thumbnail indicator */
.travel-monster-selected {
    outline: 2px solid #007cba !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2) !important;
}

.travel-monster-gallery-link-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.travel-monster-gallery-link-input::placeholder {
    color: #aaa;
}

.travel-monster-gallery-link-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.travel-monster-gallery-link-save:hover {
    background: #005a87;
}

.travel-monster-gallery-link-save:active {
    transform: translateY(1px);
}

.travel-monster-gallery-link-save:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Gallery Image Selected State */
.elementor-control-gallery-thumbnail.selected {
    box-shadow: 0 0 0 3px #0073aa;
}

.elementor-control-gallery-thumbnail.has-custom-link::after {
    content: '\f103';
    font-family: 'eicons';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: #0073aa;
    color: #fff;
    font-size: 10px;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
    z-index: 1;
}

/* Frontend Gallery Link Styles */
.travel-monster-gallery-custom-link {
    display: block;
    position: relative;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.travel-monster-gallery-custom-link:hover {
    opacity: 0.9;
}

.travel-monster-gallery-custom-link img {
    transition: transform 0.3s ease;
}

.travel-monster-gallery-custom-link:hover img {
    transform: scale(1.05);
}

/* Gallery with custom links - cursor pointer */
.elementor-image-gallery .gallery-item a.travel-monster-gallery-custom-link {
    cursor: pointer;
}

/* Media Library Custom Link Field */
#travel_monster_gallery_link {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.attachment-details .travel-monster-gallery-link-field {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.attachment-details .travel-monster-gallery-link-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.attachment-details .travel-monster-gallery-link-field .description {
    margin-top: 5px;
    color: #666;
    font-size: 12px;
    font-style: italic;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .travel-monster-gallery-link-wrapper {
        padding: 12px;
    }
    
    .travel-monster-gallery-link-input {
        font-size: 14px; /* Prevent zoom on iOS */
    }
    
    .travel-monster-gallery-link-save {
        width: 100%;
    }
}

/* Animation for save button states */
@keyframes saveSuccess {
    0% {
        background-color: #46b450;
    }
    100% {
        background-color: #0073aa;
    }
}

@keyframes saveError {
    0% {
        background-color: #dc3232;
    }
    100% {
        background-color: #0073aa;
    }
}

.travel-monster-gallery-link-save.success {
    animation: saveSuccess 1.5s ease;
}

.travel-monster-gallery-link-save.error {
    animation: saveError 1.5s ease;
}
