@font-face {
    font-family: 'FuentePrincipal';
    src: url('assets/fonts/FuentePrincipal.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'FuentePrincipal';
    src: url('assets/fonts/FuentePrincipal.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'FuentePrincipal';
    src: url('assets/fonts/FuentePrincipal.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'FuentePrincipal';
    src: url('assets/fonts/FuentePrincipal.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'FuentePrincipal';
    src: url('assets/fonts/FuentePrincipal.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --accent: #ffa50a;
    --background: #ffffff;
    --surface: #f8fafc;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.907);
    --option: #f1f5f9;
    --option2: #dcdcdc;
    --hover: rgba(254, 254, 254, 0.9);
    --dividor: rgb(86, 86, 86);
    --footer: rgb(240, 240, 240);
}

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

body.dark-mode {
    --background: #0f172a;
    --surface: #1e293b;
    --text: #ffffffe4;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.4);
    --option: #334155;
    --option2: #475569;
    --hover: rgba(254, 254, 254, 0.9);
    --dividor: rgb(170, 170, 170);
    --footer: #090d17;
}

body {
    font-family: 'FuentePrincipal', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--background) 0%, var(--surface) 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
p{
    font-size: 0.7rem;
}

header {
    background: color-mix(in srgb, rgb(156, 156, 156), transparent 92%);
    color: var(--text);
    padding: 0.5rem 0.2rem;
    position: sticky;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
}

.header-main {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    justify-content: space-between;
    margin: 5px auto;
    gap: 2rem;
    max-width: 95%;
    width: 100%;
}

.header-main2 {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
    gap: 2rem;
    max-width: 100%;
    width: 100%;
}

.header-left {
    display: flex;
}

.logo {
    height: 40px;
    width: auto;
    border-radius: 8px;
    transition: all 0.3s ease;
    object-fit: contain;
}

header h1 {
    font-size: 1rem;
    font-weight: 400;
    margin: 0;
    text-shadow: rgba(0, 0, 0, 0.227) 0 0.1rem 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-center {
    display: flex;
    justify-content: center;
}

.search-container {
    position: relative;
    width: 100%;

}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    z-index: 1;
}

#busqueda {
    width: 100%;
    max-width: 75%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border-radius: 25px;
    border: 2px solid transparent;
    background: rgba(231, 231, 231, 0.1);
    color: var(--text-muted);
    font-size: 1rem;
    backdrop-filter: blur(10px);
    transition: 0.4s;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.162);
}

#busqueda::placeholder {
    color: var(--text-muted);
}

#busqueda:focus {
    outline: none;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.162);
    transition: 0.4s;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.top-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    
}

.top-nav button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text);
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.161);
}

.top-nav button:active {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.top-nav button i {
    font-size: 1rem;
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
    display: inline-block;
    z-index: 1000;
}

.dropdown-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white ;
    padding: 0.5rem 0.75rem ;
    border-radius: 20px ;
    cursor: pointer ;
    font-size: 0.875rem ;
    font-weight: 500 ;
    transition: all 0.3s ease ;
    display: flex ;
    align-items: center ;
    gap: 0.25rem ;
    backdrop-filter: blur(10px) ;
}

.dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.2) ;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dropdown-btn:active {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dropdown-arrow {
    font-size: 0.7rem ;
    transition: 0.3s ease;
}

.dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 8px 25px var(--shadow);
    min-width: 220px;
    z-index: 1000;
    margin-top: 0.5rem;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.dropdown.active .dropdown-content {
    display: block;
}

.dropdown-content a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border);
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover { 
    background: var(--background);
    color: var(--primary);
    padding-left: 0.75rem;
    transform: scale(1.075);
}

.dropdown-content a:active {
    background: var(--background);
    color: var(--primary);
    transform: scale(0.85);
}


.dropdown-content a i {
    font-size: 1rem;
    width: 16px;
    text-align: center;
    color: var(--text-muted);
}

