/**
 * 3D Gallery Pro - Frontend Styles
 */

.tdg-gallery-container {
    position: relative;
    width: 100%;
    height: 600px;
    background: #000;
    overflow: hidden;
    border-radius: 8px;
}

.tdg-gallery-canvas {
    width: 100%;
    height: 100%;
}

.tdg-gallery-canvas canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Overlay with Controls and Info */
.tdg-gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.6s ease-out;
}

/* Controls Box - Bottom Left */
.tdg-gallery-controls {
    position: absolute;
    bottom: 30px;
    left: 30px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 20px 24px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tdg-controls-inner p {
    margin: 6px 0;
}

.tdg-controls-inner p:first-child {
    margin-top: 0;
    font-size: 15px;
    margin-bottom: 10px;
}

.tdg-controls-inner p:last-child {
    margin-bottom: 0;
}

/* Info Box - Top Left */
.tdg-gallery-info {
    position: absolute;
    top: 30px;
    left: 30px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 20px 24px;
    border-radius: 12px;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tdg-gallery-info h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.tdg-gallery-info p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
}

/* Action Buttons - Top Right */
.tdg-gallery-buttons {
    position: absolute;
    top: 30px;
    right: 30px;
    display: flex;
    gap: 12px;
    z-index: 20;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.tdg-gallery-container:hover .tdg-gallery-buttons {
    opacity: 1;
}

.tdg-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: #333;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.tdg-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.tdg-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tdg-btn svg {
    width: 20px;
    height: 20px;
}

/* Fullscreen adjustments */
.tdg-gallery-container:fullscreen {
    height: 100vh;
    border-radius: 0;
}

.tdg-gallery-container:fullscreen .tdg-gallery-buttons {
    top: 20px;
    right: 20px;
}

.tdg-gallery-container:fullscreen .tdg-gallery-controls {
    bottom: 20px;
    left: 20px;
}

.tdg-gallery-container:fullscreen .tdg-gallery-info {
    top: 20px;
    left: 20px;
}

/* Loading state */
.tdg-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 16px;
}

.tdg-loading::after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 20px auto 0;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tdg-spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .tdg-gallery-container {
        height: 400px;
    }
    
    .tdg-gallery-controls,
    .tdg-gallery-info {
        bottom: 15px;
        left: 15px;
        right: 15px;
        top: auto;
        padding: 15px 18px;
        font-size: 13px;
        max-width: none;
    }
    
    .tdg-gallery-info {
        position: static;
        margin-bottom: 10px;
    }
    
    .tdg-gallery-buttons {
        top: 15px;
        right: 15px;
        gap: 8px;
    }
    
    .tdg-btn {
        width: 42px;
        height: 42px;
    }
    
    .tdg-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* Webkit fullscreen */
.tdg-gallery-container:-webkit-full-screen {
    height: 100vh;
    border-radius: 0;
}

/* Firefox fullscreen */
.tdg-gallery-container:-moz-full-screen {
    height: 100vh;
    border-radius: 0;
}

/* MS fullscreen */
.tdg-gallery-container:-ms-fullscreen {
    height: 100vh;
    border-radius: 0;
}

/* Fullscreen Image Modal */
.tdg-fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: tdg-fadeIn 0.3s ease;
}

.tdg-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.tdg-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    animation: tdg-scaleIn 0.3s ease;
}

.tdg-modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 60px rgba(0, 0, 0, 0.8);
}

.tdg-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tdg-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.tdg-modal-info {
    margin-top: 20px;
    padding: 20px 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    text-align: center;
    max-width: 600px;
}

.tdg-modal-info h3 {
    margin: 0 0 10px 0;
    color: #fff;
    font-size: 24px;
    font-weight: 600;
}

.tdg-modal-info p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    line-height: 1.6;
}

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

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

/* Mobile adjustments for modal */
@media (max-width: 768px) {
    .tdg-modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    .tdg-modal-image {
        max-height: 70vh;
    }

    .tdg-modal-close {
        top: -45px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .tdg-modal-info {
        margin-top: 15px;
        padding: 15px 20px;
    }

    .tdg-modal-info h3 {
        font-size: 20px;
    }

    .tdg-modal-info p {
        font-size: 14px;
    }
}
