/* Estilos para el sidebar de usuario */
.sidebar-container {
    padding-right: 0;
}

.user-sidebar {
    transition: all 0.3s ease;
    z-index: 1040;
    padding-top: 0; /* Ajustado para coincidir con el diseño original */
}

.user-sidebar .list-group-item {
    transition: all 0.2s ease;
    border-radius: 0.25rem;
    margin-bottom: 2px;
}

.user-sidebar .list-group-item:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

.user-sidebar .list-group-item.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

/* Estilos para la página principal */
#mainContent {
    transition: all 0.3s ease;
}

#mainContent .card {
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

#mainContent .card:hover {
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

#mainContent .card-header {
    border-bottom: none;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.02);
}

#mainContent .btn-sm {
    border-radius: 50rem;
    padding: 0.25rem 0.7rem;
}

/* Estilos para destacar snippets recientes */
.recent-snippet {
    border-left: 4px solid #0d6efd;
}

/* Estilo para tarjetas de estadísticas */
.stats-card {
    min-height: 120px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 0.5rem;
    transition: all 0.3s ease-in-out;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

.stats-card .stats-icon {
    font-size: 2rem;
    opacity: 0.7;
    position: absolute;
    top: 10px;
    right: 10px;
}

.stats-card .stats-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0;
    margin-top: auto;
}

.stats-card .stats-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0;
    opacity: 0.8;
}

/* Badge de estado del snippet */
.badge-private {
    background-color: #dc3545;
}

.badge-public {
    background-color: #28a745;
}

/* Botones de acción para snippets */
.btn-snippet-action {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.btn-snippet-action:hover {
    transform: scale(1.1);
}

/* Estilos para los filtros */
.filter-container {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.filter-badge {
    font-size: 0.875rem;
    padding: 0.5em 0.75em;
    margin-right: 0.5rem;
    border-radius: 50rem;
    background-color: #f8f9fa;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
}

.filter-badge:hover, .filter-badge.active {
    background-color: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

/* Animación para nuevo snippet */
@keyframes highlightNew {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

.new-snippet {
    animation: highlightNew 2s ease-out;
}

/* Placeholder para código vacío */
.empty-code-placeholder {
    text-align: center;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    color: #6c757d;
}

/* Estilos para el sidebar en dispositivos móviles */
@media (max-width: 991.98px) {
    .sidebar-mobile {
        position: fixed;
        top: 56px; /* Debajo de la navbar */
        left: -100%;
        width: 280px !important;
        height: calc(100% - 56px); /* Altura ajustada */
        transition: left 0.3s ease;
        background-color: #ffffff;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
        overflow-y: auto;
        z-index: 1040;
    }
    
    .sidebar-mobile.show {
        left: 0;
    }
    
    body.sidebar-open {
        overflow: hidden;
    }
    
    #mainContent {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        transition: all 0.3s ease;
    }
    
    #sidebarToggle {
        display: block;
    }
    
    #closeSidebar {
        display: block;
    }
}

@media (min-width: 992px) {
    #sidebarToggle {
        display: none;
    }
    
    /* Mostramos el botón de cerrar en todas las resoluciones */
    #closeSidebar {
        display: block;
        position: absolute;
        top: 15px;
        right: 15px;
    }
    
    #sidebarOverlay {
        display: none !important;
    }
}

/* Estilos para la página de perfil */
.stats-card {
    min-height: 120px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 0.5rem;
    transition: all 0.3s ease-in-out;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

.stats-card .stats-icon {
    font-size: 2rem;
    opacity: 0.7;
    position: absolute;
    top: 10px;
    right: 10px;
}

.stats-card .stats-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0;
    margin-top: auto;
}

.stats-card .stats-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0;
    opacity: 0.8;
}

/* Correcciones específicas para la página de perfil */
.profile-page .user-sidebar {
    position: fixed;
    top: 56px; /* Debajo de la navbar */
    height: calc(100vh - 56px - 70px); /* Ajustar altura considerando navbar y footer */
    overflow-y: auto;
}

/* Asegurar que el contenido principal no quede detrás de la navbar */
.profile-page #mainContent {
    margin-top: 0; /* La navbar fija ya maneja el espacio */
    padding-bottom: 90px; /* Espacio para el footer fijo */
}

/* Corrección para el overlay en móviles */
@media (max-width: 991.98px) {
    #sidebarOverlay {
        position: fixed;
        top: 56px; /* Debajo de la navbar */
        left: 0;
        width: 100%;
        height: calc(100% - 56px);
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1039; /* Justo debajo del sidebar */
        display: none;
    }
    
    #sidebarOverlay.show {
        display: block;
    }
}

