/* ========================================
   RESPONSIVE STYLES
   ======================================== */

/* ========================================
   TABLETS E ECRÃS MÉDIOS
   ======================================== */
@media (max-width: 1024px) {
    .skills-container { 
        grid-template-columns: repeat(2, 1fr); 
    }
    
    .portfolio-modal-image { 
        width: 400px; 
        height: 400px; 
    }
}

/* ========================================
   DESKTOP PEQUENO / TABLET GRANDE
   ======================================== */
@media (max-width: 992px) {
    .about-content { 
        flex-direction: column; 
    }
    .about-image { width: 100%; min-height: 0; aspect-ratio: 3 / 2; flex: none; }
    
    .contact-container { 
        flex-direction: column; 
    }
    
    /* Mosaico - 4 itens por linha em tablet */
    .portfolio-mosaic { 
        grid-template-columns: repeat(4, 1fr); 
    }
    
    .portfolio-modal-body { 
        flex-direction: column; 
    }
    
    .portfolio-modal-info { 
        width: 100%; 
        padding: 15px 0; 
    }
    
    .portfolio-modal-image { 
        width: 100%; 
        height: auto; 
        max-height: 400px; 
    }
}

/* ========================================
   TABLET PEQUENO / TELEMÓVEL GRANDE
   ======================================== */
@media (max-width: 768px) {
    /* Menu Mobile */
    .mobile-toggle { 
        display: block; 
    }
    
    nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
        padding: 20px;
        transform: translateY(-150%);
        transition: transform 0.5s ease;
        z-index: 999;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    }
    
    nav.active { 
        transform: translateY(0); 
    }
    
    nav ul { 
        flex-direction: column; 
        align-items: center;
    }
    
    nav ul li { 
        margin: 10px 0; 
    }
    
    .lang-switch { 
        margin-left: 0; 
        margin-top: 10px; 
        justify-content: center; 
    }
    
    /* Hero */
    .hero h1 { 
        font-size: 2.5rem; 
    }
    
    /* Mosaico - 3 itens por linha em tablet pequeno */
    .portfolio-mosaic { 
        grid-template-columns: repeat(3, 1fr); 
    }
    
    /* Portfolio Modal */
    .portfolio-modal { 
        padding: 10px; 
    }
    
    .portfolio-modal-image { 
        width: 100%; 
        height: auto; 
        max-height: 300px; 
    }
    
    /* Skills */
    .skills-container { 
        grid-template-columns: 1fr; 
    }
    
    /* Splash Screen */
    .splash-logo { 
        width: 120px; 
    }
    
    .splash-text { 
        font-size: 1rem; 
    }
    
    /* Correção para o problema do header */
    .main-content {
        padding-top: 70px;
    }
    
    .hero {
        min-height: calc(100vh - 70px);
    }
}

/* ========================================
   TELEMÓVEL PEQUENO
   ======================================== */
@media (max-width: 576px) {
    /* Hero */
    .hero h1 { 
        font-size: 2rem; 
    }
    
    /* Section Titles */
    .section-title h2 { 
        font-size: 2rem; 
    }
    
    /* Logo */
    .logo-svg { 
        width: 80px; 
        height: 37px; 
    }
    
    /* Contact Form */
    .contact-form { 
        padding: 25px; 
    }
    
    /* Mosaico - 2 itens por linha em telemóvel */
    .portfolio-mosaic { 
        grid-template-columns: repeat(2, 1fr); 
    }
    
    /* Portfolio Modal */
    .portfolio-modal-image { 
        max-height: 200px; 
    }
    
    .portfolio-modal-info h3 { 
        font-size: 1.1rem; 
    }
    
    /* Splash Screen */
    .splash-logo { 
        width: 100px; 
    }
    
    /* Correção para o problema do header em mobile pequeno */
    .main-content {
        padding-top: 60px;
    }
    
    .hero {
        min-height: calc(100vh - 60px);
    }
}

/* ========================================
   SPLASH SCREEN - ESCONDER APÓS ANIMAÇÃO
   ======================================== */
.splash-screen.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ========================================
   TELEMÓVEL MUITO PEQUENO (< 400px)
   ======================================== */
@media (max-width: 400px) {
    /* Mosaico - 2 itens por linha (mantido) */
    .portfolio-mosaic { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 3px;
    }
    
    .mosaic-overlay h4 {
        font-size: 0.7rem;
    }
    
    .mosaic-overlay span {
        font-size: 0.6rem;
    }
    
    .mosaic-overlay i {
        font-size: 1.2rem;
    }
    
    .hero h1 { 
        font-size: 1.6rem; 
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.8rem;
    }
    
    .section-title h2 { 
        font-size: 1.6rem; 
    }
    
    .main-content {
        padding-top: 55px;
    }
    
    .hero {
        min-height: calc(100vh - 55px);
    }
    
    .contact-detail i {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* ========================================
   IMPRESSÃO
   ======================================== */
@media print {
    header {
        position: relative;
        background: white;
        color: black;
    }
    
    .splash-screen {
        display: none !important;
    }
    
    .portfolio-modal {
        display: none !important;
    }
    
    .hero {
        min-height: auto;
        height: auto;
        padding: 50px 0;
    }
    
    .hero-bg {
        display: none;
    }
    
    .hero-overlay {
        display: none;
    }
    
    .btn {
        display: none;
    }
    
    .mobile-toggle {
        display: none !important;
    }
    
    nav {
        position: relative !important;
        transform: none !important;
        background: transparent !important;
        padding: 0 !important;
    }
    
    nav ul {
        flex-direction: row !important;
        justify-content: center;
    }
    
    nav ul li {
        margin: 0 15px !important;
    }
    
    nav ul li a {
        color: black !important;
    }
    
    section {
        padding: 40px 0 !important;
        page-break-inside: avoid;
    }
    
    .portfolio-mosaic {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 10px;
    }
    
    .mosaic-item {
        break-inside: avoid;
    }
    
    .mosaic-overlay {
        opacity: 0 !important;
    }
    
    .footer-links {
        flex-direction: row !important;
        gap: 20px !important;
    }
}