.dropdown-content a:hover i {
    color: var(--primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0;
}

/* Theme Switch Styles */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.theme-switch {
    display: inline-block;
    height: 26px;
    position: relative;
    width: 50px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: var(--border);
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: 0.4s;
}

.slider:before {
    background-color: white;
    bottom: 3px;
    content: "";
    height: 18px;
    left: 4px;
    position: absolute;
    transition: 0.4s;
    width: 18px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.125)
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 34px;
    border: 1px solid transparent;
}

.slider.round:before {
    border-radius: 50%;
    border: 1px solid transparent;
}

/* Admin Page Styles */
.admin-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: rgba(0, 0, 0, 0.7) 0 0 0.6rem;
}

.admin-header h1 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: rgba(0, 0, 0, 0.7) 0 0 0.5rem;
}

.admin-controls {
    display: none;
}

.btn-save {
    background: transparent;
    border: none;
    color: var(--primary);
    padding: 0.3rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 1.5rem;
    transform: scale(1.2);
}
.btn-save:hover {
    transform: scale(1.3);
}
.btn-save:active {
    transform: scale(0.92);
}
.btn-save.saved {
    color: var(--accent);
}

.btn-back {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text);
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
}

.btn-back:active {
    transform: scale(0.90);
}
.admin-main {
    max-width: none;
    margin: 0 auto;
    padding: 0;
}

.config-section, .form-section {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px var(--shadow);
    border: 1px solid var(--border);
}

.config-section h2, .form-section h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text);
    font-size: 1.25rem;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.config-item label {
    font-weight: 500;
    color: var(--text);
}

.config-item input {
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: 0.3s ease;
}

.config-item input:focus {
    outline: none;
    border-color: var(--primary);
}

.config-item .theme-switch-wrapper {
    flex-direction: row;
    gap: 1rem;
    padding: 0.75rem 0;
}

.form-section form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-section label {
    font-weight: 500;
    color: var(--text);
}

.form-section select,
.form-section input {
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: 0.3s ease;
}

.form-section select:focus,
.form-section input:focus {
    outline: none;
    border-color: var(--primary);
}

#btn-guardar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px auto;
}

#btn-guardar:disabled {
    background-color: #a0a0a0; 
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px auto;
}

#btn-guardar:active {
    transform: scale(0.90);
}

#mensaje {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

#mensaje.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

#mensaje.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

main {
    flex: 1;
}

#lista-pendientes {
    display: row;
    gap: 1.2rem;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    border: 2px dashed var(--accent);
    border-radius: 16px;

}

.recurso-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 0.8rem;
    box-shadow: 0 4px 20px var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 15px;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    max-width: fill-available;
}

.recurso-card2.pendiente {
    background: var(--surface);
    border-radius: 16px;
    padding: 0.5rem;
    box-shadow: 0 4px 20px var(--shadow);
    display: inline-flex;
    justify-content: space-between;
    min-height: 15px;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    margin: 10px auto;
    width: 100%;
}

.recurso-card:active {
    transform: scale(0.99);
}

.recurso-card > strong {
    font-size: 0.9rem;
    font-weight: 600;
    display: block;
}

.recurso-card > small {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: block;
}

.recurso-card .btn-download {
    align-items: center;
    margin-top: auto;
}

.btn-download {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    max-width: min-content;
}

.btn-inspecc {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 0.3rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    max-width: 100%;
}

.btn-download:active {
    transform: scale(0.90);
}

.hidden {
    display: none;
}

.header-scrolled .logo {
    height: 25px;
}

/* Animations */

.recurso-card {
    animation: 0.5s ease-out;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 35px;
}

.slider.round:before {
    border-radius: 50%;
}

.hidden { display: none; }



/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recurso-card {
    animation: fadeIn 0.5s ease-in;
}

.grid-layout {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        padding: 0.5rem;
        gap: 1rem;
    }


    @media screen and (min-width: 768px) and (max-width: 1024px) {
        html{
            font-size: 1.2rem;
        }
        .grid-layout {
            grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
            padding: 0.5rem;
            gap: 1rem;
        }
        #busqueda {
            width: 100%;
            max-width: 92%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: auto;
        }
        #searchIcon {
            width: 100%;
            max-width: 10%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: auto;
        }
        .header-main {
            grid-template-columns:1fr;
            gap: 1rem;
            transition: all 0.3s ease;
        }
         .header-left {
            justify-content: center;
            gap: 0.5rem;
        }
        .header-center {
            order: 0;
            gap: 0.5rem;
        }
        .header {
            font-size: 1.5rem;
        }
    }
