/* Estilos Gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: linear-gradient(to right, #2c3e50, #4ca1af);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    flex: 1;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.logo-link {
    text-decoration: none;
    color: white;
    transition: opacity 0.3s ease;
}

.logo-link:hover {
    opacity: 0.9;
}

.navigation {
    flex: 2;
    text-align: center;
}

.navigation ul {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.navigation li {
    margin-left: 1.5rem;
}

.navigation a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
}

.navigation a:hover, 
.navigation a.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.navigation a[data-key="nav-home"] {
    display: flex;
    align-items: center;
    gap: 5px;
}

.navigation a[data-key="nav-home"]::before {
    content: "\f015";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

.navigation a[data-key="nav-about"] {
    display: flex;
    align-items: center;
    gap: 5px;
}

.navigation a[data-key="nav-about"]::before {
    content: "\f05a";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

.navigation a[data-key="nav-contact"] {
    display: flex;
    align-items: center;
    gap: 5px;
}

.navigation a[data-key="nav-contact"]::before {
    content: "\f0e0";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

.language-selector {
    flex: 1;
    text-align: right;
}

.language-selector select {
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.language-selector select:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.language-selector option {
    background-color: #2c3e50;
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr;
    grid-gap: 2rem;
}

/* Editor Panels */
.editors-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Forçar 3 colunas sempre */
    gap: 1.5rem;
    min-width: 95%; /* Aumentar a largura para ocupar mais espaço */
}

.editor-panel {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%; /* Garantir largura total dentro do grid */
}

.editor-panel h2 {
    background-color: #2c3e50;
    color: white;
    padding: 0.8rem;
    margin: 0;
    font-size: 1.2rem;
    text-align: center;
}

.code-editor {
    height: 400px; /* Altura fixa para todos os editores */
    border: 1px solid #ddd;
    overflow: auto; /* Adicionar barra de rolagem quando necessário */
}

/* CodeMirror Customization */
.CodeMirror {
    height: 400px !important; /* Forçar altura fixa no CodeMirror */
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
}

/* Control Buttons */
.control-btn {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 0.6rem;
    cursor: pointer;
    width: 100%;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.control-btn:hover {
    background-color: #d32f2f;
}

.control-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.action-btn {
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background-color: #1a2530;
}

/* Preview Container */
.preview-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.preview-container h2 {
    background-color: #2c3e50;
    color: white;
    padding: 0.8rem;
    margin: 0;
    font-size: 1.2rem;
    text-align: center;
}

#preview-frame {
    padding: 1rem;
    height: 400px;
}

#preview {
    width: 100%;
    height: 100%;
    border: 1px solid #ddd;
    background-color: white;
}

/* History Container */
.history-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.history-container h2 {
    background-color: #2c3e50;
    color: white;
    padding: 0.8rem;
    margin: 0;
    font-size: 1.2rem;
    text-align: center;
}

.history-list {
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    padding: 0.8rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item:hover {
    background-color: #f5f5f5;
}

.history-item-time {
    font-weight: bold;
}

.history-item-delete {
    background: none;
    border: none;
    color: #f44336;
    cursor: pointer;
    font-size: 1.1rem;
}

.history-item-delete:hover {
    color: #d32f2f;
}

/* Footer */
.footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: auto;
}

/* Loading Spinner */
.loading-spinner-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    display: none;
}

.loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
}

.loading-spinner-container p {
    color: white;
    margin-top: 1rem;
    font-size: 1.2rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .editors-container {
        grid-template-columns: repeat(3, 1fr); /* Manter 3 colunas mesmo em telas menores */
    }
}

@media (max-width: 992px) {
    .editors-container {
        grid-template-columns: 1fr; /* Quando ficar muito apertado, empilhar */
    }
}

