/* ==========================================================================
   Modern & Clean Portfolio Stylesheet - David Rodriguez Chanca
   ========================================================================== */

:root {
    --bg-main: #18181b;
    --bg-card: #27272a;
    --bg-card-secondary: #202023;
    --bg-terminal: #09090b;
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent-blue: #38bdf8;
    --accent-blue-hover: #0284c7;
    --accent-green: #22c55e;
    --border-color: #3f3f46;
    --border-subtle: #2d2d32;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "Fira Code", "JetBrains Mono", Consolas, Menlo, Monaco, "Courier New", monospace;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.25);
    --shadow-terminal: 0 12px 35px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    line-height: 1.65;
    color: var(--text-primary);
    background-color: var(--bg-main);
    margin: 0;
    padding: 0 0 50px 0;
    -webkit-font-smoothing: antialiased;
}

/* --- Navigation Bar --- */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(24, 24, 27, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

nav ul {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 1100px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

nav a {
    display: inline-block;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 16px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s ease, border-bottom 0.2s ease;
    border-bottom: 2px solid transparent;
}

nav a:hover,
nav a.active {
    color: #ffffff;
    border-bottom: 2px solid var(--accent-blue);
}

/* --- Container --- */
.container {
    max-width: 1000px;
    margin: 24px auto;
    padding: 36px 32px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    text-align: center;
}

/* --- Terminal Fullscreen Hero --- */
.terminal-window {
    width: 100%;
    max-width: 100%;
    margin: 0 0 50px 0;
    background-color: #0c0c0e;
    border: none;
    border-radius: 0;
    box-shadow: none;
    min-height: calc(100vh - 56px);
    height: calc(100vh - 56px);
    min-height: calc(100dvh - 56px);
    height: calc(100dvh - 56px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    text-align: left;
    font-family: var(--font-mono);
}

.terminal-header {
    background-color: #18181b;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #27272a;
    flex-shrink: 0;
}

.terminal-controls {
    display: flex;
    gap: 8px;
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.dot-close { background-color: #ef4444; }
.dot-minimize { background-color: #f59e0b; }
.dot-maximize { background-color: #10b981; }

.terminal-title {
    margin-left: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    user-select: none;
}

.terminal-badges {
    margin-left: auto;
}

.terminal-badge {
    font-size: 0.75rem;
    color: #4ade80;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    padding: 2px 8px;
    border-radius: 4px;
}

.terminal-toolbar {
    background-color: #121215;
    padding: 10px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #27272a;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.toolbar-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-right: 4px;
}

.term-btn {
    background: #27272a;
    border: 1px solid #3f3f46;
    color: #e4e4e7;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.term-btn:hover {
    background: #3f3f46;
    border-color: var(--accent-blue);
    color: #ffffff;
    transform: translateY(-1px);
}

.term-btn.btn-clear {
    margin-left: auto;
    color: var(--text-muted);
}

.term-btn.btn-clear:hover {
    color: #ef4444;
    border-color: #ef4444;
}

.terminal-body {
    flex: 1 1 auto;
    padding: 32px 48px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.terminal-block {
    margin-bottom: 24px;
}

.terminal-command-line {
    font-size: clamp(2.4rem, 6vw, 4.4rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 14px 0;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px;
    color: #22c55e; /* Green $whoami */
}

.terminal-prompt {
    color: #22c55e; /* Green prompt */
    user-select: none;
}

.terminal-command {
    color: #22c55e; /* Green command */
}

.terminal-cursor {
    display: inline-block;
    width: 16px;
    height: 0.95em;
    background-color: #22c55e; /* Green cursor */
    vertical-align: baseline;
    animation: blink 1s step-start infinite;
    margin-left: 6px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    50.01%, 100% { opacity: 0; }
}

.terminal-response {
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.5px;
}

.terminal-subtitle {
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    color: var(--text-secondary);
    margin: 8px 0 0;
}

.terminal-details-box {
    margin-top: 14px;
    padding-left: 16px;
    border-left: 3px solid var(--accent-blue);
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.terminal-details-box strong {
    color: #ffffff;
}

.terminal-input-bar {
    background-color: #121215;
    border-top: 1px solid #27272a;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.terminal-input-bar input {
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    width: 100%;
}

.terminal-input-bar input::placeholder {
    color: var(--text-muted);
}

.terminal-scroll-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: #09090b;
    border-top: 1px solid #1f1f23;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
    user-select: none;
}

.terminal-scroll-hint:hover {
    color: var(--accent-blue);
    background: #141418;
}

.scroll-arrow {
    animation: bounce 1.8s infinite;
    display: inline-block;
    color: var(--accent-green);
    font-weight: bold;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(5px); }
    60% { transform: translateY(2px); }
}

/* --- Hero Section Inside Container --- */
img.profile-pic {
    width: 155px;
    height: 155px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-blue);
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

h1 {
    font-size: 2rem;
    color: #ffffff;
    margin-top: 0;
    margin-bottom: 16px;
    font-weight: 700;
}

h2 {
    font-size: 1.5rem;
    color: #ffffff;
    margin-top: 24px;
    margin-bottom: 12px;
}

.bio-text {
    max-width: 800px;
    margin: 0 auto 24px;
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.bio-text strong {
    color: #ffffff;
}

hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 28px 0;
}

/* --- Action Links & Buttons --- */
.links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    text-decoration: none;
    background-color: var(--accent-blue);
    color: #0f172a;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.btn-primary:hover {
    background-color: #7dd3fc;
    transform: translateY(-2px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    text-decoration: none;
    background-color: #3f3f46;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.btn-secondary:hover {
    background-color: #52525b;
    transform: translateY(-2px);
}

/* --- Technical Skills Grid --- */
.skills-subtitle {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 1.05rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 18px;
    margin-top: 24px;
    padding: 0 8px;
}

.skill-item {
    background-color: var(--bg-card-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.skill-item:hover {
    transform: translateY(-4px);
    border-color: var(--accent-blue);
    background-color: #27272f;
}

.skill-item img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 10px;
}

.skill-item span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* --- Projects Section --- */
.project-section {
    text-align: left;
}

.project-section h1 {
    text-align: left;
    margin-bottom: 24px;
}

.project-card {
    background-color: var(--bg-card-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 24px 26px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.project-card h2 {
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--accent-blue);
    font-size: 1.3rem;
}

.project-card p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.65;
    margin-bottom: 16px;
}

.project-card p strong {
    color: var(--text-primary);
}

.project-links {
    margin-top: 16px;
}

.link-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    background-color: #3f3f46;
    color: #ffffff;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.link-button:hover {
    background-color: #52525b;
}

.badge-in-progress {
    display: inline-block;
    background-color: rgba(234, 179, 8, 0.15);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.3);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

/* --- About Me Page Styles --- */
.about-content {
    text-align: left;
}

.about-content h1 {
    text-align: center;
}

.about-content h2 {
    color: var(--accent-blue);
    margin-top: 28px;
    margin-bottom: 10px;
    font-size: 1.35rem;
}

.about-content p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 16px;
}

.about-content p strong {
    color: #ffffff;
}

/* --- Carousel --- */
.carousel-viewport {
    position: relative;
    max-width: 620px;
    margin: 28px auto 10px;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    background-color: #000;
}

.carousel-slide {
    display: flex;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-item {
    width: 100%;
    flex-shrink: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

.carousel-item img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
}

.carousel-caption {
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    font-size: 0.9rem;
    padding: 10px 14px;
    text-align: center;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.55);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background-color: rgba(0, 0, 0, 0.85);
    transform: translateY(-50%) scale(1.08);
}

#prevBtn { left: 14px; }
#nextBtn { right: 14px; }

/* --- Contact Page Styles --- */
.contact-container {
    max-width: 700px;
}

.contact-card-box {
    background-color: var(--bg-card-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 30px;
    margin: 28px 0;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 16px 0;
    font-size: 1.15rem;
}

.contact-item a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
}

.contact-item a:hover {
    text-decoration: underline;
}

/* --- Footer --- */
footer {
    text-align: center;
    margin-top: 40px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .container {
        padding: 24px 18px;
    }

    .terminal-body {
        padding: 24px 18px;
    }

    .terminal-command-line {
        font-size: 2.1rem;
    }

    .terminal-response {
        font-size: 1.8rem;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 12px;
    }

    .carousel-item img {
        height: 300px;
    }
}
