.media-albums {
    padding: 50px 0;
}

.media-albums .tabs {
    list-style: none;
    padding: 0;
    display: flex;
    margin-bottom: 20px;
    justify-content: center !important;
}

.media-albums .tabs li {
    padding: 10px 20px;
    cursor: pointer;
    background: #f0f0f0;
    margin-right: 5px;
    border-radius: 30px;
    border: 1px solid #fff;
    color: #000;
    font-weight: bold;
    transition: all 0.3s ease;
}

.media-albums .tabs li.active {
    background: #F55505;
    border: 1px solid #F55505;
    color: #FFF;
    font-weight: bold;
}

.media-albums .tabs li.hovered {
    background: #e0e0e0;
}

.media-albums .filters {
    list-style: none;
    padding: 0;
    display: flex;
    margin-bottom: 50px;
    justify-content: center !important;
    flex-wrap: wrap;
}

.media-albums .filters li {
    padding: 5px 15px;
    cursor: pointer;
    background: #f0f0f0;
    margin-right: 5px;
    margin-bottom: 5px;
    border-radius: 30px;
    border: 1px solid #fff;
    color: #000;
    font-weight: bold;
    transition: all 0.3s ease;
}

.media-albums .filters li.active {
    background: #F55505;
    border: 1px solid #F55505;
    color: #FFF;
    font-weight: bold;
}

.media-albums .filters li.hovered {
    background: #e0e0e0;
}

/* Albums Grid */
.media-albums .albums-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.media-albums .album {
    position: relative;
    width: 100%;
    max-height: 380px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
    background: #10172E;
    transition: all 0.3s ease;
    cursor: pointer;
}

.media-albums .album.visible {
    opacity: 1;
    display: block;
}

.media-albums .album.hidden {
    opacity: 0;
    display: none;
}

.media-albums .album:hover,
.media-albums .album.hovered {
    transform: translateY(-5px);
    box-shadow: 0px 5px 20px rgba(0, 0, 0, 0.4);
}

.media-albums .album.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 4px solid #f3f3f3;
    border-top: 4px solid #F55505;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.media-albums .album h3 {
    font-size: 18px;
    color: #FFF;
    font-weight: bold;
    margin: 10px 0 20px;
    text-align: center;
    padding: 0 10px;
}

.media-albums .album .album-cover {
    position: relative;
    width: 100%;
    height: 320px;
    overflow: hidden;
}

.media-albums .album .album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.media-albums .album:hover .album-cover img {
    transform: scale(1.05);
}

.media-albums .album .album-cover .video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.media-albums .album .album-cover .video-play-overlay i {
    font-size: 50px;
    color: #F55505;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.media-albums .album .album-cover .album-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #FFC500;
    padding: 4px 12px;
    font-size: 10px;
    font-weight: 700;
    color: #000;
    border-radius: 30px;
    z-index: 2;
}

.media-albums .album .placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 320px;
    background: #f0f0f0;
    color: #666;
}

.media-albums .album .placeholder i {
    font-size: 48px;
}

/* Album Details View */
.media-albums .album-details-view {
    width: 100%;
}

.media-albums .album-details-view .album-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 20px 0;
}

.media-albums .album-details-view .album-header .back {
    margin-bottom: 0;
    padding: 10px 20px;
    background: #10172E;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    height: fit-content;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.media-albums .album-details-view .album-header .back:hover {
    background: #1a2340;
}

.media-albums .album-details-view .album-header h2 {
    font-size: 24px;
    color: #10172E;
    font-weight: 600;
    margin: 0;
}

/* Items Grid - Updated for 4 columns */
.media-albums .items-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.media-albums .items-grid .lightbox-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.media-albums .items-grid .lightbox-item:hover {
    transform: scale(1.02);
}

.media-albums .items-grid .lightbox-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* Video Items */
.media-albums .items-grid .video-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    transition: transform 0.3s ease;
    cursor: pointer;
    background: #000;
}

.media-albums .items-grid .video-item:hover {
    transform: scale(1.02);
}

.media-albums .items-grid .video-item .video-thumbnail {
    position: relative;
}

.media-albums .items-grid .video-item .video-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.media-albums .items-grid .video-item .video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.media-albums .items-grid .video-item .video-play-overlay i {
    font-size: 40px;
    color: #F55505;
    text-shadow: 0 0 10px rgba(0,0,0,0.8);
}

.media-albums .items-grid .video-item .video-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 20px 10px 10px;
    font-size: 12px;
    font-weight: bold;
}

/* Placeholders and Empty States */
.media-albums .image-placeholder,
.media-albums .placeholder {
    background: #f0f0f0;
    text-align: center;
    padding: 20px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.media-albums .no-albums,
.media-albums .no-images,
.media-albums .no-videos {
    text-align: center;
    color: #666;
    padding: 40px 20px;
    font-size: 16px;
}

/* View States */
.media-albums .albums-view {
    display: block;
}

.media-albums .album-details-view {
    display: none;
}

.media-albums .album-details-view.active {
    display: block;
}

.media-albums .albums-view.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .media-albums .albums-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .media-albums .items-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .media-albums .albums-grid {
        grid-template-columns: 1fr !important;
    }
    
    .media-albums .items-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .media-albums .album-details-view .album-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin: 40px 0 20px;
    }
    
    .media-albums .tabs {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .media-albums .tabs li {
        margin-bottom: 10px;
    }
    
    .media-albums .filters {
        justify-content: center;
    }
}

@media (max-width: 520px) {
    .media-albums .items-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    
    .media-albums .items-grid .lightbox-item img,
    .media-albums .items-grid .video-item .video-thumbnail img {
        height: 250px;
    }
    
    .media-albums .album {
        max-height: none;
    }
    
    .media-albums .album .album-cover {
        height: 250px;
    }
}

/* Loading States */
.media-albums .loading-state {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #666;
}

.media-albums .loading-state::after {
    content: '';
    border: 3px solid #f3f3f3;
    border-top: 3px solid #F55505;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

/* Error States */
.media-albums .error-state {
    text-align: center;
    color: #e74c3c;
    padding: 20px;
    background: #fdf2f2;
    border-radius: 5px;
    margin: 20px 0;
}

/* Accessibility */
.media-albums [tabindex="0"]:focus {
    outline: 2px solid #F55505;
    outline-offset: 2px;
}

.media-albums .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Animation Improvements */
.media-albums .tab-content {
    animation: fadeIn 0.3s ease-in-out;
}

.media-albums .album-details-view {
    animation: slideIn 0.3s ease-in-out;
}

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

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

/* Print Styles */
@media print {
    .media-albums .tabs,
    .media-albums .filters,
    .media-albums .back {
        display: none;
    }
    
    .media-albums .album-details-view {
        display: block !important;
    }
    
    .media-albums .albums-view {
        display: none;
    }
}