/* =========================================
   PORTFOLIO INTERACTIVO - DANIEL CLAVER
   DESIGN SYSTEM & MODERN UI
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
    /* Base Colors - Light Mode (Default) */
    --bg-color: #f8fafc;
    --container-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --accent-primary: #2563eb;
    --accent-secondary: #60a5fa;
    --border-color: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --header-gradient: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    --transition: all 0.3s ease;
}

html[data-theme="dark"] {
    --bg-color: #020617;
    --container-bg: #0f172a;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-secondary: #93c5fd;
    --border-color: #1e293b;
    --glass-bg: rgba(15, 23, 42, 0.8);
    --glass-border: rgba(255, 255, 255, 0.05);
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --header-gradient: linear-gradient(135deg, #020617 0%, #1e3a8a 100%);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.5s ease, color 0.5s ease;
    overflow-x: hidden;
}

h1, h2, h3, .brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Layout */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 80px 0;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.2rem 0;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.5rem;
    background: var(--header-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    opacity: 0.8;
}

.nav-links a:hover {
    color: var(--accent-primary);
    opacity: 1;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    padding: 5px;
    border-radius: 50%;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: rgba(125, 125, 125, 0.1);
    transform: rotate(15deg);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.15), transparent),
                radial-gradient(circle at bottom left, rgba(37, 99, 235, 0.1), transparent);
    padding-top: 100px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 500px;
}

.hero-btns {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-blob {
    width: 320px;
    height: 320px;
    background: var(--header-gradient);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    overflow: hidden;
    animation: morph 8s ease-in-out infinite;
    border: 8px solid var(--glass-border);
    box-shadow: var(--shadow);
}

.profile-blob img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes morph {
    0% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
    50% { border-radius: 60% 40% 30% 70% / 50% 30% 70% 50%; }
    100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    font-size: 1rem;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--header-gradient);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-header .underline {
    width: 60px;
    height: 4px;
    background: var(--header-gradient);
    margin: 0 auto;
    border-radius: 10px;
}

/* Project Cards */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow);
}

.project-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.project-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.github-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    transition: var(--transition);
    text-decoration: none;
}

.github-link:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.modal-footer {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--container-bg);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    border-radius: 24px;
    padding: 2.5rem;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal.active .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Experience & Skills */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.skill-category h4 {
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
    color: var(--accent-secondary);
}

.skill-list {
    list-style: none;
}

.skill-list li {
    background: var(--container-bg);
    margin-bottom: 0.8rem;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.skill-list li i {
    color: var(--accent-primary);
}

/* Footer */
footer {
    padding: 4rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

/* Skills section - background alternante */
.bg-alt {
    background-color: var(--container-bg);
}

/* Modal tags */
.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0 1.5rem;
}

/* Timeline (Experiencia & Formación) */
.exp-timeline {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 700px;
    margin: 0 auto;
}

.timeline-item {
    background: var(--container-bg);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-primary);
    border-radius: 12px;
    padding: 1.5rem 2rem;
}

.timeline-item h4 {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}

.timeline-item .date {
    font-size: 0.85rem;
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.timeline-item p {
    color: var(--text-muted);
    font-size: 0.95rem;
}


.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.social-links a {
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--accent-primary);
    transform: translateY(-3px);
}

/* Responsive */
@media (max-width: 968px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-content h1 { font-size: 3rem; }
    .hero-content p { margin: 0 auto 2.5rem; }
    .hero-visual { order: -1; }
    .profile-blob { width: 260px; height: 260px; }
    .nav-links { display: none; }
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}
