/*--------------------------------------------------------------
# Wallpaper Selector - Video Call Background Changer
--------------------------------------------------------------*/

/* Wallpaper Button in Bottom Bar */
#wallpaperBtn {
    position: relative;
}

/* Wallpaper Selector Panel */
.wallpaper-selector {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 20px;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    max-width: 90vw;
    width: 480px;
}

.wallpaper-selector.active {
    display: block;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Header */
.wallpaper-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.wallpaper-selector-header h3 {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wallpaper-selector-header h3 i {
    color: #66beff;
}

.wallpaper-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wallpaper-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Wallpaper Grid */
.wallpaper-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.wallpaper-option {
    aspect-ratio: 16/9;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    overflow: hidden;
    position: relative;
    background-size: cover;
    background-position: center;
}

.wallpaper-option:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.wallpaper-option.selected {
    border-color: #66beff;
    box-shadow: 0 0 0 2px rgba(102, 190, 255, 0.3);
}

.wallpaper-option.none-bg {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wallpaper-option.none-bg::after {
    content: 'None';
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    font-weight: 500;
}

/* Default Wallpapers */
.wallpaper-option[data-wallpaper="gradient-1"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.wallpaper-option[data-wallpaper="gradient-2"] {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.wallpaper-option[data-wallpaper="gradient-3"] {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.wallpaper-option[data-wallpaper="gradient-4"] {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.wallpaper-option[data-wallpaper="gradient-5"] {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.wallpaper-option[data-wallpaper="gradient-6"] {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
}

.wallpaper-option[data-wallpaper="gradient-7"] {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.wallpaper-option[data-wallpaper="gradient-8"] {
    background: linear-gradient(135deg, #2c3e50 0%, #4ca1af 100%);
}

.wallpaper-option[data-wallpaper="gradient-9"] {
    background: linear-gradient(135deg, #232526 0%, #414345 100%);
}

.wallpaper-option[data-wallpaper="gradient-10"] {
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
}

/* Upload Section */
.wallpaper-upload-section {
    display: flex;
    gap: 10px;
    align-items: center;
}

.wallpaper-upload-btn {
    flex: 1;
    background: rgba(102, 190, 255, 0.15);
    border: 1px dashed rgba(102, 190, 255, 0.5);
    color: #66beff;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}

.wallpaper-upload-btn:hover {
    background: rgba(102, 190, 255, 0.25);
    border-color: #66beff;
}

.wallpaper-upload-btn i {
    font-size: 16px;
}

#wallpaperFileInput {
    display: none;
}

/* Reset Button */
.wallpaper-reset-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wallpaper-reset-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Custom Wallpapers Row */
.custom-wallpapers-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-wallpapers-section h4 {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 500;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-wallpapers-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.custom-wallpaper-item {
    width: 60px;
    height: 34px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    overflow: hidden;
    position: relative;
    background-size: cover;
    background-position: center;
}

.custom-wallpaper-item:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.custom-wallpaper-item.selected {
    border-color: #66beff;
}

.custom-wallpaper-item .delete-custom-wp {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: rgba(255, 0, 0, 0.8);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 10px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-wallpaper-item:hover .delete-custom-wp {
    opacity: 1;
}

/* Video Background Layer - sits above body bg but below video grid */
#videoBackground {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background 0.5s ease;
    pointer-events: none; /* Allow clicks to pass through */
}

/* Mobile Responsive */
@media screen and (max-width: 640px) {
    .wallpaper-selector {
        width: calc(100vw - 32px);
        bottom: 80px;
        padding: 16px;
    }
    
    .wallpaper-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .wallpaper-upload-section {
        flex-direction: column;
    }
    
    .wallpaper-upload-btn,
    .wallpaper-reset-btn {
        width: 100%;
        justify-content: center;
    }
}

@media screen and (max-width: 400px) {
    .wallpaper-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
