/* ===========================
   PAULO SÉRGIO - PORTFOLIO
   Shared Stylesheet
   =========================== */

:root {
    --primary: #3dc3eb;
    --primary-glow: rgba(61, 195, 235, 0.35);
    --primary-subtle: rgba(61, 195, 235, 0.08);
    --glass-dark: rgba(22, 22, 28, 0.82);
    --glass-light: rgba(255, 255, 255, 0.82);
    --border-dark: rgba(61, 195, 235, 0.2);
    --border-light: rgba(0, 0, 0, 0.1);
}

/* ── BASE ── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

body {
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    background: url('https://images.unsplash.com/photo-1550439062-609e1531270e?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') no-repeat center center fixed;
    background-size: cover;
    transition: background-color 0.3s ease;
    padding-bottom: 40px;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(12, 12, 18, 0.87);
    backdrop-filter: blur(6px);
    z-index: -1;
}

[data-bs-theme="light"] body::before {
    background: rgba(230, 238, 248, 0.88);
}

.fira { font-family: 'Fira Code', monospace; }
.accent { color: var(--primary); }

/* ── GLASS CARD ── */
.glass-card {
    background: var(--glass-dark);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-dark);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    transition: background 0.3s, border-color 0.3s;
}

[data-bs-theme="light"] .glass-card {
    background: var(--glass-light);
    border-color: var(--border-light);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

/* ── LAYOUT ── */
.layout-wrapper {
  display: flex;
  gap: 20px;
  padding: 40px 16px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: flex-start;
}

/* ── SIDEBAR NAV ── */
.main-menu {
  width: 96px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 10px;
  position: sticky;
  top: 40px;
  align-items: center;
}

.menu-item {
    width: 72px;
    height: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    color: var(--bs-body-color);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all 0.25s ease;
    cursor: pointer;
    gap: 5px;
}

.menu-item i { font-size: 1.4rem; }

.menu-item:hover,
.menu-item.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 18px var(--primary-glow);
    transform: translateY(-2px);
}