/* Estilos para campos de formulario */
.form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* Animación para mensajes de alerta */
.alert {
    animation: slideDown 0.3s ease-out forwards;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mejorar los botones del formulario */
.btn {
    transition: all 0.3s ease;
}

.btn-primary {
    box-shadow: 0 4px 6px rgba(13, 110, 253, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(13, 110, 253, 0.3);
}

.btn-outline-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Estilos para las preferencias de usuario */
.theme-card, .privacy-card {
    transition: all 0.3s ease;
    height: 100%;
}

.theme-options {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1rem 0;
}

.theme-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 1rem;
    position: relative;
}

.theme-preview:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.theme-preview.light {
    background-color: #f8f9fa;
    color: #212529;
    border: 2px solid #dee2e6;
}

.theme-preview.dark {
    background-color: #212529;
    color: #f8f9fa;
    border: 2px solid #444444;
}

.theme-preview.light:hover {
    border-color: #0d6efd;
}

.theme-preview.dark:hover {
    border-color: #0d6efd;
}

.theme-icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.theme-label {
    font-weight: 500;
}

/* Hacer que el input de radio sea invisible pero siga siendo accesible */
.theme-options .form-check-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Estilos para tema seleccionado */
.theme-options .form-check-input:checked + .theme-preview {
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px #0d6efd;
}

.theme-options .form-check-input:checked + .theme-preview::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #0d6efd;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

/* Estilos para el interruptor de privacidad */
.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.form-switch .form-check-input {
    width: 3em;
    margin-left: -3.5em;
    height: 1.5em;
}

.form-switch .form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Animación para cambio de tema */
.theme-transition {
    transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease !important;
}

/* Mejoras para el botón de cerrar */
#closeSidebar {
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

#closeSidebar:hover {
    opacity: 1;
    transform: scale(1.1);
    background-color: rgba(0, 0, 0, 0.2);
}

/* En tema oscuro */
.dark-theme #closeSidebar {
    background-color: rgba(255, 255, 255, 0.2);
}

.dark-theme #closeSidebar:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Estilos para el botón personalizado de cerrar */
.btn-close-custom {
    background-color: transparent;
    border: none;
    font-size: 1.2rem;
    color: var(--text-color, #333);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    opacity: 0.7;
    cursor: pointer;
}

.btn-close-custom:hover {
    background-color: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
    opacity: 1;
}

/* En tema oscuro */
.dark-theme .btn-close-custom {
    color: var(--dark-text-color, #e1e1e1);
}

.dark-theme .btn-close-custom:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Estilos mejorados para la página de perfil */
.profile-page .card {
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    overflow: hidden;
}

.profile-page .card-header {
    padding: 1.25rem;
}

.profile-page .card.shadow {
    border-radius: 0.5rem;
}

.profile-page .card.border-warning {
    border-left: 4px solid var(--warning-color, #ffc107) !important;
}

.profile-page .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.profile-page .btn-primary {
    transition: all 0.3s ease;
}

.profile-page .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.4);
}

.profile-page .theme-options {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.profile-page .theme-preview {
    padding: 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 100px;
}

.profile-page .theme-preview:hover {
    transform: translateY(-3px);
}

.profile-page .theme-preview.light {
    background-color: #f8f9fa;
    color: #212529;
}

.profile-page .theme-preview.dark {
    background-color: #212529;
    color: #f8f9fa;
}

.profile-page .theme-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.profile-page .privacy-card {
    height: 100%;
}

/* Estilos para el área de contenido del perfil */
.profile-content-area {
    width: 100%;
    padding: 10px;
    background-color: var(--bg-color, #f8f9fa);
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.dark-theme .profile-content-area {
    background-color: var(--dark-bg-secondary, #2d2d2d);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

/* Aumentar la especificidad para el contenido principal */
.profile-page #mainContent.content-wrapper {
    padding-left: 30px;
}

/* Corregir posicionamiento del sidebar y contenido principal */
.sidebar-container {
    position: relative;
    min-height: calc(100vh - 56px - 70px);
}

.content-wrapper {
    padding-top: 20px;
    margin-left: 0;
}

/* Ajustes responsivos para perfil */
@media (min-width: 992px) {
    .profile-page .user-sidebar {
        position: static;
        height: auto;
        overflow: visible;
        margin-bottom: 20px;
    }
    
    .profile-page #userSidebar {
        position: static;
    }
}

/* Ajustes específicos para la página de perfil */
.profile-page .container-fluid.main-content {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}

.profile-page .content-wrapper {
    padding-left: 30px;
}

/* Corregir el overlap del sidebar */
@media (max-width: 991.98px) {
    .profile-page #mainContent {
        width: 100%;
        margin-left: 0;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .profile-page .sidebar-container {
        padding: 0;
    }
    
    .profile-page .sidebar-mobile {
        position: fixed;
        left: -100%;
    }
}

/* Evitar solapamiento en la página de perfil */
.row.g-0 {
    --bs-gutter-x: 0;
    width: 100%;
}

.profile-page .col-lg-9.content-wrapper {
    position: relative;
    z-index: 1010; /* Mayor que sidebar pero menor que navbar */
}

/* Asegurar que el footer no se superponga */
.profile-page .main-content {
    padding-bottom: 80px;
}

/* Añadir margen a elementos principales */
.profile-page .card {
    margin-bottom: 25px;
}

/* Mejorar visualización en móviles */
@media (max-width: 767.98px) {
    .profile-page .card-body {
        padding: 15px;
    }

    .profile-page .container-fluid.main-content {
        padding-left: 5px;
        padding-right: 5px;
    }
}
