* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 50px;
    color: white;
    position: relative;
}

.title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.4rem;
    opacity: 0.9;
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.refresh-button {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.refresh-button:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
}

.pin-lock-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    color: white;
    text-align: center;
}

.lock-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.pin-lock-view h3 {
    font-size: 1.8rem;
    margin-bottom: 30px;
}

#pinForm {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 300px;
}

#pinInput {
    padding: 15px 20px;
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 1.5rem;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

#pinInput::placeholder {
    color: rgba(255,255,255,0.6);
}

#pinInput:focus {
    border-color: rgba(255,255,255,0.7);
    box-shadow: 0 0 15px rgba(255,255,255,0.3);
}

#pinForm button {
    padding: 15px 30px;
    background: linear-gradient(45deg, #4CAF50, #8BC34A);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

#pinForm button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.error-message {
    color: #FFEB3B;
    margin-top: 15px;
    font-size: 1.1rem;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.loading {
    text-align: center;
    color: white;
    padding: 80px 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255,255,255,0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

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

.folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding: 20px;
    justify-items: center;
}

.folder-item {
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: fadeInUp 0.6s ease;
}

.folder-item:hover {
    transform: translateY(-15px) scale(1.05);
}

.folder-thumbnail {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    border: 5px solid rgba(255,255,255,0.3);
    transition: all 0.4s ease;
    position: relative;
}

.folder-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(102,126,234,0.3), rgba(118,75,162,0.3));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

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

.folder-item:hover .folder-thumbnail {
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.6);
}

.folder-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.folder-item:hover .folder-thumbnail img {
    transform: scale(1.1);
}

.folder-name {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.folder-stats {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.folder-stats span {
    background: rgba(255,255,255,0.1);
    padding: 5px 12px;
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

.gallery-header {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
    gap: 20px;
}

.back-button {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.back-button:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: translateX(-5px);
}

.current-folder {
    color: white;
    font-size: 2.5rem;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.media-item {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    animation: fadeInUp 0.6s ease;
    position: relative;
}

.media-item:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}

.media-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(102,126,234,0.1), rgba(118,75,162,0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.media-item:hover::before {
    opacity: 1;
}

.media-item img,
.media-item video {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.media-item:hover img,
.media-item:hover video {
    transform: scale(1.05);
}

.stats {
    text-align: center;
    color: white;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.stats span {
    margin: 0 15px;
    padding: 12px 24px;
    background: rgba(255,255,255,0.15);
    border-radius: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    display: inline-block;
    transition: all 0.3s ease;
}

.stats span:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

.no-folders, .no-media {
    text-align: center;
    color: white;
    padding: 100px 20px;
}

.no-folders-icon, .no-media-icon {
    font-size: 5rem;
    margin-bottom: 25px;
    opacity: 0.7;
}

.no-folders h3, .no-media h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.no-folders p, .no-media p {
    opacity: 0.8;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.instructions {
    background: rgba(0,0,0,0.3);
    padding: 15px 25px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 20px;
}

.instructions code {
    color: #4CAF50;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: bold;
}

.audio-player {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    color: white;
    display: none;
}

.audio-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.audio-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.audio-time {
    color: #aaa;
}

.audio-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.audio-button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.audio-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.audio-button:active {
    transform: scale(0.95);
}

.audio-seekbar {
    margin: 10px 0;
}

.seek-slider {
    width: 100%;
    height: 4px;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
}

.seek-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    transition: all 0.1s ease;
}

.seek-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.audio-volume {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.volume-slider {
    flex-grow: 1;
    height: 4px;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    margin: 3% auto;
    width: 95%;
    max-width: 900px;
    text-align: center;
}

.close {
    position: absolute;
    top: -50px;
    right: 0;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
}

.close:hover {
    opacity: 0.7;
    transform: scale(1.1);
}

.modal-media img,
.modal-media video {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.modal-info {
    color: white;
    margin: 20px 0;
    font-size: 1.1rem;
}

.modal-navigation {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.nav-button {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.nav-button:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}

#toggleSlideshow.active {
    background: rgba(255, 0, 0, 0.3);
    border-color: rgba(255, 0, 0, 0.5);
}

#toggleSlideshow.active::after {
    content: ' ■';
    margin-left: 5px;
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }
    
    .folders-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 30px;
    }
    
    .folder-thumbnail {
        width: 150px;
        height: 150px;
    }
    
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .gallery-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .current-folder {
        font-size: 2rem;
    }
    
    .stats span {
        margin: 5px;
        padding: 10px 18px;
        font-size: 0.9rem;
        display: block;
        margin-bottom: 10px;
    }
    
    .modal-content {
        width: 98%;
        margin: 5% auto;
    }
    
    .modal-navigation {
        flex-direction: column;
        align-items: center;
    }
}

.hidden {
    display: none;
}
