* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Arial, sans-serif;
    transition: background-color var(--transition-speed),
                color var(--transition-speed),
                border-color var(--transition-speed),
                box-shadow var(--transition-speed);
}

:root {
    --transition-speed: 0.3s;
    --bg-dark: #f0f2f5;
    --bg-darker: #ffffff;
    --text-light: #1a1b1e;
    --text-gray: #4b5563;
    --primary-blue: #3b82f6;
    --accent-dark: #2563eb;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --overlay-color: rgba(255, 255, 255, 0.35);
}

/* Degradado para el fondo de la página */
body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e5e9f2 100%);
    min-height: 100vh;
}

/* Header styles */
header, .circles-container, .bottom-section {
    position: relative;
    z-index: 1;
}

header {
    background-color: var(--bg-darker);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-image {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.logo {
    color: var(--text-light);
    font-weight: bold;
    font-size: 1.2rem;
}

.search-bar {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.search-bar input {
    padding: 0.8rem;
    border: none;
    border-radius: 20px;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logout-button {
    background-color: transparent;
    border: 1px solid var(--primary-blue);
    color: var(--primary-blue);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.logout-button:hover {
    background-color: var(--primary-blue);
    color: white;
}

#userName {
    font-weight: 500;
    color: var(--text-light);
}

/* Main container styles */
.admin-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem 70px 1rem; /* Padding bottom for nav bar */
}

/* Section styles */
.admin-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 2rem;
    margin-bottom: 2rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 1; /* Cambiado de 0 a 1 */
    transform: translateY(0); /* Cambiado de 20px a 0 */
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.admin-section:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-light);
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-blue);
}

.section-title i {
    color: var(--primary-blue);
}

/* Menu styles */
.menu-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.menu-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 10px;
}

.menu-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.menu-header {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    background: white;
    color: var(--text-light);
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin-bottom: 5px;
    border-left: 3px solid transparent;
}

.menu-header:hover, 
.menu-header.active {
    background: var(--primary-blue);
    color: white;
    border-left-color: var(--primary-blue);
    border-left-width: 5px;
    padding-left: calc(1.5rem - 2px);
}

.menu-header.active {
    background: var(--primary-blue);
    color: white;
    border-radius: 8px 8px 0 0;
}

.menu-header i:first-child, 
.submenu a i, 
.card-icon i,
.tool-header i {
    transition: transform 0.3s ease;
}

.menu-header:hover i:first-child,
.submenu a:hover i,
.quick-card:hover .card-icon i {
    transform: scale(1.2);
}

.menu-header i:last-child {
    margin-left: auto;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.menu-header.active i:last-child {
    transform: rotate(180deg);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--bg-dark);
    border-radius: 0 0 8px 8px;
}

.submenu a {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.5rem 0.8rem 3.5rem;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.submenu a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.submenu a:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-blue);
    border-left: 3px solid var(--primary-blue);
}

/* Panel Rápido styles */
.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 25px;
}

.quick-card {
    background: white;
    border-radius: 12px;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-light);
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(15px);
}

.quick-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--primary-blue);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quick-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 12px 20px rgba(59, 130, 246, 0.15);
}

.quick-card:hover::before {
    opacity: 1;
}

.card-icon {
    width: 65px;
    height: 65px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    color: var(--primary-blue);
    font-size: 1.7rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card-icon::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    opacity: 0;
    transform: scale(0.5);
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.quick-card:hover .card-icon::after {
    opacity: 0.7;
    transform: scale(1);
}

.quick-card:hover .card-icon {
    background: var(--primary-blue);
    color: white;
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}

.card-title {
    font-weight: 600;
    font-size: 1.05rem;
    margin-top: 5px;
    text-align: center;
    transition: all 0.3s ease;
}

.quick-card:hover .card-title {
    color: var(--primary-blue);
}

/* Herramientas Especiales styles */
.tools-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.tool-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(15px);
}

.tool-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-5px);
}

.tool-header {
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-dark));
    color: white;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
}

.tool-card:hover .tool-header {
    background: linear-gradient(135deg, var(--accent-dark), var(--primary-blue));
}

.tool-header::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.1) 100%);
    transform: skewX(-25deg) translateX(100%);
    transition: transform 0.5s ease;
}

.tool-card:hover .tool-header::after {
    transform: skewX(-25deg) translateX(70%);
}

.tool-header i {
    font-size: 1.4rem;
    background: rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.tool-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tool-content p {
    color: var(--text-gray);
    margin-bottom: 20px;
    line-height: 1.5;
    font-size: 0.95rem;
    flex: 1;
}

.sync-button, .tool-button {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    max-width: fit-content;
}

.sync-button:hover, .tool-button:hover {
    background: var(--accent-dark);
    box-shadow: 0 6px 10px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.tool-buttons {
    display: flex;
    gap: 12px;
    margin-top: auto;
    flex-wrap: wrap;
}

/* Efecto de pulsación para los botones */
.sync-button:active, .tool-button:active {
    transform: scale(0.97);
}

/* Navigation bar styles */
.navigation-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding: 5px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-item {
    color: var(--text-gray);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary-blue);
}

.nav-item i {
    font-size: 1.5em;
}

/* Responsive styles */
@media (max-width: 992px) {
    .quick-access-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 0.5rem 1rem;
        height: auto;
        flex-direction: column;
        gap: 0.5rem;
    }

    .logo-container {
        width: 100%;
        justify-content: center;
    }

    .logo-image {
        height: 30px;
    }

    .logo {
        font-size: 1rem;
    }

    .search-bar {
        width: 100%;
        margin: 0.5rem 0;
    }

    .search-bar input {
        width: 100%;
        padding: 0.6rem;
    }

    .admin-section {
        padding: 1rem;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .menu-header, .menu-link {
        padding: 0.8rem 1rem;
    }

    .submenu a {
        padding: 0.8rem 1rem 0.8rem 2.5rem;
    }

    .quick-access-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 15px;
    }
    
    .card-icon {
        width: 55px;
        height: 55px;
        font-size: 1.5rem;
    }
    
    .card-title {
        font-size: 0.95rem;
    }
    
    .tool-header {
        padding: 15px;
        font-size: 1rem;
    }
    
    .tool-header i {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
    
    .tool-content {
        padding: 15px;
    }

    .tools-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .admin-container {
        margin: 1rem auto;
    }

    .quick-access-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .card-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
        margin-bottom: 10px;
    }
    
    .card-title {
        font-size: 0.85rem;
    }
    
    .tool-card {
        max-width: 100%;
    }
    
    .sync-button, .tool-button {
        padding: 8px 15px;
        font-size: 0.8rem;
        width: 100%;
    }

    .menu-item.small {
        width: 100%;
    }
}

/* Fix para el scroll en iOS */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }
    
    .navigation-bar {
        padding-bottom: max(5px, env(safe-area-inset-bottom));
    }
}

/* Ajustes generales para dispositivos móviles */
@media screen and (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    body {
        overscroll-behavior-y: none; /* Previene el bounce en algunos navegadores */
    }

    /* Asegura que el contenido sea scrolleable */
    main {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Ajustes para pantallas muy pequeñas */
@media screen and (max-width: 360px) {
    .quick-access-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .card-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    .card-title {
        font-size: 0.8rem;
    }
}

/* Orientación landscape en móviles */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .admin-container {
        margin: 1rem auto;
    }

    .admin-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .quick-access-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .tools-container {
        grid-template-columns: repeat(3, 1fr);
    }
}