/* Base Styles */
:root {
    --primary-color: #4a6cf7;
    --secondary-color: #6c757d;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --border-color: #dee2e6;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f5f7fb;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    font-family: inherit;
}

/* Header and Navigation */
header {
    background-color: white;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0;
}

.logo p {
    font-size: 0.8rem;
    color: var(--secondary-color);
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links li {
    padding: 0 1rem;
}

.nav-links a {
    color: var(--dark-color);
    font-weight: 500;
    position: relative;
    padding-bottom: 5px;
}

.nav-links a.active,
.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a.active::after,
.nav-links a:hover::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    bottom: 0;
    left: 0;
}

.login-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 5px;
    font-weight: 500;
    transition: var(--transition);
}

.login-btn:hover {
    background-color: #3955d1;
    transform: translateY(-2px);
}

.burger {
    display: none;
    cursor: pointer;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: var(--dark-color);
    margin: 5px;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    background: linear-gradient(to right, #4776E6, #8E54E9);
    color: white;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.hero-content {
    max-width: 800px;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.primary-btn {
    background-color: white;
    color: var(--primary-color);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 5px;
    font-weight: 600;
    transition: var(--transition);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.secondary-btn {
    background-color: transparent;
    color: white;
    border: 2px solid white;
    padding: 0.75rem 2rem;
    border-radius: 5px;
    font-weight: 600;
    transition: var(--transition);
}

.secondary-btn:hover {
    background-color: white;
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Section Styles */
section {
    padding: 5rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

section h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
    color: var(--dark-color);
    position: relative;
}

section h2::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

/* Gallery Section */
.gallery-section {
    background-color: white;
}

.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.tab-btn {
    padding: 0.5rem 2rem;
    background-color: #f1f3f5;
    border: none;
    border-radius: 5px;
    margin: 0 0.5rem;
    font-weight: 500;
    transition: var(--transition);
}

.tab-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

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

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.1);
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 1rem;
    transition: var(--transition);
}

.item-overlay h3 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-overlay p {
    font-size: 0.8rem;
    opacity: 0.8;
}

.video-item .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.2);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    opacity: 0.8;
}

.video-item:hover .play-button {
    background-color: var(--primary-color);
    opacity: 1;
}

.play-button i {
    color: white;
    font-size: 1.5rem;
}

.audio-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.audio-item {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--box-shadow);
}

