/**
 * Correções específicas para problemas de mobile
 */

/* Evitar zoom no iOS em inputs */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
textarea,
select {
  font-size: 16px !important;
}

/* Evitar scroll horizontal */
html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  position: relative;
}

/* Forçar visibilidade das seções */
main {
  position: relative;
  z-index: 1;
}

main section {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative;
}

/* Correção para espaços em branco laterais */
.container-fluid {
  padding-left: 0;
  padding-right: 0;
}

/* Navbar mobile melhorada */
@media (max-width: 991.98px) {
  .navbar-toggler {
    border: none;
    padding: 4px 8px;
  }
  
  .navbar-toggler:focus {
    box-shadow: none;
  }
  
  .navbar-collapse {
    background: rgba(33, 37, 41, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    margin-top: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .navbar-nav {
    gap: 0.5rem !important;
  }
  
  .nav-link {
    padding: 12px 16px !important;
    border-radius: 8px;
    transition: all 0.3s ease;
  }
  
  .nav-link:hover {
    background: rgba(77, 140, 236, 0.1);
    transform: translateX(5px);
  }
}

/* Hero section mobile otimizada */
@media (max-width: 575.98px) {
  .hero {
    padding: 120px 0 60px;
    min-height: 100vh;
  }
  
  .hero .container {
    padding: 0 20px;
  }
  
  .hero .row {
    margin: 0;
  }
  
  .hero .col-lg-6 {
    padding: 0 10px;
  }
  
  .hero h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
  }
  
  .nome {
    font-size: 2.2rem !important;
    line-height: 1.1;
    margin: 15px 0;
    word-break: break-word;
  }
  
  .descricao {
    font-size: 1.1rem;
    margin-bottom: 25px;
    line-height: 1.4;
  }
  
  .hero .d-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    max-width: 300px;
    margin: 0 auto;
  }
  
  .hero .btn {
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 600;
  }
  
  .hero-img {
    max-width: 85% !important;
    height: auto;
    margin-top: 30px;
  }
}

/* Seções mobile otimizadas */
@media (max-width: 575.98px) {
  section {
    padding: 50px 0 !important;
  }
  
  .container {
    padding: 0 20px;
  }
  
  .titulo-binario {
    margin-bottom: 30px !important;
  }
  
  .titulo {
    font-size: 1.6rem !important;
    text-align: center;
    margin-bottom: 15px;
  }
  
  .texto {
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: justify;
  }
}

/* Foto mobile otimizada */
@media (max-width: 575.98px) {
  .foto {
    width: 220px !important;
    height: 280px !important;
    margin: 0 auto 25px;
  }
  
  .foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

/* VS Code mobile completamente otimizado */
@media (max-width: 575.98px) {
  .vscode-container {
    margin: 0 -20px;
    border-radius: 0;
    min-height: 450px;
  }
  
  .vscode-title-bar {
    padding: 0 10px;
    height: 40px;
  }
  
  .vscode-title-bar span {
    font-size: 10px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .window-controls {
    gap: 6px;
  }
  
  .window-control {
    width: 10px;
    height: 10px;
  }
  
  .activity-bar {
    padding: 8px 0;
    height: 60px !important;
  }
  
  .activity-bar-item {
    width: 40px;
    height: 40px;
    margin-right: 8px;
  }
  
  .vscode-sidebar {
    max-height: 180px;
    border-bottom: 1px solid var(--vscode-border);
  }
  
  .sidebar-header {
    padding: 10px 12px;
    font-size: 10px;
  }
  
  .folder-item,
  .file-item {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  .file-item {
    padding-left: 24px;
  }
  
  .editor-content {
    padding: 15px;
    font-size: 11px;
  }
  
  .code-block {
    padding: 10px;
    font-size: 10px;
    line-height: 1.4;
  }
  
  .vscode-status-bar {
    height: 25px;
    padding: 0 10px;
    font-size: 10px;
  }
}

/* Cards mobile otimizados */
@media (max-width: 575.98px) {
  .project-card {
    margin-bottom: 20px;
  }
  
  .project-card .card {
    margin: 0 5px;
  }
  
  .project-card .card-img-top {
    height: 180px;
  }
  
  .project-card .card-body {
    padding: 18px;
  }
  
  .project-card .card-body p:first-child {
    font-size: 9px;
    padding: 4px 8px;
    margin-bottom: 12px;
  }
  
  .project-card .card-title {
    font-size: 1.1rem;
    line-height: 1.3;
    margin-bottom: 10px;
  }
  
  .project-card .card-text {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 15px;
  }
  
  .project-card .btn {
    padding: 8px 12px;
    font-size: 11px;
    gap: 4px;
  }
  
  .project-card .btn img {
    width: 14px;
    height: 14px;
  }
}

/* Formulário mobile otimizado */
@media (max-width: 575.98px) {
  #contatos .container {
    padding: 0 20px;
  }
  
  #contatos .row {
    margin: 0;
  }
  
  #contatos .col-lg-6 {
    padding: 0 10px;
    margin-bottom: 30px;
  }
  
  .form-control {
    padding: 12px 15px;
    font-size: 16px;
    border-radius: 8px;
  }
  
  .form-label {
    font-size: 14px;
    margin-bottom: 8px;
  }
  
  textarea.form-control {
    min-height: 120px;
  }
  
  .btn-primary {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
  }
}

/* Filtros mobile otimizados */
@media (max-width: 575.98px) {
  .text-center.mt-3 {
    padding: 0 10px;
    margin-bottom: 20px;
  }
  
  .filter-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
    margin: 4px 2px;
    border-radius: 20px;
  }
}

/* Certificados mobile */
@media (max-width: 575.98px) {
  .iframe-certificado,
  iframe {
    height: 220px !important;
    border-radius: 8px;
    margin-bottom: 15px;
  }
}

/* Correção para alertas mobile */
@media (max-width: 575.98px) {
  .alert {
    max-width: calc(100vw - 30px) !important;
    right: 15px !important;
    top: 15px !important;
    font-size: 13px;
    padding: 12px 15px;
  }
  
  .alert .btn-close {
    padding: 8px;
  }
}

/* Correção para particles em mobile */
@media (max-width: 575.98px) {
  #particles-js {
    opacity: 0.4;
  }
}

/* Smooth scroll para mobile */
@media (max-width: 575.98px) {
  html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
  }
}

/* Footer mobile */
@media (max-width: 575.98px) {
  footer {
    margin-top: 40px;
  }
  
  footer div {
    padding: 20px 15px !important;
    font-size: 0.9rem !important;
  }
}