/* ==========================================================================
   Estilos Unificados y Modernos para ParaEscolares.com (style.css)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Montserrat:wght@500;700&display=swap');

:root {
    --bg-body: #f8fafc;
    --bg-header: #0f172a;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-primary: #4f46e5;
    --color-primary-hover: #4338ca;
    --color-accent: #06b6d4;
    --color-card-bg: #ffffff;
    --color-card-border: #e2e8f0;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 10px 15px -3px rgba(79, 70, 229, 0.1), 0 4px 6px -2px rgba(79, 70, 229, 0.05);
    --radius-lg: 16px;
    --radius-md: 10px;
    --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--color-text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

header {
    background: #ffffff;
    text-align: center;
    padding: 20px 0 0 0;
    border-bottom: 1px solid #f1f5f9;
}

header img {
    max-width: 100%;
    height: auto;
    width: 280px;
    margin: 0 auto 15px;
    display: block;
    transition: transform 0.3s ease;
}

header img:hover {
    transform: scale(1.02);
}

nav {
    background: var(--bg-header);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

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

nav ul li {
    margin: 0;
}

nav ul li a {
    color: #94a3b8;
    text-decoration: none;
    font-weight: 600;
    font-size: 13.5px;
    display: block;
    padding: 14px 18px;
    transition: all 0.25s ease;
}

nav ul li a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   Container & Layout
   ========================================================================== */

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

main {
    display: flex;
    gap: 30px;
    padding: 30px 0;
    flex-grow: 1;
}

/* ==========================================================================
   Aside (Sidebar)
   ========================================================================== */

aside {
    width: 280px;
    flex-shrink: 0;
    background: #ffffff;
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-card-border);
    box-shadow: var(--shadow-soft);
    align-self: flex-start;
}

aside h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #475569;
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
    width: 100%;
    background: transparent;
    text-align: left;
}

aside h2:first-of-type {
    margin-top: 0;
}

aside ul {
    list-style: none;
    padding: 0;
}

aside ul li {
    margin: 6px 0;
    margin-left: 0;
}

aside ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s ease;
}

aside ul li a:hover {
    color: var(--color-primary);
    background: #f1f5f9;
}

aside ul li a img {
    margin-right: 0;
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* ==========================================================================
   Section (Main Content Area)
   ========================================================================== */

section {
    flex-grow: 1;
    background-color: #ffffff;
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-card-border);
    box-shadow: var(--shadow-soft);
    width: auto;
    margin-left: 0;
}

section h2 {
    font-size: 24px;
    color: #0f172a;
    margin-top: 0;
    margin-bottom: 12px;
    font-weight: 800;
    text-transform: none;
    letter-spacing: -0.5px;
}

section p {
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.6;
    font-weight: 500;
    text-align: left;
    font-family: var(--font-family);
}

/* ==========================================================================
   Search Form
   ========================================================================== */

section form {
    display: flex;
    gap: 8px;
    max-width: 500px;
    margin-bottom: 30px;
}

section form input[type="text"] {
    flex-grow: 1;
    border: 2px solid #e2e8f0;
    border-radius: 30px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    outline: none;
    transition: all 0.25s ease;
    background: #f8fafc;
    color: #0f172a;
}

section form input[type="text"]:focus {
    border-color: var(--color-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

section form button {
    background: var(--color-primary);
    color: #ffffff;
    border: none;
    border-radius: 30px;
    padding: 10px 24px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

section form button:hover {
    background: var(--color-primary-hover);
}

/* ==========================================================================
   File Items Grid
   ========================================================================== */

.file-item {
    display: inline-flex;
    flex-direction: column;
    width: calc(33.333% - 20px);
    margin: 10px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    vertical-align: top;
    text-align: left;
}

.file-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(79, 70, 229, 0.2);
}

.file-item a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    flex-grow: 1;
}

.file-item img.thumbnail {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid #f1f5f9;
    transition: transform 0.3s ease;
    margin-bottom: 12px;
}

.file-item h3 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    text-transform: none;
    line-height: 1.4;
    min-height: 38px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: none;
}

.file-item:hover h3 {
    color: var(--color-primary);
}

.download-button {
    display: inline-block;
    width: 100%;
    padding: 8px 16px;
    background: var(--color-primary);
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 700;
    border-radius: 30px;
    font-size: 13px;
    margin: 0;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.15);
}

.download-button:hover {
    background-color: var(--color-primary-hover);
    color: #ffffff !important;
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.25);
}

/* ==========================================================================
   Details Page
   ========================================================================== */

.file-details {
    text-align: center;
}

.file-details p {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.file-details img.detail-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    border: 1px solid var(--color-card-border);
    margin: 20px auto;
}

.detail-image {
    width: 100% !important;
    max-width: 500px !important;
    height: auto !important;
    display: block !important;
    margin: 20px auto !important;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    border: 1px solid var(--color-card-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.detail-image:hover {
    transform: scale(1.02) !important;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important;
}

@media (min-width: 769px) {
    .file-details img.detail-image {
        max-width: 800px;
        margin: 30px auto;
    }
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
    text-align: center;
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 16px;
    text-decoration: none;
    background: #ffffff;
    color: #475569;
    border-radius: 30px;
    font-size: 13.5px;
    font-weight: 600;
    border: 1px solid var(--color-card-border);
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.pagination span {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.15);
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
    width: 100%;
    background-color: var(--bg-header);
    color: #94a3b8;
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-robnei-menu ul {
    list-style: none;
    padding: 0;
    margin: 0 auto 12px;
    display: inline-flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-robnei-link {
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-robnei-link:hover {
    color: #ffffff;
}

.footer-robnei-text {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

/* ==========================================================================
   Responsive adjustments
   ========================================================================== */

@media (max-width: 1024px) {
    .file-item {
        width: calc(50% - 20px);
    }
}

@media (max-width: 768px) {
    header img {
        width: 220px;
    }
    
    nav ul li a {
        padding: 12px 14px;
        font-size: 13px;
    }

    main {
        flex-direction: column;
        padding: 20px 0;
        gap: 20px;
    }

    aside {
        width: 100%;
        align-self: stretch;
    }

    section {
        padding: 20px;
    }

    .file-item {
        width: calc(50% - 16px);
        margin: 8px;
    }
}

@media (max-width: 480px) {
    .file-item {
        width: 100%;
        margin: 10px 0;
    }
}