/* ── CONTENT AREA ── */
.content-area {
    flex: 1;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-card {
    width: 100%;
}

/* ── PROFILE HEADER ── */
.profile-card {
    overflow: hidden;
    padding: 0;
}

.cover-photo {
    height: 190px;
    width: 100%;
    background: url('https://images.unsplash.com/photo-1518770660439-4636190af475?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80') center/cover;
}

.profile-content {
    padding: 0 36px 32px;
    position: relative;
}

.profile-img {
    width: 156px;
    height: 156px;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid #14141a;
    box-shadow: 0 0 24px var(--primary-glow);
    margin-top: -78px;
    position: relative;
    z-index: 5;
    background: #222;
    transition: border-color 0.3s;
}

[data-bs-theme="light"] .profile-img { border-color: #fff; }

/* ── PROFILE HEADER GRID (ajustado) ── */
.profile-header-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 18px;
    align-items: flex-start;
}

.profile-info {
    flex: 1;
    min-width: 240px;
}

.profile-info h1 { font-weight: 700; margin: 0 0 4px; }
.profile-info .role { color: var(--primary); font-size: 0.92rem; margin-bottom: 12px; }
.socials a { color: var(--bs-secondary-color); font-size: 1.4rem; text-decoration: none; transition: color 0.2s; }
.socials a:hover { color: var(--primary); }

/* ── TERMINAL (ajustado) ── */
.hero-terminal {
    background: #23252a;
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    overflow: hidden;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    min-width: 260px;
    max-width: 420px;
    flex: 1;
}

/* impede que .profile-info e .hero-terminal cresçam conforme
   o conteúdo (texto digitado) é inserido via JS.
   Sem isso, o min-width:auto padrão do flexbox força a caixa
   a se expandir a cada caractere digitado. */
.profile-info,
.hero-terminal {
    min-width: 0;
}

.terminal-bar {
    background: #1a1c20;
    padding: 9px 14px;
    display: flex;
    align-items: center;
    gap: 7px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.t-dot { width: 11px; height: 11px; border-radius: 50%; }
.t-dot.red { background: #ff5f57; }
.t-dot.yellow { background: #febc2e; }
.t-dot.green { background: #28c840; }

.terminal-title {
    font-size: 0.67rem;
    color: #888;
    margin: 0 auto;
    letter-spacing: 0.08em;
}

#typed-code {
    text-align: left;
    display: block;
    color: #d0d0d0;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: break-word;
    padding: 16px;
    min-height: 140px;
    line-height: 1.85;
}

#typed-code::after {
    content: '▌';
    color: var(--primary);
    animation: blink 1s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ── SECTION CONTENT ── */
.section-content {
    padding: 40px;
    animation: fadeUp 0.45s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.section-title {
    font-weight: 700;
    margin-bottom: 36px;
    padding-bottom: 12px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 44px;
    height: 3px;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    border-radius: 2px;
}

/* ── LOADING STATE ── */
.content-loading {
    min-height: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    color: var(--primary);
}

.loading-spinner {
    width: 52px;
    height: 52px;
    border: 3px solid var(--primary-subtle);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    opacity: 0.7;
    letter-spacing: 0.05em;
}

/* ── SERVICE BOXES ── */
.service-box {
    padding: 26px 22px;
    border-radius: 16px;
    border: 1px solid var(--border-dark);
    text-align: center;
    height: 100%;
    transition: all 0.3s ease;
    background: var(--primary-subtle);
}

[data-bs-theme="light"] .service-box { border-color: var(--border-light); background: rgba(61,195,235,0.05); }

.service-box:hover {
    border-color: var(--primary);
    box-shadow: inset 0 0 24px rgba(61,195,235,0.08), 0 6px 20px rgba(61,195,235,0.1);
    transform: translateY(-3px);
}

.service-box i { font-size: 2.2rem; color: #ffffff; margin-bottom: 14px; display: block; }

/* ── SKILL BARS ── */
.skill-row { margin-bottom: 18px; }
.skill-row .label { display: flex; justify-content: space-between; font-size: 0.88rem; margin-bottom: 6px; }
.skill-bar { height: 5px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
.skill-bar-fill { height: 100%; background: var(--primary); border-radius: 3px; box-shadow: 0 0 8px var(--primary-glow); transition: width 1.2s cubic-bezier(0.4,0,0.2,1); width: 0; }

/* ── PROJECTS ── */
.project-card {
    border: 1px solid var(--border-dark);
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
    transition: all 0.3s ease;
    background: rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 12px 28px rgba(61,195,235,0.12);
}

.project-banner {
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-subtle);
    border-bottom: 1px solid var(--border-dark);
}

.project-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.project-body p { flex: 1; }

.badge-tag {
    background: rgba(61,195,235,0.12) !important;
    color: var(--primary) !important;
    border: 1px solid rgba(61,195,235,0.3) !important;
    font-weight: 500;
    font-size: 0.73rem;
}

/* ── BLOG POSTS ── */
.blog-card {
    padding: 24px;
    border-radius: 15px;
    border-left: 3px solid var(--primary);
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border-dark);
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
    margin-bottom: 18px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.3s;
}

.blog-card.visible { opacity: 1; transform: translateY(0); }
.blog-card:hover { border-color: var(--primary); box-shadow: 0 6px 20px rgba(61,195,235,0.08); }

[data-bs-theme="light"] .blog-card { background: rgba(0,0,0,0.02); border-color: var(--border-light); border-left-color: var(--primary); }

.blog-meta { font-size: 0.78rem; color: var(--bs-secondary-color); margin-bottom: 10px; }
.blog-tag { font-size: 0.7rem; background: var(--primary-subtle); color: var(--primary); border-radius: 20px; padding: 2px 10px; display: inline-block; margin-right: 6px; }

/* ── Loading Buttom ── */
.ps-hidden { display: none !important; }

/* ── SINGLE POST / PROJECT ── */
.post-hero {
    height: 260px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 32px;
    background: var(--primary-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-dark);
}

.post-content p { line-height: 1.85; margin-bottom: 1.2rem; }
.post-content h3 { color: var(--primary); font-family: 'Fira Code', monospace; margin-top: 2rem; margin-bottom: 1rem; }
.post-content code { background: rgba(61,195,235,0.1); color: var(--primary); padding: 2px 7px; border-radius: 5px; font-size: 0.88em; }
.post-content pre { background: #1a1c22; border: 1px solid var(--border-dark); border-radius: 12px; padding: 20px; overflow-x: auto; margin: 1.5rem 0; }
.post-content pre code { background: none; padding: 0; color: #d0d0d0; }

.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--primary); text-decoration: none; font-size: 0.88rem; font-family: 'Fira Code', monospace; margin-bottom: 28px; transition: gap 0.2s; }
.back-link:hover { gap: 14px; color: var(--primary); }

/* ── CONTACT FORM ── */
.form-control {
    background: rgba(255,255,255,0.04) !important;
    border-color: var(--border-dark) !important;
    border-radius: 10px !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
}

.form-control:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
    background: rgba(61,195,235,0.04) !important;
}

[data-bs-theme="light"] .form-control {
    background: rgba(0,0,0,0.03) !important;
    color: #222 !important;
}

.btn-primary-custom {
    background: var(--primary);
    border: none;
    border-radius: 10px;
    padding: 10px 28px;
    font-weight: 600;
    color: #ffffff;
    transition: opacity 0.2s, box-shadow 0.2s;
}

.btn-primary-custom:hover { opacity: 0.88; box-shadow: 0 0 18px var(--primary-glow); }

/* ── TOP CONTROLS ── */
.top-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1060;
    display: flex;
    gap: 12px;
}

.control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--glass-dark);
    border: 1px solid var(--border-dark);
    color: var(--bs-body-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

[data-bs-theme="light"] .control-btn { background: var(--glass-light); }

.control-btn:hover {
    transform: scale(1.08);
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
    color: var(--primary);
}

.control-btn img { width: 22px; border-radius: 3px; }

/* ── WHATSAPP BTN ── */
.whatsapp-btn {
    position: fixed;
    bottom: 60px;
    right: 30px;
    width: 58px;
    height: 58px;
    background: #25D366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    text-decoration: none;
    z-index: 1000;
    box-shadow: 0 0 22px rgba(37,211,102,0.45);
    animation: pulse 2s infinite;
    transition: transform 0.2s;
}

.whatsapp-btn:hover { color: #fff; transform: scale(1.1); }

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(37,211,102,0.6); }
    70%  { box-shadow: 0 0 0 14px rgba(37,211,102,0); }
    100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}

/* ── TIMELINE (resume) ── */
.timeline { border-left: 2px solid var(--border-dark); padding-left: 24px; margin-left: 8px; }
.timeline-item { position: relative; margin-bottom: 32px; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -31px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

.timeline-date { font-family: 'Fira Code', monospace; font-size: 0.78rem; color: var(--primary); margin-bottom: 4px; }

/* ── RESPONSIVE MOBILE (ajustado) ── */
@media (max-width: 991px) {
    body { padding-bottom: 100px; }

    .layout-wrapper { flex-direction: column; padding: 16px 10px; }

    .main-menu {
        position: fixed !important;
        bottom: 0 !important;
        top: auto !important;
        left: 0;
        width: 100%;
        flex-direction: row;
        justify-content: space-around;
        background: var(--glass-dark);
        border-top: 1px solid var(--border-dark);
        border-radius: 20px 20px 0 0;
        padding: 10px 8px;
        z-index: 1050;
        gap: 0;
    }

    [data-bs-theme="light"] .main-menu { background: var(--glass-light); }

    .menu-item { width: 58px; height: 58px; font-size: 0.68rem; border-radius: 12px; }
    .menu-item i { font-size: 1.15rem; }

    .profile-content { padding: 0 20px 24px; }
    .profile-img { display: block; margin: -78px auto 0; }

    .profile-header-grid {
        flex-direction: column;
        align-items: stretch; /* garante largura total dos filhos (em vez de "center") */
        text-align: center;
    }

    .profile-info {
        width: 100%;
        min-width: 0;
    }

    .hero-terminal {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .section-content { padding: 24px 18px; }
    .whatsapp-btn { bottom: 100px; right: 18px; width: 50px; height: 50px; font-size: 26px; }
}
