:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    z-index: 1; /* Bajo z-index para las cards */
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 2 !important; /* Ligeramente más alto en hover, pero aún muy bajo */
}

/* Asegurar que ninguna card pueda interferir con la búsqueda */
.movie-card,
.movie-card:hover,
.card.movie-card,
.card.movie-card:hover {
    z-index: 1 !important;
    max-width: 100%;
    position: relative;
}

.movie-card {
    height: 100%;
}

.movie-poster {
    height: 400px;
    object-fit: cover;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.movie-info {
    padding: 1rem;
}

.rating {
    color: #ffc107;
}

.group-card {
    margin-bottom: 1.5rem;
}

.group-header {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-card {
    border-left: 4px solid var(--primary-color);
    background-color: #f8f9fa;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.comment-author {
    font-weight: 600;
    color: var(--primary-color);
}

.comment-date {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.search-container {
    position: relative;
    z-index: 1050; /* Asegurar que esté por encima de otros elementos */
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1051; /* Más alto que el contenedor */
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15); /* Sombra más pronunciada */
}

.search-item {
    padding: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-item:hover {
    background-color: #f8f9fa;
}

.search-item:last-child {
    border-bottom: none;
}

.search-poster {
    width: 60px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

/* Asegurar que los elementos de búsqueda estén siempre por encima */
.search-container {
    position: relative;
    z-index: 1050 !important; /* Bootstrap navbar es 1030, modals son 1055 */
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1055 !important; /* Más alto que todo */
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Asegurar que TODOS los elementos dentro de search-results tengan z-index alto */
.search-results *,
.search-item,
.search-item * {
    position: relative;
    z-index: 1056 !important;
}

.btn-floating {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 1.5rem;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    padding: 4rem 0;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
    min-height: 70vh;
}

.hero-bg {
    background-blend-mode: overlay;
    transition: transform 0.3s ease;
}

.hero-section:hover .hero-bg {
    transform: scale(1.02);
}

.min-vh-50 {
    min-height: 50vh;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    line-height: 1.6;
}

.navbar-brand img {
    transition: transform 0.2s ease;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.logo-responsive {
    max-width: 100%;
    height: auto;
}

/* Logo animations */
@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

.logo-float {
    animation: logoFloat 3s ease-in-out infinite;
}

.feature-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.stats-card {
    text-align: center;
    padding: 2rem;
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.spinner-border {
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .movie-poster {
        height: 300px;
    }
    
    .btn-floating {
        bottom: 1rem;
        right: 1rem;
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Efectos de hover para botones */
.btn {
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Estilo para badges */
.badge {
    font-size: 0.75rem;
}

/* Estilo para formularios */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Estilo para tabs */
.nav-tabs .nav-link.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Estilo para modales */
.modal-header {
    background-color: var(--primary-color);
    color: white;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* Estilos para la sección de actividad */
.activity-feed {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
}

.activity-feed::-webkit-scrollbar {
    width: 6px;
}

.activity-feed::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.activity-feed::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.activity-feed::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s;
}

.activity-item:hover {
    background-color: #f8f9fa;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-avatar {
    flex-shrink: 0;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-header {
    margin-bottom: 6px;
    line-height: 1.4;
}

.activity-action {
    color: var(--secondary-color);
    font-weight: normal;
}

.activity-group {
    color: var(--secondary-color);
    font-size: 0.9em;
}

.activity-rating {
    margin-bottom: 8px;
}

.activity-rating .bi-star-fill {
    color: #ffc107;
}

.activity-rating .bi-star {
    color: #dee2e6;
}

.rating-text {
    margin-left: 6px;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.9em;
}

.activity-comment {
    font-style: italic;
    color: var(--dark-color);
    margin-bottom: 8px;
    padding: 8px;
    background-color: #f8f9fa;
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
}

.activity-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85em;
    color: var(--secondary-color);
    flex-wrap: wrap;
    align-items: center;
}

.activity-meta i {
    margin-right: 4px;
}

.activity-type-badge {
    background: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
    border: 1px solid rgba(var(--primary-color-rgb), 0.2);
}

.activity-type-badge i {
    margin-right: 2px;
}

.activity-poster {
    flex-shrink: 0;
}

.poster-thumbnail {
    width: 50px;
    height: 75px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.activity-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: var(--secondary-color);
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.activity-placeholder h5 {
    color: var(--dark-color);
    margin-bottom: 8px;
}

.placeholder-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Estilos para gestión de miembros */
.member-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.member-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.modal-lg .nav-tabs {
    border-bottom: 2px solid #e9ecef;
}

.modal-lg .nav-tabs .nav-link {
    border: none;
    color: var(--secondary-color);
    font-weight: 500;
    padding: 12px 20px;
}

.modal-lg .nav-tabs .nav-link.active {
    background-color: var(--primary-color);
    color: white;
    border-radius: 6px 6px 0 0;
}

.modal-lg .nav-tabs .nav-link:hover:not(.active) {
    background-color: #f8f9fa;
    border-radius: 6px 6px 0 0;
}

.search-results-container {
    max-height: 200px;
    overflow-y: auto;
    border-radius: 4px;
}

.list-group-item-action:hover {
    background-color: #f8f9fa;
}

.selected-user-card {
    background-color: #e7f3ff;
    border: 1px solid var(--primary-color);
}

.member-actions .dropdown-menu {
    min-width: 160px;
}

.member-actions .dropdown-item {
    padding: 8px 16px;
    font-size: 0.9em;
}

.member-actions .dropdown-item:hover {
    background-color: #f8f9fa;
}

.member-badge {
    font-size: 0.75em;
    padding: 4px 8px;
}