/* Driva Gallery Premium Styles */
.driva-gallery-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --dg-primary: #2563eb;
    --dg-primary-hover: #1d4ed8;
    --dg-bg: #ffffff;
    --dg-surface: #f8fafc;
    --dg-border: #e2e8f0;
    --dg-text: #0f172a;
    --dg-text-light: #64748b;
    --dg-radius: 16px;
    --dg-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --dg-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    margin: 2rem 0;
}

/* Reset buttons inside wrapper to prevent theme inheritance */
.driva-gallery-wrapper button, 
.driva-gallery-wrapper a {
    text-decoration: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.driva-back-wrap {
    margin-bottom: 2rem;
}

.driva-back-btn {
    display: inline-flex !important;
    align-items: center !important;
    background: var(--dg-surface) !important;
    color: var(--dg-text) !important;
    border: 1px solid var(--dg-border) !important;
    padding: 0.75rem 1.25rem !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.driva-back-btn:hover {
    background: var(--dg-text) !important;
    color: #fff !important;
    border-color: var(--dg-text) !important;
    transform: translateY(-2px);
}

.driva-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

/* Folder Premium Design */
.driva-folder-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--dg-border);
    border-radius: var(--dg-radius);
    padding: 2rem;
    text-align: center;
    text-decoration: none !important;
    color: var(--dg-text) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
}

.driva-folder-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(145deg, rgba(37, 99, 235, 0.05) 0%, rgba(37, 99, 235, 0) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.driva-folder-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--dg-shadow-hover);
    border-color: rgba(37, 99, 235, 0.3);
}

.driva-folder-item:hover::before {
    opacity: 1;
}

.driva-folder-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
    color: var(--dg-primary);
    transition: transform 0.4s ease;
}

.driva-folder-item:hover .driva-folder-icon {
    transform: scale(1.1);
}

.driva-folder-name {
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.4;
    position: relative;
    z-index: 1;
}

/* Media Item Premium Design */
.driva-item {
    position: relative;
    border-radius: var(--dg-radius);
    overflow: hidden;
    cursor: pointer;
    background: #e2e8f0;
    aspect-ratio: 1 / 1;
    box-shadow: var(--dg-shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.driva-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--dg-shadow-hover);
}

.driva-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.driva-item:hover img {
    transform: scale(1.08);
}

.driva-item .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50%;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    color: white;
    transition: all 0.4s ease;
    border: 1px solid rgba(255,255,255,0.2);
}

.driva-item:hover .play-icon {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(37, 99, 235, 0.8);
    border-color: rgba(255,255,255,0.4);
}

.driva-hover {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.8) 0%, rgba(15, 23, 42, 0.2) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1.5rem;
}

.driva-item:hover .driva-hover {
    opacity: 1;
}

.driva-dl-btn {
    background: rgba(255, 255, 255, 0.95) !important;
    color: var(--dg-text) !important;
    border: none !important;
    padding: 0.6rem 1.5rem !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    backdrop-filter: blur(4px);
    transform: translateY(10px);
    opacity: 0;
}

.driva-item:hover .driva-dl-btn {
    transform: translateY(0);
    opacity: 1;
}

.driva-dl-btn:hover {
    background: var(--dg-primary) !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4) !important;
}

/* Lightbox Premium Styles */
.driva-lightbox {
    display: none;
    position: fixed;
    z-index: 9999999;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.driva-lightbox.active {
    display: flex;
    opacity: 1;
}

.driva-lightbox-content {
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2rem;
    position: relative;
    z-index: 2;
}

.driva-lightbox-content img, 
.driva-lightbox-content video {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.driva-close {
    position: absolute;
    top: 2rem;
    right: 3rem;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    z-index: 1000000;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.1);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.driva-close:hover {
    color: #fff;
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.driva-lightbox-controls button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    color: #fff !important;
    width: 56px !important;
    height: 56px !important;
    cursor: pointer !important;
    border-radius: 50% !important;
    z-index: 1000000;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(4px);
    box-shadow: none !important;
}

.driva-lightbox-controls button:hover {
    background: rgba(255,255,255,0.2) !important;
    border-color: rgba(255,255,255,0.3) !important;
    transform: translateY(-50%) scale(1.1) !important;
}

#driva-prev { left: 3rem; }
#driva-next { right: 3rem; }

.driva-lightbox-toolbar {
    margin-top: 2rem;
    text-align: center;
    z-index: 1000000;
}

.driva-lightbox-toolbar .driva-btn {
    background: var(--dg-primary) !important;
    color: white !important;
    padding: 0.8rem 2rem !important;
    text-decoration: none !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    transition: all 0.3s ease !important;
    border: none !important;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.5) !important;
}

.driva-lightbox-toolbar .driva-btn:hover {
    background: var(--dg-primary-hover) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.6) !important;
}

@media (max-width: 768px) {
    .driva-gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
    #driva-prev { left: 1rem; width: 40px !important; height: 40px !important; }
    #driva-next { right: 1rem; width: 40px !important; height: 40px !important; }
    .driva-close { top: 1rem; right: 1rem; width: 40px; height: 40px; }
    .driva-lightbox-toolbar { margin-top: 1.5rem; }
}
