/* ============================================
   PORTFOLIO - RODRIGO OLIVEIRA
   CSS Moderno e Responsivo
   ============================================ */

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}
.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}
.preloader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 230, 0, 0.2);
    border-top-color: #FFE600;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

:root {
    --primary: #FFE600;
    --primary-dark: #d4c000;
    --bg-dark: #000000;
    --bg-section: #0a0a0a;
    --text: #ffffff;
    --text-muted: #a0a0a0;
    --border: #333333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   HEADER / NAVIGATION
   ============================================ */

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 45px;
    object-fit: contain;
    object-position: left center;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text);
    font-weight: 500;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--primary);
}


/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--primary);
    transition: all 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 100px 2rem 2rem;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text .greeting {
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 500;
}

.hero-text h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
    line-height: 1.1;
}

.hero-text .tagline {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.hero-text .description {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: #000;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: #000;
}

.hero-image {
    display: flex;
    justify-content: center;
}

.hero-image img {
    width: 350px;
    height: 350px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--primary);
    box-shadow: 0 0 40px rgba(255, 230, 0, 0.3);
}

/* ============================================
   SECTIONS
   ============================================ */

.section {
    padding: 5rem 2rem;
}

.section-dark {
    background: var(--bg-section);
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

/* ============================================
   SAAS CARDS
   ============================================ */

.saas-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.saas-card {
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s;
    display: block;
}

.saas-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(255, 230, 0, 0.1);
}

.saas-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
}

.saas-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.saas-card p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.saas-tech {
    display: inline-block;
    background: rgba(255, 230, 0, 0.1);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* ============================================
   SQUARES (Portfolio Categories)
   ============================================ */

.squares {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

.square-link {
    text-decoration: none;
}

.square {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.square:hover .skill {
    z-index: 10;
    color: #000;
}

.skill {
    text-align: center;
    color: var(--primary);
    z-index: 5;
}

.skill h2 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.skill small {
    font-size: 0.75rem;
    opacity: 0.7;
}

.square span {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid var(--primary);
    border-radius: 38% 62% 63% 37% / 41% 44% 56% 59%;
    transition: 0.5s;
}

.square span:nth-child(1) {
    animation: animate 6s linear infinite;
}

.square span:nth-child(2) {
    animation: animate 4s linear infinite;
}

.square span:nth-child(3) {
    animation: animate2 10s linear infinite;
}

.square:hover span {
    background: var(--primary);
    opacity: 0.9;
    border: none;
}

@keyframes animate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes animate2 {
    0% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}

/* ============================================
   TECH GRID
   ============================================ */

.tech-grid {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.tech-category {
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.tech-category h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tags span {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============================================
   CONTACT GRID
   ============================================ */

.contact-grid {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.contact-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.contact-card:hover {
    border-color: var(--primary);
    background: rgba(255, 230, 0, 0.05);
}

.contact-card svg {
    width: 32px;
    height: 32px;
    fill: var(--primary);
}

.contact-card span {
    font-weight: 600;
    font-size: 1.1rem;
}

.contact-card small {
    color: var(--text-muted);
    font-size: 0.75rem;
    word-break: break-all;
    max-width: 100%;
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
}

footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0.25rem 0;
}

footer a {
    color: var(--primary);
}

footer a:hover {
    text-decoration: underline;
}

/* ============================================
   MODALS
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    padding: 2rem;
    overflow-y: auto;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
    z-index: 2001;
    transition: transform 0.3s;
}

.modal-close:hover {
    transform: scale(1.1);
}

.modal-content {
    max-width: 900px;
    width: 100%;
    padding: 2rem 0;
}

.modal-content h2 {
    color: var(--primary);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--bg-section);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
    text-align: center;
}

.card:hover {
    background: var(--primary);
    color: #000;
    transform: scale(1.05);
}

.card-img {
    width: 100%;
    height: 120px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.card p {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #111;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ============================================
   RESPONSIVE - TABLET (max 900px)
   ============================================ */

@media (max-width: 900px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .hero-text .description {
        margin: 0 auto 2rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-image {
        order: -1;
    }

    .hero-image img {
        width: 250px;
        height: 250px;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .square {
        width: 150px;
        height: 150px;
    }

    .skill h2 {
        font-size: 1rem;
    }
}

/* ============================================
   RESPONSIVE - MOBILE (max 600px)
   ============================================ */

@media (max-width: 600px) {
    /* Navigation */
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background: rgba(0, 0, 0, 0.98);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        transform: translateX(100%);
        transition: transform 0.3s;
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-links a {
        font-size: 1.2rem;
    }

    /* Hero */
    .hero {
        padding: 100px 1rem 2rem;
        min-height: auto;
    }

    .hero-content {
        gap: 2rem;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .hero-text .tagline {
        font-size: 1.1rem;
    }

    .hero-text .description {
        font-size: 1rem;
    }

    .hero-image img {
        width: 200px;
        height: 200px;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    /* Sections */
    .section {
        padding: 3rem 1rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    /* Squares */
    .squares {
        gap: 1rem;
    }

    .square {
        width: 130px;
        height: 130px;
    }

    .skill h2 {
        font-size: 0.9rem;
    }

    .skill small {
        font-size: 0.65rem;
    }

    /* SaaS Cards */
    .saas-grid {
        grid-template-columns: 1fr;
    }

    /* Tech Grid */
    .tech-grid {
        grid-template-columns: 1fr;
    }

    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Modal */
    .modal {
        padding: 1rem;
    }

    .modal-content h2 {
        font-size: 1.5rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .modal-close {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        top: 10px;
        right: 10px;
    }
}

/* ============================================
   RESPONSIVE - SMALL MOBILE (max 400px)
   ============================================ */

@media (max-width: 400px) {
    .hero-text h1 {
        font-size: 1.75rem;
    }

    .square {
        width: 110px;
        height: 110px;
    }

    .skill h2 {
        font-size: 0.8rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }
}
