/* ===================================
   CodigoSpain - Professional IT Training Platform
   Modern, Responsive Design
   =================================== */

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3B82F6;
    --primary-dark: #2563EB;
    --secondary: #8B5CF6;
    --accent: #10B981;
    --dark: #0F172A;
    --dark-light: #1E293B;
    --gray: #64748B;
    --gray-light: #F1F5F9;
    --white: #FFFFFF;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--white);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* === CONTAINER === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === HEADER === */
header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

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

nav a {
    font-weight: 500;
    color: var(--dark);
    padding: 0.5rem 0;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
    pointer-events: none;
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}

nav a:hover {
    color: var(--primary);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--dark);
    transition: var(--transition);
    border-radius: 2px;
    pointer-events: none;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* === HERO SECTION === */
.hero {
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
    color: var(--white);
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../img/img_924589ad.jpg') center/cover;
    opacity: 0.15;
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 700px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.25rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    opacity: 0.95;
}

/* === BUTTONS === */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(59, 130, 246, 0.5);
}

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

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

.btn-white {
    background: var(--white);
    color: var(--primary);
}

.btn-white:hover {
    background: var(--gray-light);
    transform: translateY(-2px);
}

.btn-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* === SECTIONS === */
section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark);
}

.section-header p {
    font-size: 1.125rem;
    color: var(--gray);
    line-height: 1.8;
}

.section-gray {
    background: var(--gray-light);
}

/* === CARDS === */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.card {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
    pointer-events: none;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.card:hover::before {
    transform: scaleX(1);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--white);
    margin-bottom: 1.5rem;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.card p {
    color: var(--gray);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.card .btn {
    margin-top: auto;
}

/* Card with Image */
.card-img {
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

.card:hover .card-img img {
    transform: scale(1.05);
}

/* === FEATURES === */
.features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-item {
    display: flex;
    gap: 1rem;
}

.feature-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 700;
}

.feature-content h4 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.feature-content p {
    color: var(--gray);
    line-height: 1.7;
}

/* === TEAM === */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.team-member {
    text-align: center;
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.team-member:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.team-member img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    object-fit: cover;
    border: 4px solid var(--primary);
}

.team-member h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.team-member .role {
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

.team-member p {
    color: var(--gray);
    line-height: 1.7;
}

/* === FORM === */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* === MAP === */
.map-container {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 2rem;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* === BLOG === */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.blog-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.blog-card-img {
    width: 100%;
    height: 240px;
    overflow: hidden;
}

.blog-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.blog-card:hover .blog-card-img img {
    transform: scale(1.1);
}

.blog-card-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--gray);
    margin-bottom: 1rem;
}

.blog-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.blog-card p {
    color: var(--gray);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    flex: 1;
}

/* Article Page */
.article-hero {
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
    color: var(--white);
    padding: 60px 0 40px;
}

.article-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.article-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 20px;
}

.article-featured-img {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 3rem;
    border-radius: 12px;
    overflow: hidden;
}

.article-featured-img img {
    width: 100%;
    height: auto;
}

.article-content h2 {
    font-size: 2rem;
    margin: 2.5rem 0 1rem;
    color: var(--dark);
}

.article-content h3 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--dark);
}

.article-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: var(--dark);
}

.article-content ul,
.article-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
    list-style: disc;
}

.article-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: var(--gray-light);
    border-radius: 12px;
    margin-top: 3rem;
}

.article-author img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.article-author-info h4 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.article-author-info p {
    color: var(--gray);
    margin-bottom: 0;
}

/* === STATS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.stat-item {
    text-align: center;
    padding: 2rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.125rem;
    color: var(--gray);
}

/* === CTA === */
.cta {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
}

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

.cta p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

/* === FOOTER === */
footer {
    background: var(--dark);
    color: var(--white);
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h4 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--white);
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

/* === COOKIE BANNER === */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--dark);
    color: var(--white);
    padding: 1.5rem;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transform: translateY(100%);
    transition: var(--transition);
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.cookie-banner p {
    flex: 1;
    margin: 0;
}

.cookie-banner .btn {
    padding: 10px 24px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        box-shadow: var(--shadow);
        max-height: 0;
        overflow: hidden;
        transition: var(--transition);
    }

    nav.active {
        max-height: 500px;
        padding: 1rem 0;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
    }

    nav li {
        width: 100%;
    }

    nav a {
        display: block;
        padding: 1rem 20px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.125rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .cards-grid,
    .features-list,
    .team-grid,
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .cookie-banner .container {
        flex-direction: column;
        text-align: center;
    }

    .cookie-banner .btn {
        width: 100%;
    }

    .article-hero h1 {
        font-size: 2rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 80px 0 60px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    section {
        padding: 60px 0;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }

    .stat-number {
        font-size: 2.5rem;
    }
}

/* === UTILITIES === */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-gray { color: var(--gray); }

/* === ACCESSIBILITY === */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Ensure all pseudo-elements don't block pointer events */
*::before,
*::after {
    pointer-events: none;
}
