/**
 * UXD Elementor Extension - Frontend Styles
 * 
 * @package UXD_Elementor_Extension
 * @since 1.0.0
 */

/* ==========================================================================
   GENERAL STYLES
   ========================================================================== */

.uxd-widget {
    box-sizing: border-box;
}

.uxd-widget *,
.uxd-widget *::before,
.uxd-widget *::after {
    box-sizing: inherit;
}

/* ==========================================================================
   HOVER BOX WIDGET
   ========================================================================== */

.uxd-hover-box-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: inherit;
}

.uxd-hover-box {
    position: relative;
    overflow: hidden;
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: inherit;
    transition: all 0.3s ease;
}

.uxd-hover-box:hover {
    text-decoration: none;
    color: inherit;
}

.uxd-hover-box-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: inherit;
}

.uxd-hover-box-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.uxd-hover-box-overlay {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease;
}

.uxd-hover-box-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* Hover Effects */
.uxd-hover-effect-fade:hover .uxd-hover-box-content {
    opacity: 1;
    visibility: visible;
}

.uxd-hover-effect-fade:hover .uxd-hover-box-overlay {
    opacity: 0;
    visibility: hidden;
}

/* ==========================================================================
   GALLERY GRID WIDGET
   ========================================================================== */

.uxd-gallery-wrapper {
    width: 100%;
}

.uxd-gallery-controls {
    margin-bottom: 20px;
    text-align: center;
}

.uxd-gallery-search {
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
    max-width: 100%;
}

.uxd-gallery-search:focus {
    border-color: #0073aa;
}

.uxd-gallery-grid {
    display: grid;
    width: 100%;
}

.uxd-gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.uxd-gallery-item.hidden {
    display: none;
}

.uxd-gallery-link {
    display: block;
    text-decoration: none;
}

.uxd-gallery-image-wrap {
    position: relative;
    overflow: hidden;
}

.uxd-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.uxd-gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    background-color: rgba(0, 0, 0, 0.5);
}

.uxd-gallery-item:hover .uxd-gallery-overlay {
    opacity: 1;
}

.uxd-gallery-caption {
    text-align: center;
    font-weight: 500;
    color: #fff;
}

.uxd-caption-below {
    padding: 10px 0;
    color: #333;
}

/* Gallery Hover Effects */
.uxd-hover-zoom .uxd-gallery-item:hover img {
    transform: scale(1.1);
}

.uxd-hover-zoom-out .uxd-gallery-item:hover img {
    transform: scale(0.9);
}

.uxd-hover-slide .uxd-gallery-item:hover img {
    transform: translateX(10px);
}

.uxd-hover-fade .uxd-gallery-item:hover img {
    opacity: 0.8;
}

/* Lightbox Styles */
.uxd-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.uxd-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: zoomIn 0.3s ease;
}

.uxd-lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.uxd-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    cursor: pointer;
    line-height: 1;
    padding: 10px;
    transition: color 0.3s ease;
}

.uxd-lightbox-close:hover {
    color: #ccc;
}

/* ==========================================================================
   INFO BOX WIDGET
   ========================================================================== */

.uxd-info-box-wrapper {
    display: block;
}

.uxd-info-box {
    display: flex;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.uxd-info-box:hover {
    text-decoration: none;
    color: inherit;
    transform: translateY(-5px);
}

.uxd-icon-position-top {
    flex-direction: column;
    align-items: center;
}

.uxd-icon-position-left {
    flex-direction: row;
    align-items: flex-start;
}

.uxd-icon-position-right {
    flex-direction: row-reverse;
    align-items: flex-start;
}

.uxd-icon-position-left .uxd-info-box-icon,
.uxd-icon-position-right .uxd-info-box-icon {
    flex-shrink: 0;
}

.uxd-icon-position-left .uxd-info-box-content {
    margin-left: 20px;
}

.uxd-icon-position-right .uxd-info-box-content {
    margin-right: 20px;
}

.uxd-info-box-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.uxd-info-box-icon img {
    object-fit: cover;
}

.uxd-info-box-content {
    flex: 1;
}

.uxd-info-box-title {
    font-weight: 600;
    line-height: 1.3;
}

.uxd-info-box-description {
    line-height: 1.6;
    margin: 0;
}

/* ==========================================================================
   PREMIUM WIDGET STYLES
   ========================================================================== */

.uxd-premium-widget-wrapper {
    margin: 20px 0;
}

.uxd-premium-upgrade-notice {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.uxd-premium-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.9;
}

.uxd-premium-upgrade-notice h3 {
    color: white;
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 600;
}

.uxd-premium-upgrade-notice p {
    color: rgba(255,255,255,0.9);
    margin: 0 0 25px 0;
    font-size: 16px;
    line-height: 1.6;
}

.uxd-premium-features {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
}

.uxd-premium-features h4 {
    color: white;
    margin: 0 0 15px 0;
    font-size: 18px;
}

.uxd-premium-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.uxd-premium-features li {
    color: rgba(255,255,255,0.9);
    padding: 5px 0;
    position: relative;
    padding-left: 25px;
}

.uxd-premium-features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4CAF50;
    font-weight: bold;
}

.uxd-upgrade-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ff6b35;
    color: white !important;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4);
    margin-top: 10px;
}

.uxd-upgrade-button:hover {
    background: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.6);
    color: white !important;
    text-decoration: none;
}

