/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

:root {
    --background-color: white;
    --text-color: #000;
    --text-color-secondary: #444;
    --text-color-hover: #000;
    --border-color: #ddd;
    --theme-icon-color: #444;
    --theme-icon-active-color: #000;
    --sidebar-background: #fff;
    --sidebar-text: #333;
    --footer-text-color: #999; 
    --footer-icon-color: #666; 
    --hamburger-color: #333;
}

.dark-theme {
    --background-color: #121212;
    --text-color: #fff;
    --text-color-secondary: #aaa;
    --text-color-hover: #fff;
    --border-color: #333;
    --theme-icon-color: #ccc;
    --theme-icon-active-color: #fff;
    --sidebar-background: #121212;
    --sidebar-text: #fff;
    --footer-text-color: #888; 
    --footer-icon-color: #444; 
    --hamburger-color: #fff;
}

/* Estrutura principal da página */
body {
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: 200px; /* Mesmo valor da largura da sidebar */
    display: flex;
    flex-direction: column;
}

.content {
    margin-left: 200px;
    flex: 1;
    padding: 40px 20px;
    min-height: calc(100vh - 200px); /* Espaço para o footer */
}

/* Sidebar Styles */
.sidebar {
    width: 200px;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--sidebar-background);
    color: var(--sidebar-text);
    padding: 20px;
    box-sizing: border-box;
    z-index: 100;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 40px;
    text-decoration: none;
    color: var(--text-color);
}