/* Responsive Design */
@media (max-width: 768px) {
    header {
        padding: 0.8rem;
    }

    .header-main {
        grid-template-columns: 1fr;
        gap: 1rem;
        transition: all 0.3s ease;
    }
    #busqueda {
        width: 100%;
        max-width: 100%;
    }

    .header-left {
        justify-content: center;
            gap: 0.5rem;
    }

    .header-center {
        order: -1;
            gap: 0.5rem;
    }

    .header-right {
        justify-content: flex-end;
    }

    header h1 {
        font-size: 2rem;
    }

    .logo {
        height: 50px;
    }

    .search-container {
        max-width: 100%;
    }

    .top-nav {
        justify-content: center;
        gap: 0.25rem;
    }

    .top-nav button {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }

    /* tablet adjustments for hamburger and search alignment */
    .hamburger-btn {
        display: flex; /* show hamburger at tablet widths */
        margin-left: 0.5rem;
    }
    .mobile-search-btn {
        display: flex !important;
        margin-left: 0.5rem;
    }

    /* Dropdown responsive */
    .dropdown-content {
        min-width: 200px;
        left: 50%;
        transform: translateX(-50%);
    }

    .dropdown-content a {
        padding: 0.8rem 1rem;
        font-size: 0.8rem;
    }

    .grid-layout {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        padding: 0.5rem;
        gap: 1rem;
    }
    .mobile-menu{
        max-width: min-content;
    }
    .form-section {
        transform: scale(0.90);
    }
}

@media (max-width: 480px) {
    header {
        padding: 0;
        border-radius: 16px;
        position: sticky;
        top: 7px;
        z-index: 100;
        width: 97%;
        border: 1px solid rgba(0, 0, 0, 0.1);
    }

    .header-main {
        gap: 0.75rem;
        margin: 0 auto;
        max-width: 97%;
    }

    .header-main2 {
        gap: 0.75rem;
        margin: 0 auto;
        max-width: 97%;  
    }

     .header-left {
        justify-content: center;
        gap: 0.5rem;
    }

     .header-center {
        order: 0;
        gap: 0.5rem;
    }

     .header-right {
        justify-content: flex-end;
    }

    .logo {
        height: 25px;
    }

    .top-nav button {
        min-width: auto;
        flex: 0 0 auto;
        font-size: 0.7rem;
        padding: 0.35rem 0.5rem;
    }

    .grid-layout {
        padding: 0.75rem;
        gap: 0.75rem;
        grid-template: repeat(auto-fill, minmax(173px, 1fr));
    }
    .form-section {
        transform: scale(0.90);
    }
    #lista-pendietes {
        padding: 1px;
    }
    #busqueda {
        width: 100%;
        max-width: 100%;
    }
    
}

@media (max-width: 390px) {
    .grid-layout{
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    #busqueda {
        width: 100%;
        max-width: 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recurso-card {
    animation: fadeIn 0.5s ease-out;

}

/* Card organization */
.recurso-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: auto 10rem;

}

.recurso-card .categoria-tag {
    background: var(--border);
    color: var(--text-muted);
    padding: 0.15rem 0.55rem;
    border-radius: 5px;
    font-size: 0.62rem;
    font-weight: bold;
    text-transform: capitalize;
    width: fit-content;
    border: 1px solid rgba(128, 128, 128, 0.231);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    display: inline-block;
}

.btn-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.btn-remove:hover {
    color: #eb0c0c;
}


/* Title within card header */
.recurso-card .titulo {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    
}

.recurso-card .recurso-titulo {
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--text);
    margin: 0;
    padding: 0;
    line-height: 1.4;
}


/* Hamburger Menu Styles */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 1rem;
}