.uxd-upgrade-button i {
    font-size: 18px;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

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

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

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

@keyframes slideInDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes wobbleHorizontal {
16.65% { transform: translateX(-2px); }
33.3% { transform: translateX(1px); }
49.95% { transform: translateX(-1px); }
66.6% { transform: translateX(1px); }
83.25% { transform: translateX(-1px); }
100% { transform: translateX(0); }
}

@keyframes wobbleVertical {
16.65% { transform: translateY(-2px); }
33.3% { transform: translateY(1px); }
49.95% { transform: translateY(-1px); }
66.6% { transform: translateY(1px); }
83.25% { transform: translateY(-1px); }
100% { transform: translateY(0); }
}

@keyframes buzz {
50% { transform: translateX(2px) rotate(1deg); }
100% { transform: translateX(-2px) rotate(-1deg); }
}

@keyframes buzzOut {
10% { transform: translateX(2px) rotate(1deg); }
20% { transform: translateX(-2px) rotate(-1deg); }
30% { transform: translateX(1px) rotate(0deg); }
40% { transform: translateX(-1px) rotate(1deg); }
50% { transform: translateX(0px) rotate(-1deg); }
60% { transform: translateX(1px) rotate(0deg); }
70% { transform: translateX(0px) rotate(-1deg); }
80% { transform: translateX(0px) rotate(1deg); }
90% { transform: translateX(0px) rotate(0deg); }
}

@keyframes pulse {
25% { transform: scale(1.05); }
75% { transform: scale(0.95); }
}

@keyframes pulseGrow {
to { transform: scale(1.1); }
}

@keyframes pulseShrink {
to { transform: scale(0.9); }
}

@keyframes bounceIn {
0% { transform: scale(0.3); opacity: 0; }
50% { transform: scale(1.05); }
70% { transform: scale(0.9); }
100% { transform: scale(1); opacity: 1; }
}

@keyframes bounceOut {
20% { transform: scale(1.1); }
50% { transform: scale(0.95); }
55% { transform: scale(1.05); }
100% { transform: scale(0.3); opacity: 0; }
}

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

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

@keyframes fadeInDown {
from { opacity: 0; transform: translateY(-30px); }
to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
from { opacity: 0; transform: translateX(-30px); }
to { opacity: 1; transform: translateX(0); }
}

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

@keyframes slideInUp {
from { transform: translateY(100%); }
to { transform: translateY(0); }
}

@keyframes slideInDown {
from { transform: translateY(-100%); }
to { transform: translateY(0); }
}

@keyframes slideInLeft {
from { transform: translateX(-100%); }
to { transform: translateX(0); }
}

@keyframes slideInRight {
from { transform: translateX(100%); }
to { transform: translateX(0); }
}

@keyframes zoomIn {
from { opacity: 0; transform: scale(0.3); }
to { opacity: 1; transform: scale(1); }
}

@keyframes zoomOut {
from { opacity: 0; transform: scale(1.7); }
to { opacity: 1; transform: scale(1); }
}

@keyframes bounceInAnimation {
0% { opacity: 0; transform: scale(0.3); }
25% { opacity: 1; transform: scale(1.1); }
50% { transform: scale(0.9); }
75% { transform: scale(1.03); }
100% { opacity: 1; transform: scale(1); }
}

@keyframes flipInX {
from { transform: perspective(400px) rotate3d(1, 0, 0, 90deg); opacity: 0; }
40% { transform: perspective(400px) rotate3d(1, 0, 0, -20deg); }
60% { transform: perspective(400px) rotate3d(1, 0, 0, 10deg); opacity: 1; }
80% { transform: perspective(400px) rotate3d(1, 0, 0, -5deg); }
to { transform: perspective(400px); opacity: 1; }
}

@keyframes flipInY {
from { transform: perspective(400px) rotate3d(0, 1, 0, 90deg); opacity: 0; }
40% { transform: perspective(400px) rotate3d(0, 1, 0, -20deg); }
60% { transform: perspective(400px) rotate3d(0, 1, 0, 10deg); opacity: 1; }
80% { transform: perspective(400px) rotate3d(0, 1, 0, -5deg); }
to { transform: perspective(400px); opacity: 1; }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .uxd-icon-position-left,
    .uxd-icon-position-right {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .uxd-icon-position-left .uxd-info-box-content,
    .uxd-icon-position-right .uxd-info-box-content {
        margin: 20px 0 0 0;
    }
    
    .uxd-gallery-search {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .uxd-premium-upgrade-notice {
        padding: 30px 15px;
    }
    
    .uxd-premium-upgrade-notice h3 {
        font-size: 20px;
    }
    
    .uxd-premium-features {
        padding: 15px;
    }
    
    .uxd-upgrade-button {
        padding: 12px 25px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .uxd-lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .uxd-lightbox-close {
        top: -35px;
        font-size: 25px;
    }
}

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

/* Focus states */
.uxd-gallery-search:focus,
.uxd-upgrade-button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .uxd-hover-box,
    .uxd-hover-box-image img,
    .uxd-hover-box-content,
    .uxd-hover-box-overlay,
    .uxd-gallery-item,
    .uxd-gallery-item img,
    .uxd-gallery-overlay,
    .uxd-info-box,
    .uxd-info-box-icon,
    .uxd-upgrade-button {
        transition: none !important;
        animation: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .uxd-gallery-overlay,
    .uxd-hover-box-overlay,
    .uxd-hover-box-content {
        background: rgba(0,0,0,0.9);
    }
    
    .uxd-premium-upgrade-notice {
        border: 2px solid;
    }
}