.nav {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Navigation Links - All with exactly the same style */
.nav a {
    text-decoration: none;
    color: var(--text-color); /* Usar a cor principal do texto em vez da cor secundária */
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: normal;
    text-transform: none;
    transition: color 0.3s;
}

/* Hover and active states */
.nav a:hover, .nav a.active {
    color: var(--text-color-hover);
}

/* Theme Switcher */
.theme-switcher {
    display: flex;
    justify-content: center;
    margin-top: auto;
    padding-top: 30px;
}

/* Botão flutuante para controle de tema em dispositivos móveis */
.theme-toggle-button {
    display: none; /* Oculto por padrão, visível apenas em dispositivos móveis */
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    cursor: pointer;
    justify-content: center;
    align-items: center;
}

.theme-toggle-button svg {
    width: 24px;
    height: 24px;
    fill: var(--theme-icon-color);
}

.theme-icon {
    width: 24px;
    height: 24px;
    margin: 0 5px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.theme-icon svg {
    width: 100%;
    height: 100%;
    fill: var(--theme-icon-color);
}

.theme-icon.active {
    opacity: 1;
}

.theme-icon.active svg {
    fill: var(--theme-icon-active-color);
}

/* Estilos para o footer */
.footer {
    width: calc(100% - 200px);
    margin-left: 200px;
    padding: 25px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background-color: var(--background-color);
    position: relative;
    z-index: 10;
    bottom: 0;
    clear: both;
}

.social-icons {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.social-icon {
    display: inline-flex;
    margin: 0 12px;
    transition: opacity 0.3s ease;
}

.social-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--footer-icon-color);
    transition: fill 0.3s ease, opacity 0.3s ease;
}

.social-icon:hover svg {
    opacity: 0.7;
}

.copyright {
    font-size: 12px;
    color: var(--footer-text-color);
    margin-top: 8px;
}

/* Ajustes para o grid e o footer */
.grid {
    width: 100%;
    margin-bottom: 80px; /* Aumentar espaço antes do footer */
    position: relative; /* Adicionar posicionamento relativo à grade */
}

/* Adicionar um elemento vazio após a grade para garantir o espaço no rodapé */
.grid::after {
    content: "";
    display: block;
    clear: both;
    height: 10px; /* Altura do espaço no rodapé */
}

/* Grid Item Base Styles */
.grid-item {
    width: calc(25% - 12px); /* 4 columns with 12px gap */
    margin-bottom: 12px;
    float: left;
    position: relative; /* Garantir que os itens tenham posicionamento adequado */
    transform-style: preserve-3d;
    overflow: hidden;
    border-radius: 2px;
    z-index: 1; /* Definir z-index base para todos os itens */
}

/* Media Styles */
.grid-item img {
    max-width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.grid-item img:hover {
    opacity: 0.85;
}

.grid-item a {
    display: block;
    width: 100%;
    height: 100%;
}

/* Estilos para vídeos na homepage e na página de vídeos */
.video-container,
.video-grid-item {
    position: relative;
    z-index: 5;
    overflow: hidden;
    width: 100%;
    margin-bottom: 12px;
    box-sizing: border-box;
}

.video-container video,
.video-grid-item video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    background-color: var(--bg-color);
    max-width: 100%;
    max-height: none;
}

.video-item {
    position: relative;
    z-index: 5;
    transform-style: preserve-3d;
    transform: translateZ(0);
}

@media (min-width: 768px) {
    .video-grid-item {
        width: calc(50% - 6px);
    }
}

@media (min-width: 1200px) {
    .video-grid-item {
        width: calc(33.333% - 8px);
    }
}

/* Estilo para indicar que o vídeo é clicável */
.video-container {
    position: relative;
    cursor: pointer;
}

.video-container::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.video-container:hover::after {
    opacity: 0.7;
}

.video-container.click-to-play::after {
    opacity: 0.7;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 30px;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .grid-item {
        width: calc(25% - 12px); /* Maintain 4 columns */
    }
}

@media (max-width: 900px) {
    .grid-item {
        width: calc(33.333% - 12px); /* 3 columns */
    }
}

@media (max-width: 600px) {
    .grid-item {
        width: calc(100% - 8px); /* 1 column com menos margem */
        margin: 4px; /* Reduzir margem para aproveitar mais espaço */
    }
    
    .sidebar {
        width: 100px; /* Reduzir a largura da sidebar */
        padding-bottom: 100px; /* Manter o padding inferior */
        font-size: 14px; /* Reduzir tamanho da fonte */
    }
    
    .main-content {
        margin-left: 100px; /* Mesmo valor da largura da sidebar em telas pequenas */
    }
    
    .content {
        margin-left: 100px; /* Ajustar margem para corresponder à nova largura da sidebar */
        width: calc(100% - 100px); /* Garantir que o conteúdo ocupe todo o espaço disponível */
    }
    
    .footer {
        width: calc(100% - 100px);
        margin-left: 100px;
        padding: 15px 0;
    }
    
    .social-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .social-icon {
        margin: 0 8px;
    }
    
    .copyright {
        font-size: 11px;
    }
    
    /* Ajustes para o logo e navegação */
    .logo {
        font-size: 16px; /* Reduzir tamanho do logo */
        margin-bottom: 15px;
    }
    
    .nav a {
        margin-bottom: 8px; /* Reduzir espaçamento entre links */
    }
    
    /* Ocultar o seletor de tema na barra lateral em dispositivos móveis */
    .theme-switcher {
        display: none;
    }
    
    /* Mostrar o botão flutuante em dispositivos móveis */
    .theme-toggle-button {
        display: flex;
    }
}

/* Ajuste específico para dispositivos muito pequenos */
@media (max-height: 600px) {
    .theme-switcher {
        bottom: 30px; /* Aumentar a distância da parte inferior */
    }
}

/* Hamburger Menu - Mobile Only */
.hamburger-menu {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 1001;
    padding: 5px;
}

.hamburger-icon {
    position: relative;
    width: 100%;
    height: 2px;
    background-color: var(--hamburger-color);
    transition: background-color 0.3s;
}

.hamburger-icon:before,
.hamburger-icon:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--hamburger-color);
    transition: transform 0.3s;
}

.hamburger-icon:before {
    top: -8px;
}

.hamburger-icon:after {
    top: 8px;
}

/* Animação do ícone do menu quando aberto */
.hamburger-menu.open .hamburger-icon {
    background-color: transparent;
}

.hamburger-menu.open .hamburger-icon:before {
    transform: translateY(8px) rotate(45deg);
}

.hamburger-menu.open .hamburger-icon:after {
    transform: translateY(-8px) rotate(-45deg);
}

/* Estilos para o overlay do menu mobile */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
}

.mobile-menu-overlay.open {
    opacity: 1;
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
}

.mobile-menu-content .logo {
    margin-bottom: 40px;
    font-size: 24px;
}

.mobile-menu-content .nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.mobile-menu-content .nav a {
    margin: 15px 0;
    font-size: 18px;
    text-align: center;
}

.mobile-menu-content .theme-switcher {
    display: flex;
    margin-top: 40px;
}