.mobile-search-btn {
    display: none;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background: var(--text);
    margin: 1px 0;
    transition: all 0.3s ease;
    border-radius: 5px;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: translateY(0.4rem) 
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform:  translateY(-0.4rem)
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(2px);
    background: color-mix(in srgb, var(--background), transparent 92%);
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 240px;
    height: 100%;
    background: color-mix(in srgb, rgb(176, 176, 176), transparent 92%);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    transition: 0.3s ease;
    padding: 2rem 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1001;
    border: 1px solid var(--border);
    
}

.mobile-menu-overlay.active .mobile-menu {
    transform: translateX(0);
}

.mobile-menu-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 60%;
    transition: 0.2s ease;
    
}

.mobile-menu-close:active {
    transform: scale(0.7);

}

.mobile-nav {
    padding: 0 1.5rem;
    margin-top: 3rem;
}

.mobile-nav a,
.mobile-dropdown-btn {
    display: flex;
    align-items: center;
    justify-content: start;
    margin: 1px auto;
    gap: 1rem;
    padding: 1rem;
    color: var(--text);
    text-decoration: none;
    border-radius: 5px;
    transition: 0.2s ease;
    font-weight: 500;
    margin-bottom: 0.5rem;
    background: color-mix(in srgb, var(--background), transparent 40%);
    border: 1px solid rgba(0, 0, 0, 0.076);
    width: 100%;
}

.mobile-dropdown-btn:active {
    transform: scale(0.90);
}

.mobile-dropdown-content {
    margin-top: 1rem;
    display: none;
    
}

.mobile-dropdown-content a {
    padding: 0.75rem 1rem;
    font-size: 0.7rem;
    margin-bottom: 0.25rem;
    border: 2px solid color-mix(in srgb, var(--border), transparent 92%);
    border-radius: 5px;
}

.mobile-dropdown.active .mobile-dropdown-content {
    display: block;
}

.mobile-dropdown-btn i:last-child {
    margin-left: auto;
    transition: 0.3s ease;
}

.mobile-dropdown.active .mobile-dropdown-btn i:last-child {
    transform: rotate(180deg);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    header {
        padding: 0.5rem 0.8rem;
    }

    .header-main {
        grid-template-columns: auto auto;
        gap: 0.5rem;
        align-items: center;
    }


    .header-left {
        gap: 0.5rem;
    }

    .logo {
        height: 35px;
    }

    header h1 {
        font-size: 1.25rem;
        margin: 0;
    }

    .mobile-menu {
        width: 61%;
    }
    .header-center {
        order: 3;
        grid-column: 1 / -1;
        margin-top: 0.5rem;
        display: none; /* Ocultar búsqueda por defecto en móviles */
    }

    .header-center.show-search {
        display: flex;
    }

    .search-container {
        max-width: 100%;
    }

    .search-container input {
        font-size: 0.9rem;
        padding: 0.6rem 2.5rem 0.6rem 2rem;
    }

    .top-nav {
        display: none;
    }

    .hamburger-btn {
        display: flex;
        width: 35px;
        height: 35px;
    }

    .hamburger-line {
        width: 20px;
        height: 2px;
        margin: 1.5px 0;
    }

    .dropdown {
        display: none;
    }

    /* Mobile search toggle */
    .mobile-search-btn {
        display: flex ;
        background: transparent;
        border: none;
        color: var(--text);
        font-size: 1.1rem;
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 50%;
        transition: 0.2s ease;
        color: var(--surface);
    }

    .mobile-search-btn:active {
        transform: scale(0.7);
    }

    /* Admin header responsive */
    .admin-header {
        padding: 0.7rem 0.8rem;
    }

    .admin-header h1 {
        font-size: 1.2rem;
    }

    .btn-back {
        font-size: 0.9rem;
        padding: 0.5rem 0.8rem;
    }
}
.fa-search::before{
    color:var(--text);
}
/* Dark mode adjustments for mobile categories button */
body.dark-mode .mobile-dropdown-btn{
    background: color-mix(in srgb, var(--background), transparent 40%);
    border: 1px solid var(--border);
    color: var(--text);
}
body.dark-mode .mobile-nav a {
    color: var(--text);
    border: 1px solid var(--border);
}

/* ensure icons inside mobile dropdown inherit color */
.mobile-dropdown-btn i {
    color: inherit;
}


header.search-expanded {
    border-radius: 0 0 18px 18px;
}