.audio-info h3 {
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.audio-info p {
    font-size: 0.8rem;
    color: var(--secondary-color);
}

audio {
    width: 250px;
}

/* Browser Section */
.browser-section {
    background-color: #f5f7fb;
}

.browser-container {
    display: flex;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.browser-sidebar {
    width: 200px;
    background-color: #f8f9fa;
    padding: 1rem 0;
    border-right: 1px solid var(--border-color);
}

.browser-sidebar ul li {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.browser-sidebar ul li i {
    margin-right: 0.5rem;
    color: var(--secondary-color);
}

.browser-sidebar ul li.active {
    background-color: rgba(74, 108, 247, 0.1);
    border-left: 3px solid var(--primary-color);
}

.browser-sidebar ul li.active i {
    color: var(--primary-color);
}

.browser-sidebar ul li:hover {
    background-color: rgba(74, 108, 247, 0.05);
}

.browser-content {
    flex: 1;
    padding: 1.5rem;
}

.browser-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.path-navigation {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.current-folder {
    color: var(--dark-color);
    font-weight: 500;
}

.browser-search {
    display: flex;
}

.browser-search input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 5px 0 0 5px;
    outline: none;
}

.browser-search button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 5px 5px 0;
    padding: 0.5rem 1rem;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 5px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.file-item:hover {
    background-color: #f8f9fa;
    border-color: var(--border-color);
}

.file-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background-color: #e9ecef;
    margin-right: 1rem;
}

.file-icon i {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.file-info {
    flex: 1;
    min-width: 0; /* Critical for text truncation */
    margin-right: 10px; /* Ensure space for buttons */
    overflow: hidden;
}

.file-info h4 {
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.file-info p {
    font-size: 0.8rem;
    color: var(--secondary-color);
}

.file-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0; /* Prevent buttons from shrinking */
}

.file-actions button {
    background-color: transparent;
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.file-actions button:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* About Section */
.about-section {
    background-color: white;
}

.about-content {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.about-text {
    flex: 2;
}

.about-text p {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

.about-text h3 {
    margin-bottom: 1rem;
}

.about-text ul {
    margin-left: 1.5rem;
    list-style: disc;
}

.about-text ul li {
    margin-bottom: 0.5rem;
}

.stats-container {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
}

.stat-box {
    background-color: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.1);
}

.stat-box h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Documentation Section */
.docs-section {
    background-color: #f5f7fb;
}

.docs-container {
    display: flex;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.docs-sidebar {
    width: 200px;
    background-color: #f8f9fa;
    padding: 1.5rem 0;
    border-right: 1px solid var(--border-color);
}

.docs-sidebar ul li {
    padding: 0.75rem 1.5rem;
}

.docs-sidebar ul li a {
    color: var(--dark-color);
    display: block;
    transition: var(--transition);
}

.docs-sidebar ul li.active a {
    color: var(--primary-color);
    font-weight: 500;
}

.docs-sidebar ul li a:hover {
    color: var(--primary-color);
}

.docs-content {
    flex: 1;
    padding: 2rem;
}

.docs-page {
    display: none;
}

.docs-page.active {
    display: block;
}

.docs-page h3 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.docs-page p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.docs-page h4 {
    margin: 1.5rem 0 1rem;
}

.docs-page ul {
    margin-left: 1.5rem;
    list-style: disc;
    margin-bottom: 1.5rem;
}

.docs-page li {
    margin-bottom: 0.5rem;
}

.code-block {
    background-color: #f8f9fa;
    border-radius: 5px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.code-block code {
    font-family: 'Courier New', monospace;
    color: var(--dark-color);
}

/* Footer */
footer {
    background-color: #2d3748;
    color: white;
    padding-top: 3rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
}

.footer-logo h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    gap: 3rem;
}

.footer-col h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 2px;
    background-color: var(--primary-color);
    bottom: -8px;
    left: 0;
}

.footer-col ul li {
    margin-bottom: 0.75rem;
}

.footer-col ul li a {
    color: #cbd5e0;
    transition: var(--transition);
}

.footer-col ul li a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid #4a5568;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.preview-content {
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

/* Error message styles */
.error-message {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    margin: 2rem auto;
    max-width: 600px;
    box-shadow: var(--box-shadow);
}

.error-message h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.error-message code {
    display: block;
    background-color: #f1f3f5;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--secondary-color);
}

.empty-folder {
    text-align: center;
    padding: 2rem;
    color: var(--secondary-color);
    background-color: #f8f9fa;
    border-radius: 5px;
}

.empty-gallery {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--secondary-color);
    background-color: #f8f9fa;
    border-radius: 5px;
}

/* Media Queries */
@media screen and (max-width: 768px) {
    .nav-links {
        position: absolute;
        right: 0;
        height: 92vh;
        top: 8vh;
        background-color: white;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 50%;
        transform: translateX(100%);
        transition: transform 0.5s ease-in;
        box-shadow: -5px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .nav-links li {
        opacity: 0;
        margin: 1rem 0;
    }
    
    .burger {
        display: block;
    }
    
    .nav-active {
        transform: translateX(0%);
    }
    
    .about-content {
        flex-direction: column;
    }
    
    .stats-container {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }
    
    .footer-links {
        flex-wrap: wrap;
        gap: 2rem;
    }
    
    .browser-container, .docs-container {
        flex-direction: column;
    }
    
    .browser-sidebar, .docs-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .audio-item {
        flex-direction: column;
        align-items: flex-start;
    }

    audio {
        width: 100%;
        margin-top: 1rem;
    }
}

@media screen and (max-width: 576px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .stats-container {
        grid-template-columns: repeat(1, 1fr);
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .browser-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .browser-search {
        width: 100%;
        margin-top: 1rem;
    }

    .browser-search input {
        flex: 1;
    }

    .file-item {
        flex-wrap: wrap;
    }

    .file-actions {
        width: 100%;
        margin-top: 1rem;
        justify-content: flex-end;
    }
}

/* Animations */
@keyframes navLinkFade {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0px);
    }
}

.toggle .line1 {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.toggle .line2 {
    opacity: 0;
}

.toggle .line3 {
    transform: rotate(45deg) translate(-5px, -6px);
}