/* Título fixo no topo para versão mobile */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background-color: var(--background-color);
    z-index: 999;
    text-align: center;
    line-height: 50px;
    font-size: 20px;
    font-weight: bold;
    color: var(--text-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.mobile-header span {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-color);
}

/* Media Queries para Mobile */
@media (max-width: 600px) {
    .sidebar {
        display: none; /* Esconder a sidebar em dispositivos móveis */
    }
    
    .hamburger-menu {
        display: block; /* Mostrar o menu hambúrguer */
    }
    
    .mobile-header {
        display: block; /* Mostrar o título fixo no topo */
    }
    
    .main-content, 
    .content,
    .footer {
        margin-left: 0; /* Remover margem esquerda para ocupar toda a largura */
        width: 100%;
    }
    
    /* Adicionar padding-top para o conteúdo não ficar embaixo do header fixo */
    .main-content {
        padding-top: 50px;
    }
    
    .grid-item {
        width: calc(100% - 8px); /* 1 column com menos margem */
        margin: 4px; /* Reduzir margem para aproveitar mais espaço */
    }
    
    /* Ajustar posição do botão de tema para não sobrepor o menu */
    .theme-toggle-button {
        bottom: 20px;
        left: 20px;
    }
    
    /* Ajustar posição do botão de voltar ao topo */
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
    }
}

/* About and Contact Page Styles */
.about-content h1, .contact-content h1 {
    margin-bottom: 30px;
    font-weight: 300;
    color: var(--text-color-secondary);
}

.about-content p {
    margin-bottom: 20px;
    color: #888;
}

/* Contact Form Styles */
.contact-form {
    margin-top: 40px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-color-secondary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    font-size: 16px;
    background-color: var(--background-color);
    color: var(--text-color-secondary);
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

button {
    background-color: var(--text-color);
    color: var(--background-color);
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    opacity: 0.9;
}

.contact-info {
    margin-top: 50px;
}

.contact-info p {
    margin-bottom: 10px;
    color: #888;
}

/* Estilos para o visualizador de imagens - versão corrigida */
.viewer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 0;
}

.viewer-container {
    position: relative;
    width: 80%;
    height: 80%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.viewer-item {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.viewer-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.viewer-item .video-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.viewer-item .video-container video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.viewer-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    z-index: 100;
}

/* Estilos para os ícones pixel art */
.pixel-art-icon {
    image-rendering: pixelated;
    shape-rendering: crispEdges;
}

.nav-arrow {
    background: transparent;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin: 0 20px;
    z-index: 200;
    padding: 0;
}

.nav-arrow svg {
    width: 32px;
    height: 32px;
    fill: rgba(0, 0, 0, 1);
    stroke: rgba(255, 255, 255, 0.5);
    stroke-width: 0.5px;
}

.close-button {
    position: absolute;
    top: 5px;
    right: 20px;
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 200;
    padding: 0;
}

.close-button svg {
    width: 28px;
    height: 28px;
    fill: rgba(0, 0, 0, 1);
    stroke: rgba(255, 255, 255, 0.5);
    stroke-width: 0.5px;
}

/* Sobrescrever estilos de botão para os botões de navegação */
.nav-arrow,
.close-button {
    background-color: transparent;
    padding: 0;
    transition: none;
}

.nav-arrow:hover,
.close-button:hover {
    opacity: 1;
}

.dark-mode .nav-arrow svg,
.dark-mode .close-button svg {
    fill: rgba(255, 255, 255, 0.9);
    stroke: rgba(0, 0, 0, 0.5);
    stroke-width: 0.5px;
}

/* Ajuste para cursor pointer em elementos clicáveis */
.grid-item img, 
.nav a, 
.logo, 
.social-icon,
.theme-icon,
.theme-toggle-button,
.grid-item a {
    cursor: pointer;
}

/* Estilos para links de vídeo */
.video-link {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.video-link video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Ajuste para o container de vídeo no viewer */
#filto-video-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#filto-video-player {
    max-width: 90%;
    max-height: 80vh;
    cursor: pointer;
}

/* Botão Scroll to Top */
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    text-decoration: none;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top svg {
    width: 18px;
    height: 18px;
    fill: var(--text-color);
}

.scroll-to-top:hover {
    transform: translateY(-3px);
}