.estante-vacio {
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 0;
    text-align: center;
    font-weight: bold;
    margin: 1rem 0 0 0;
}
.not-found {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: bold;
    transform: translateY(200px);
}

#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10001;
}

.toast {
    color: var(--text);
    padding: 1rem 1.5rem;
    border-radius: 22px 22px 0 22px;
    margin-top: 10px;
    box-shadow: 0 0 22px rgba(0, 0, 0, 0.259);
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    transition: all 0.3s ease;
    min-width: 280px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(15px);
    background: color-mix(in srgb, rgb(156, 156, 156), transparent 100%);
}

.toast.error { border: 1px solid #ef4444; box-shadow: 0 0 6px #ef4444 }
.toast.success { border: 1px solid #22c55e; box-shadow: 0 0 6px #22c55e }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.form-help{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0.5rem;
    font-style: italic;
}

.admin-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr 1fr));
    gap: 12px;
    
}

.btn-approve {
    background: #22c55e;
    box-shadow: 0 0 4px #22c55e;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    max-width: 100%;
}

.btn-delete {
    background: #ef4444;
    box-shadow: 0 0 4px#ef4444;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    max-width: 100%;
}

.recurso-card.pendiente {
    border: 2px dashed var(--accent); /* Para diferenciar lo que no es público aún */
}
.fas.fa-bookmark{
    margin-right: 2px;
}
.form-group{
    display: none;
}

/* Contenedor específico para el formulario de agregar */
.form-section {
    max-width: 525px;
    margin: 10px auto;
    padding: 30px;
    background: var(--surface);
    border-radius: 20px;
    box-shadow: 0 15px 35px var(--shadow);
    border: 1px solid var(--border);

}

.form-section h2 {
    margin-bottom: 25px;
    color: var(--primary);
    text-align: center;
    font-size: 1.5rem;
    
}

#form-recurso {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#form-recurso label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

#form-recurso input, 
#form-recurso select {
    padding: 12px 15px;
    border-radius: 10px;
    border: 2px solid var(--border);
    background: var(--background);
    color: var(--text);
    transition: all 0.3s ease;
}

#form-recurso input:focus, 
#form-recurso select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.non-books{
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    line-height: 1.4;
    background: var(--surface);
    padding: 0.3rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-style: italic;
}

#btn-guardar {
    background: var(--primary);
    color: white;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s, 0.3s;
    margin-top: 10px;
}

#btn-guardar:active {
    transform: scale(0.90);
}

.form-help {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto;
    gap: 8px;
    margin-top: 5px;
    line-height: 1.4;
    max-width: 320px;
}

.profile-avatar { 
    width: 100px;
    border-radius: 50%;
    box-shadow: 0 0 32px rgba(0, 0, 0, 0.197); 
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto;
    margin-bottom: 1rem;
}

.btn-login-google{
    color: var(--primary);
    border: 2px solid var(--border);
    background: transparent;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.12);
    padding: 10px 15px;
    border-radius: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
    background: var(--background);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

#categoria {
    position: relative;
    width: 100%; /* Se adapta al contenedor padre */
    user-select: none;
}

#filter-categoria {
    position: relative;
    width: 100%;
    user-select: none;
}

.select-trigger {
    background: var(--background);
    color: rgba(0, 0, 0, 0.648);
    padding: 0.6rem 1rem;
    border-radius: 10px;
    border: 2px solid rgba(128, 128, 128, 0.231);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.options-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0; 
    background: var(--option2);
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    list-style: none;
    padding: 0;
    margin: 0;
    margin-top: 0.5rem;
    display: none;
    z-index: 2000;
    overflow-y: auto;
    max-height: 175px;
    border: 2px solid var(--border);
}

.options-list::-webkit-scrollbar {
    width: 6px;
}

.options-list::-webkit-scrollbar-track {
    background: transparent;
}

.options-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.options-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.options-list.active {
    display: block; /* Se muestra al hacer click */
}

.opcion {
    padding: 10px 15px;
    cursor: pointer;
    transition: 0.2s;
    color: var(--text);
    background-color: var(--option);
    border-radius: 10px;
    margin: 0.2rem;
}