@media (max-width: 768px) {
    .header {
        position: relative;
        flex-wrap: wrap;
        justify-content: space-between;
        padding: 1rem;
    }
    
    .logo {
        flex: 0 0 auto;
        margin-right: auto;
    }
    
    .hamburger-menu {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 10;
        margin-left: 1rem;
        order: 3;
    }
    
    .hamburger-menu span {
        width: 100%;
        height: 3px;
        background-color: white;
        border-radius: 3px;
        transition: all 0.3s ease;
    }
    
    .hamburger-menu.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    
    .hamburger-menu.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger-menu.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
    
    .language-selector {
        flex: 0 0 auto;
        order: 2;
        margin-left: auto;
    }
    
    .navigation {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(to right, #2c3e50, #4ca1af);
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        transform: translateY(-150%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
        z-index: 999;
        order: 4;
        width: 100%;
    }
    
    .navigation.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .navigation ul {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 0;
        margin: 0;
    }
    
    .navigation li {
        margin: 0;
        width: 100%;
        text-align: center;
        list-style: none;
    }
    
    .navigation a {
        display: block;
        padding: 0.8rem;
        width: 100%;
    }
    
    /* Cabeçalho flutuante */
    .floating-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: linear-gradient(to right, #2c3e50, #4ca1af);
        color: white;
        padding: 0.8rem 1rem;
        z-index: 1000;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
        display: flex;
        justify-content: space-between;
        align-items: center;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .floating-header.visible {
        transform: translateY(0);
    }
    
    .floating-header .logo h1 {
        font-size: 1.4rem;
    }
    
    .floating-header .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
    }
    
    .floating-header .menu-toggle span {
        width: 100%;
        height: 2px;
        background-color: white;
        border-radius: 2px;
        transition: all 0.3s ease;
    }
}

@media (min-width: 1200px) {
    .main-content {
        max-width: 1400px; /* Aumentado para permitir mais espaço */
        margin: 0 auto;
    }
}

/* Estilos para as páginas Sobre e Contato */
.page-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.page-content h1 {
    color: #2c3e50;
    margin-bottom: 2rem;
    text-align: center;
    font-size: 2.2rem;
}

/* Estilos para a página Sobre */
.about-section {
    margin-bottom: 3rem;
}

.about-section h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.6rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.about-section p {
    line-height: 1.8;
    margin-bottom: 1rem;
}

.features-list {
    list-style-type: none;
    padding: 0;
}

.features-list li {
    padding: 0.8rem 0;
    border-bottom: 1px solid #eee;
    position: relative;
    padding-left: 2rem;
}

.features-list li:before {
    content: "\f00c";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: #3498db;
    position: absolute;
    left: 0;
}

.audience-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.audience-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.audience-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.audience-card i {
    font-size: 2.5rem;
    color: #3498db;
    margin-bottom: 1rem;
}

.audience-card h3 {
    color: #2c3e50;
    margin-bottom: 0.8rem;
}

.how-to-list {
    padding-left: 1.5rem;
    margin-top: 1rem;
}

.how-to-list li {
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.2rem;
    width: 100px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tech-item i {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
    color: #3498db;
}

/* Estilos para a página Contato */
.contact-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}

.contact-section {
    margin-bottom: 2rem;
}

.contact-section h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.6rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.contact-direct {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin: 2rem 0;
}

.contact-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-decoration: none;
    width: 100%;
    max-width: 300px;
}

.contact-button:hover {
    background-color: #2980b9;
}

.contact-button.instagram {
    background-color: #e1306c;
}

.contact-button.instagram:hover {
    background-color: #c13584;
}

.contact-button i {
    font-size: 1.5rem;
}

.faq-container {
    margin-top: 1.5rem;
}

.faq-item {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1.5rem;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h3 {
    color: #2c3e50;
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

.faq-item p {
    line-height: 1.6;
}

@media (max-width: 768px) {
    .contact-container {
        flex-direction: column;
    }
    
    .contact-direct {
        width: 100%;
    }
}

/* Estilos para o indicador de status da conexão */
.connection-status-container {
    margin-left: 1rem;
    display: flex;
    align-items: center;
}

#connection-status {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-online {
    background-color: #4CAF50;
    color: white;
}

.status-offline {
    background-color: #F44336;
    color: white;
}

/* Estilos para notificações */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    max-width: 350px;
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.notification-visible {
    transform: translateY(0);
    opacity: 1;
}

.notification-hiding {
    transform: translateY(100px);
    opacity: 0;
}

.notification-icon {
    margin-right: 1rem;
    font-size: 1.5rem;
}

.notification-success .notification-icon {
    color: #4CAF50;
}

.notification-warning .notification-icon {
    color: #FF9800;
}

.notification-info .notification-icon {
    color: #2196F3;
}

.notification-content {
    flex: 1;
}

.notification-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.notification-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.notification-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.3rem;
    margin-left: 0.5rem;
    font-size: 0.9rem;
}

.notification-close:hover {
    color: #333;
}

/* Botão de instalação */
.install-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-left: 1rem;
}

.install-button:hover {
    background-color: #45a049;
}

.install-button i {
    font-size: 1rem;
}

/* Banner de instalação PWA */
.install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 9998;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.install-banner-visible {
    transform: translateY(0);
}

.install-banner-hiding {
    transform: translateY(100%);
}

.install-banner-content {
    display: flex;
    align-items: center;
    flex: 1;
}

.install-banner-icon {
    margin-right: 16px;
}

.install-banner-icon img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
}

.install-banner-text {
    flex: 1;
}

.install-banner-text h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.install-banner-text p {
    margin: 4px 0 0 0;
    font-size: 14px;
    color: #666;
}

.install-banner-buttons {
    display: flex;
    gap: 8px;
    margin-left: 16px;
}

.install-banner-install {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.install-banner-install:hover {
    background-color: #45a049;
}

.install-banner-dismiss {
    background-color: transparent;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.install-banner-dismiss:hover {
    background-color: #f5f5f5;
}

.install-banner-close {
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    margin-left: 8px;
}

.install-banner-close:hover {
    color: #333;
}

/* Ajustes para dispositivos móveis */
@media (max-width: 600px) {
    .install-banner-content {
        flex-wrap: wrap;
    }
    
    .install-banner-text {
        flex: 0 0 calc(100% - 64px);
        margin-bottom: 8px;
    }
    
    .install-banner-buttons {
        margin-left: 64px;
    }
}

/* Destaque para a seção de histórico */
.history-container.highlight {
    animation: highlight-pulse 1.5s ease;
}

@keyframes highlight-pulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(52, 152, 219, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0); }
}