* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    min-height: 100vh;
    padding: 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
}

.header-container {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
}

.logo-container {
    position: absolute;
    left: 0;
    top: 0;
}

.logo {
    height: 90px;
    width: auto;
}

h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2d3748;
    font-size: 2.2rem;
    font-weight: 600;
    width: 100%;
}

h2 {
    margin: 1.5rem 0;
    color: #4a5568;
    font-size: 1.5rem;
    font-weight: 500;
}

#current-folder {
    text-align: center;
    font-size: 1.2rem;
    color: #718096;
    margin: 1rem auto;
    max-width: 80%;
}

.search-container {
    display: flex;
    margin-bottom: 2rem;
    gap: 0.75rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

#search-input {
    flex: 1;
    min-width: 300px;
    padding: 0.875rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#search-button, #clear-button, #reload-button {
    padding: 0.875rem 1.5rem;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
    justify-content: center;
}

#search-button {
    background-color: #4299e1;
}

#clear-button {
    background-color: #e53e3e;
}

#reload-button {
    background-color: #38b2ac;
}

#search-button:hover {
    background-color: #3182ce;
}

#clear-button:hover {
    background-color: #c53030;
}

#reload-button:hover {
    background-color: #319795;
}

#search-button i, #clear-button i, #reload-button i {
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .search-container {
        flex-direction: column;
        align-items: stretch;
    }

    #search-input {
        min-width: 100%;
    }

    #search-button, #clear-button, #reload-button {
        width: 100%;
    }
}

#search-input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

.folders-list, .files-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.folder-item, .file-item {
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.folder-item:hover, .file-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.07);
    border-color: #4299e1;
}

.folder-icon, .file-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.folder-icon {
    color: #f6ad55;
}

/* Add styles for open folder icon */
.folder-icon.open i {
    color: #f6ad55; /* Slightly different color for open folders */
}

.file-icon {
    color: #4299e1;
}

.folder-name, .file-name {
    color: #2d3748;
    font-weight: 500;
    font-size: 1rem;
    word-break: break-word;
}

.back-button {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 5px 10px; /* Adjust the padding as needed */
        position: absolute;
        top: 10px;
        left: 10px;
        background-color: #3498db; /* azul */
        color: #ffffff; /* branco */
        line-height: 1.2;  /* Adjust the line-height if necessary */
        border-radius: 5px;
        text-decoration: none;
        font-weight: bold;
        transition: background-color 0.3s ease;
        }

        .back-button i {
        margin-right: 5px; /* Add some space between the icon and text */
        }

.file-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    width: 100%;
    flex-wrap: wrap; /* Added to allow buttons to wrap to next line if needed */
}

.file-actions button {
    flex: 1;
    min-width: 100px; /* Added minimum width */
    padding: 0.625rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.file-item {
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%; /* Ensure file items take full width of their grid cell */
    box-sizing: border-box;
}

.expanded-files-list .file-item {
    height: 100%;
    justify-content: space-between;
}

.file-name {
    color: #2d3748;
    font-weight: 500;
    font-size: 1rem;
    word-break: break-word;
    margin: 0.5rem 0;
    max-width: 100%; /* Ensure text doesn't overflow */
    overflow: hidden;
    text-overflow: ellipsis;
}

.view-btn {
    background-color: #4299e1;
    color: white;
}

.download-btn {
    background-color: #48bb78;
    color: white;
}

.view-btn:hover {
    background-color: #3182ce;
}

.download-btn:hover {
    background-color: #38a169;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: #718096;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .container {
        padding: 1.5rem;
    }

    .folders-list, .files-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .file-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .search-container {
        flex-direction: column;
    }

    #search-button {
        width: 100%;
    }

    #search-input {
        border-radius: 8px;
    }
}

.folder-counter {
    text-align: center;
    margin-top: 1.5rem;
    color: #718096;
    font-size: 0.9rem;
    font-weight: 500;
    width: 100%;
}


/* Add styles for the expanded files section */
.expanded-files {
    grid-column: 1 / -1;
    background-color: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    border: 1px solid #e2e8f0;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.expanded-files h3 {
    color: #2d3748;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-right: 30px;
}

.close-files-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #718096;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-files-btn:hover {
    background-color: #e2e8f0;
    color: #4a5568;
}

.expanded-files-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

body {
    background-color: #f8f9fa;
    background-image: url('./assets/img/backgroud.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    padding: 20px;
    color: #333;
    line-height: 1.6;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#reload-button i {
    transition: transform 0.3s ease;
}

#reload-button.spinning i {
    animation: spin 1s linear;
}

@keyframes zoom {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
    100% { transform: rotate(360deg); }
}

.zoom-effect {
    animation: zoom 0.5s ease;
}

.rotate-effect {
    animation: rotate 0.5s ease;
}

#search-button i, #clear-button i {
    display: inline-block;
}