.opcion:active {
    background-color: var(--option2);
    transform: scale(0.92);
}

.no-selected {
    color: var(--text-muted);
}
.fas.fa-chevron-down.dropdown-arrow {
    color: var(--text)
}

.btn-logout {
    color: var(--primary);
    border: 2px solid var(--border);
    background: transparent;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.098);
    padding: 10px 15px;
    border-radius: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 45px auto;
    gap: 8px;
    margin-bottom: 0;
}

.btn-logout.active {
    transform: scale(0.80);
}

.btn-login-google {
    display: flex;
    align-items: center;
    margin: 20px auto;
}

#google {
    display: none;
}

.protip {
    display: flex;
    align-items: center;
    margin: 5px 0 30px 10px;
    color: var(--text-muted);
}

#user-name {
    display: flex;
    justify-content: center;
    font-weight: lighter;
    font-size: xx-large;
    color: var(--text);
}

#user-email {
    display: none;
}

.logo2 {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto;
    margin-bottom: 1.5rem;
    transform: scale(1.05);
}

.preferences {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    gap: 10px;
}

.recurso-card.pendiente {
    min-width: 170px;
    max-width: none;
}

.dividor{
    margin: 2rem auto;
    color: var(--dividor);
}

.seccion-biblioteca {
    margin: 1.5rem 0 0.5rem 0;
    display: flex;
    flex-direction: column;
}

.seccion-biblioteca:first-of-type {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(255, 165, 10, 0.08) 100%);
    border-left: 4px solid var(--primary);
    padding: 1rem 0;
    margin-bottom: 1.5rem;
}

.seccion-header h2 {
    font-size: 1.4rem;
    font-weight: 400;
    padding: 0 0.5rem;
    color: var(--text);
    text-transform: capitalize;
}

#secciones-dinamicas {
    display: block;
    width: 100%;
    min-height: 200px;
    padding: 0;
}

.seccion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 1.5rem;
}

.carrete-scroll {
    display: flex;
    overflow-x: auto;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;

}

.carrete-scroll .recurso-card {
    min-width: 200px; 
    max-width: 200px;
    flex: 0 0 auto;
    margin-bottom: 10px;
}

.carrete-scroll::-webkit-scrollbar { display: none; }

.skeleton-card {
    min-width: 200px;
    height: 200px;
    background: var(--border);
    border-radius: 12px;
    animation: skeleton-blink 0.35s infinite alternate;
}

@keyframes skeleton-blink {
    from { opacity: 0.4; }
    to { opacity: 0.8; }
}

.seccion-horizontal .recurso-card {
    min-width: 220px; 
    max-width: 220px;
    flex: 0 0 auto;
}

.seccion-horizontal-skeleton {
    width: 100%;
    display: block;
}

#main-footer {
    background: var(--footer); 
    color: var(--text);
    padding: 40px 10px 10px;
    margin-top: 50px;
    border-top: 1px solid var(--border);
    box-shadow: 0 0 20px var(--shadow);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-logo {
    height: 40px;
    margin-bottom: 15px;
}

.footer-section h2 {
    margin-bottom: 20px;
    font-size: 1.1rem;
    text-align: center;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.PCE {
    text-align: center;
}

.footer-section a {
    color: var(--text-muted);
    text-decoration: none;
    transition: 0.3s;

}

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

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.social-icons {
    display: flex;
    gap: 15px;
    font-size: 1.2rem;
    margin-top: 15px;
}

.BaseCode {
    color: var(--text);
}

.footer-section {
    padding: 0.5rem;
    border-radius: 5px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.074);
    background: var(--footer);
    color: var(--text-muted);
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px auto;
    transform: scale(1.3);
}

.contacts{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr 1fr));
    gap: 10px;
    color: var(--text-muted);
}


.contenedor-horizontal {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 20px;
    padding-bottom: 15px;
}


.contenedor-horizontal::-webkit-scrollbar {
    height: 5px; 
}

.contenedor-horizontal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2); 
    border-radius: 10px;
}

.contenedor-horizontal::-webkit-scrollbar-thumb:hover {
    background: var(--primary); 
}

