/* Reset y estilos base */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    height: 100%;
    width: 100%;
    overflow-x: hidden;
    background-color: #f2f2f7;
    /* Fondo gris claro de iOS */
    color: #000;
    font-size: 17px;
    /* Tamaño de texto estándar de iOS */
    line-height: 1.4;
}

/* Barra superior (navbar) - Estilo iOS */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 44px;
    background-color: rgba(255, 255, 255, 0.85);
    /* iOS usa fondos translúcidos */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #000;
    display: flex;
    align-items: center;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.2);
    padding: 0 10px;
    z-index: 1000;
}

.navbar-title {
    flex: 1;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
}

.navbar-button {
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #007aff;
    /* Azul de iOS */
    font-weight: 400;
    padding: 0 10px;
    font-size: 17px;
}

.navbar-button:active {
    opacity: 0.7;
}

/* Barra inferior (tabbar) - Estilo iOS */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 49px;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    border-top: 0.5px solid rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.tab-button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
    color: #8e8e93;
    /* Color gris para íconos inactivos en iOS */
    font-size: 10px;
    cursor: pointer;
}

.tab-button.active {
    color: #007aff;
    /* Azul de iOS para íconos activos */
}

.tab-button-icon {
    font-size: 24px;
    margin-bottom: 2px;
}

/* Panel lateral - Estilo iOS */
.side-panel {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 280px;
    background-color: #f2f2f7;
    /* Fondo de iOS */
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.side-panel.open {
    transform: translateX(0);
}

.side-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1999;
}

.side-panel-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.side-panel-header {
    height: 110px;
    background-color: #f2f2f7;
    color: #000;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px 16px;
}

.side-panel-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.side-panel-subtitle {
    font-size: 15px;
    color: #8e8e93;
}

.side-panel-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: white;
    margin-top: 20px;
    border-radius: 10px;
    margin-left: 16px;
    margin-right: 16px;
    overflow: hidden;
}

.side-panel-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative; /* Para poder posicionar el indicador de actualización */
}

.side-panel-item:last-child {
    border-bottom: none;
}

.side-panel-item:active {
    background-color: rgba(0, 0, 0, 0.05);
}

.side-panel-item-icon {
    margin-right: 16px;
    width: 24px;
    text-align: center;
    color: #007aff;
}

/* Estilo específico para el botón de actualización en el panel lateral */
#updateButton .side-panel-item-icon {
    color: #34c759; /* Color verde de iOS para destacar */
}

/* Indicador de actualización disponible */
#updateButton::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background-color: #ff3b30; /* Rojo de iOS */
    border-radius: 50%;
    position: absolute;
    top: 12px;
    right: 16px;
}

/* Animación de pulso para el botón de actualización */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

#updateButton {
    animation: pulse 2s infinite ease-in-out;
}

/* Contenido principal */
.content {
    padding: 60px 16px 65px 16px;
    /* espacio para navbar y tabbar */
    max-width: 100%;
    margin: 0 auto;
}

/* Tarjetas - Estilo iOS */
.card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
    overflow: hidden;
}

.card-header {
    padding: 14px 16px;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
}

.card-content {
    padding: 16px;
    font-size: 17px;
}

.card-footer {
    padding: 12px 16px;
    display: flex;
    justify-content: flex-end;
    border-top: 0.5px solid rgba(0, 0, 0, 0.1);
}

/* Listas - Estilo iOS */
.list {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
    overflow: hidden;
}

.list-header {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #8e8e93;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 16px;
    margin-bottom: 8px;
}

.list-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    min-height: 44px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
    background-color: white;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:active {
    background-color: rgba(0, 0, 0, 0.05);
}

.list-item-content {
    flex: 1;
}

.list-item-after {
    color: #8e8e93;
    margin-left: 16px;
}

/* Botones - Estilo iOS */
.button {
    display: inline-block;
    background-color: #007aff;
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s;
    text-decoration: none;
}

.button:active {
    background-color: #0062cc;
    opacity: 0.9;
}

.button-block {
    display: block;
    width: 100%;
    margin-bottom: 16px;
}

.button-outline {
    background-color: transparent;
    color: #007aff;
    border: 1px solid #007aff;
}

.button-outline:active {
    background-color: rgba(0, 122, 255, 0.1);
}

/* Títulos - Estilo iOS */
h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
    margin-top: 0;
}

h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    margin-top: 0;
}

h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    margin-top: 0;
}

/* Tabs */
.tabs {
    position: relative;
    height: 100%;
}

.tab {
    display: none;
}

.tab.active {
    display: block;
}

/* Toggle switch - Estilo iOS */
.toggle {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e5ea;
    border-radius: 31px;
    transition: .4s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 27px;
    width: 27px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: .4s;
}

input:checked+.toggle-slider {
    background-color: #34c759;
    /* Verde de iOS para toggle activo */
}

input:checked+.toggle-slider:before {
    transform: translateX(20px);
}

/* Utilidades */
.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

/* Modo oscuro - Estilo iOS Dark Mode */
.dark-mode {
    background-color: #000;
    color: #fff;
}

.dark-mode .navbar {
    background-color: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.dark-mode .tabbar {
    background-color: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top-color: rgba(255, 255, 255, 0.2);
}

.dark-mode .tab-button:not(.active) {
    color: #8e8e93;
}

.dark-mode .card,
.dark-mode .list {
    background-color: #1c1c1e;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.dark-mode .card-header,
.dark-mode .card-footer,
.dark-mode .list-item {
    border-color: rgba(255, 255, 255, 0.15);
}

.dark-mode .side-panel {
    background-color: #000;
}

.dark-mode .side-panel-list {
    background-color: #1c1c1e;
}

.dark-mode .side-panel-header {
    background-color: #000;
    color: #fff;
}

.dark-mode .side-panel-item {
    border-color: rgba(255, 255, 255, 0.15);
}

.dark-mode .side-panel-item:active {
    background-color: rgba(255, 255, 255, 0.05);
}

.dark-mode .toggle-slider {
    background-color: #636366;
}

.dark-mode .list-item:active {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Diseño para instalar botón */
#installBtn {
    display: none;
}

/* Toast de iOS */
.ios-toast {
    position: fixed;
    left: 50%;
    bottom: 80px;
    transform: translateX(-50%) translateY(100px);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s, opacity 0.3s;
    opacity: 0;
    z-index: 9999;
    font-weight: 400;
    font-size: 15px;
    max-width: 80%;
}

.ios-toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Segmented control - Estilo iOS */
.segmented-control {
    display: flex;
    background-color: rgba(120, 120, 128, 0.16);
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.segment {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: #000;
    transition: background-color 0.2s;
}

.segment.active {
    background-color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.dark-mode .segmented-control {
    background-color: rgba(120, 120, 128, 0.32);
}

.dark-mode .segment {
    color: #fff;
}

.dark-mode .segment.active {
    background-color: #1c1c1e;
}

/* Badge - Estilo iOS */
.badge {
    display: inline-block;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    border-radius: 10px;
    background-color: #ff3b30;
    color: white;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    padding: 0 6px;
}

/* Botón de actualización flotante */
.update-button {
    position: fixed;
    bottom: 70px;
    right: 20px;
    background-color: #007aff;
    color: white;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    animation: pulse 2s infinite ease-in-out; /* Añadimos la animación */
}

.update-button:active {
    transform: scale(0.95);
    opacity: 0.9;
}

.update-button.hidden {
    display: none;
}

.update-button i {
    font-size: 24px;
}

/* Versión modo oscuro para el botón de actualización */
.dark-mode .update-button {
    background-color: #0A84FF; /* Azul más brillante para modo oscuro */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}