@keyframes modalBackdropFade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalContentEnter {
    from {
        opacity: 0;
        transform: translateY(35px) scale(0.5);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: color-mix(in srgb, var(--background), transparent 92%);
    backdrop-filter: blur(12px); 
    display: none; 
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: modalBackdropFade 0.3s ease-out;
}

.modal-content {
    background: color-mix(in srgb, var(--bg-card), transparent 92%);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 20px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 5px 40px rgba(0,0,0,0.4);
    transition: 0.3s;
    overflow: visible;
}

.modal-overlay.active .modal-content {
    animation: modalContentEnter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-icon {
    font-size: 3rem;
    color: color-mix(in srgb, var(--primary), transparent 25%);
    margin-bottom: 1rem;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 1.5rem;
}

.btn-modal-primary, .btn-modal-secondary {
    flex: 1;
    padding: 8px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: 0.3s;
    box-shadow:0 0 20px rgba(0, 0, 0, 0.238);
}

.btn-modal-primary { background: var(--primary); color: white; }
.btn-modal-secondary { background: var(--border); color: var(--text); }

.btn-modal-primary:hover { opacity: 0.9; transform: scale(1.02); }
.btn-modal-secondary:hover { opacity: 0.9; transform: scale(1.02); }

.btn-modal-primary:active { opacity: 0.9; transform: scale(1.02); }
.btn-modal-secondary:active{ opacity: 0.9; transform: scale(1.02); }

.loader-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.5rem;
}

.loader-container.hidden {
    display: none;
}

.loader-win11 {
    width: 24px;
    height: 24px;
    border: 3px solid transparent;
    border-top: 3px solid var(--text);
    border-right: 3px solid var(--text);
    border-radius: 67%;
    animation: spin-win11 0.8s linear infinite;
}

@keyframes spin-win11 {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.btn-filtro {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text);
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 400;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.161);
    margin-right: 0.6rem;
}

.btn-filtro:active {
    transform: scale(0.95);
}

.btn-filtro i {
    font-size: 1rem;
}

/* Mobile Loader Container */
.loader-container-mobile {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
    height: 30px;
}

.loader-container-mobile.hidden {
    display: none;
}

@media (max-width: 768px) {
    .loader-container-mobile {
        display: flex;
    }
    
    .loader-container-mobile.hidden {
        display: none;
    }
}

.no-results {
    text-align: center;
    padding: 0;
    color: var(--text-muted);
    font-size: 1.01rem;
    font-weight: bold;
}

#no-results-icon {
            font-size: 80px;
            color: var(--text-muted);
            box-sizing: border-box;
            margin-bottom: 10px;
            animation: float 3s ease-in-out infinite;
        }

        @keyframes float {
            0%, 100% {
                transform: translateY(0px);
            }
            50% {
                transform: translateY(-15px);
            }
        }
    
.books {
            display: block;
            text-align: center;
            margin: 0;
            font-size: 4rem;
            line-height: 1;
            color: var(--text-muted);
            animation: float 3s ease-in-out infinite;
        }

        @keyframes float {
            0%, 100% {
                transform: translateY(5px);
            }
            50% {
                transform: translateY(-10px);
            }
        }

.btn-comentarios-flotante {
    position: fixed;
    bottom: 12px;
    left: 12px;
    width: 60px;
    height: 60px;
    border-radius: 40% 40% 40% 18%;
    background: color-mix(in srgb, var(--primary) , transparent 35%);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.btn-comentarios-flotante:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 99, 235, 0.5);
}

.btn-comentarios-flotante:active {
    transform: scale(0.925);
}

@media (max-width: 768px) {
    .btn-comentarios-flotante {
        bottom: 12px;
        left: 12px;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

/* Estilos para comentarios */
.comentarios-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comentario-card {
    background: var(--background);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px var(--shadow);
    transition: all 0.3s ease;
}

.comentario-card:hover {
    box-shadow: 0 4px 16px var(--shadow);
    transform: translateY(-2px);
}

.comentario-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.comentario-autor {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.comentario-fecha {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.comentario-mensaje {
    color: var(--text);
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.comentarios-vacio {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-style: italic;
}