body {
  background: linear-gradient(to bottom right, #f1f4f9, #dff1ff);
}

.glass-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 1.5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  transition: all 0.3s ease;
}

.glass-card:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.profile-img {
  max-height: 280px;
  border-radius: 1rem;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.form-control {
  border-radius: 0.75rem;
}

.btn-primary {
  background: linear-gradient(135deg, #007bff, #00c6ff);
  border: none;
  border-radius: 1rem;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0062cc, #00aaff);
}

.btn-gradient-blue {
  background: linear-gradient(135deg, #2193b0, #6dd5ed);
  border: none;
  color: white;
  padding: 0.6rem 1.5rem;
  border-radius: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-gradient-blue:hover {
  background: linear-gradient(135deg, #1b6a85, #5abbe0);
  color: white;
}

.btn-outline-info {
  border-radius: 1rem;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  transition: all 0.3s ease;
}

.btn-outline-info:hover {
  background-color: #0dcaf0;
  color: white;
  border-color: #0dcaf0;
}

/* Botones de puntuación */
.score-btn {
  min-width: 48px;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  border: none;
  text-align: center;
  font-weight: bold;
  transition: 0.2s ease;
}

.score-btn:hover {
  filter: brightness(1.1);
}

.score-1 {
  background-color: #ffe0e0;
  color: #a33;
}

.score-2 {
  background-color: #ffeccc;
  color: #a65;
}

.score-3 {
  background-color: #fff9c4;
  color: #997700;
}

.score-4 {
  background-color: #d4edda;
  color: #155724;
}

.score-5 {
  background-color: #c3e6cb;
  color: #1c6633;
}

.btn-check:checked + .score-btn {
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
  transform: scale(1.05);
  font-weight: bold;
}

/* ========== RESPONSIVE MOBILE FIRST ========== */

/* Dispositivos pequeños (móviles, 576px+) */
@media (min-width: 576px) {
  .profile-img {
    max-height: 220px;
  }
  .glass-card {
    padding: 1.5rem;
  }
}

/* Tabletas (768px+) */
@media (min-width: 768px) {
  .action-buttons {
    flex-direction: row;
  }
  .btn-gradient-blue,
  .btn-outline-info {
    width: auto;
  }
  .profile-img {
    max-height: 240px;
    margin-bottom: 0;
  }
}

/* Pantallas medianas (992px+) */
@media (min-width: 992px) {
  .profile-img {
    max-height: 280px;
  }
  .glass-card {
    padding: 2rem;
  }
}

/* Dispositivos pequeños (ajustes específicos) */
@media (max-width: 767.98px) {
  .container {
    padding-left: 10px;
    padding-right: 10px;
  }
  .profile-img {
    max-height: 10rem!important;
    border-radius: 0.8rem;
  }
  .glass-card {
    padding: 1rem;
  }
  .glass-card h2 {
    font-size: 1.5rem;
  }
  .glass-card h5 {
    font-size: 1rem;
  }
  #commentForm button,
  .btn-gradient-blue,
  .btn-outline-info {
    width: 100%;
  }
  .score-btn {
    min-width: 40px;
    padding: 0.4rem;
  }
}

/* Ajustes extra pequeños (menos de 576px) */
@media (max-width: 575.98px) {
  .modal-dialog {
    margin: 0.5rem auto;
  }
  .popover {
    max-width: 280px;
  }
}

/* ========================================================= */
/* ==== MEDIA QUERIES PARA DISPOSITIVOS MÓVILES (<= 767px) ==== */
/* ========================================================= */
@media (max-width: 767px) {
    /* ==== LAYOUT Y FUENTES GENERALES ==== */
    body {
        /* Un degradado sutil para dar más profundidad */
        background: radial-gradient(circle at top, #1a1a1a, #0a0a0a);
        font-family: 'Montserrat', sans-serif; /* Usamos una fuente más elegante */
    }

    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* ==== ENCABEZADO Y PERFIL ==== */
    .row.justify-content-center {
        /* Centramos el contenido de forma más robusta */
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 10px;
        margin-top: -20px;
    }

    .profile-img {
        /* Borde más definido y sombra sutil */
        width: 180px;
        height: 180px;
        border: 3px solid var(--color-accent);
        box-shadow: 0 0 15px rgba(61, 139, 253, 0.6);
        transition: transform 0.3s ease-in-out;
    }
    
    .profile-img:hover {
        transform: scale(1.05);
    }

    .glass-card {
        /* Efecto glassmorphism más limpio */
        background-color: rgba(25, 25, 25, 0.7);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(61, 139, 253, 0.2);
        border-radius: 15px;
        padding: 20px;
        margin-top: 20px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    }

    .glass-card h2 {
        font-family: 'Poppins', sans-serif; /* Título con otra fuente para contraste */
        font-size: 1.6rem;
        font-weight: 700;
        color: #fff;
    }

    .glass-card h5 {
        font-family: 'Montserrat', sans-serif;
        font-size: 0.9rem;
        color: #a0a0a0 !important;
        font-weight: 400;
    }

    /* ==== BOTONES DE ACCIÓN ==== */
    .d-flex.flex-column.flex-md-row {
        gap: 15px;
    }

    .btn-gradient-blue, .btn-outline-info {
        padding: 14px 25px;
        font-size: 0.95rem;
        font-weight: 600;
        width: 100%;
        border-radius: 10px;
        transition: all 0.3s ease;
    }
    
    .btn-gradient-blue {
        background: linear-gradient(45deg, #3d8bfd, #5a4bda);
        border: none;
        color: #fff;
    }

    .btn-outline-info {
        border-color: #5a4bda;
        color: #5a4bda;
    }

    /* ==== MENSAJES DE INICIO DE SESIÓN (ESTILO ELEGANTE) ==== */
    .text-muted {
        /* Estilo para los mensajes de 'inicia sesión para comentar' */
        font-size: 1rem;
        font-style: italic;
        color: #dfdfdf !important;
        padding: 20px 0;
        border-radius: 10px;
        background-color: rgba(30, 30, 30, 0.4);
        margin: 20px 0;
        box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
    }

    /* ==== FORMULARIO DE COMENTARIOS ==== */
    #commentForm {
        margin-bottom: 25px;
    }

    #commentForm textarea {
        background-color: #242424!important;
        border: 1px solid #444!important;
        color: #f0f0f0!important;
        padding: 15px;
        min-height: 100px;
        border-radius: 10px;
        font-size: 0.95rem;
    }
    
    #commentForm button {
        /* Botón con degradado para un look más premium */
        width: 100%;
        margin-top: 10px !important;
        padding: 14px;
        font-size: 1rem;
        font-weight: 600;
        letter-spacing: 0.5px;
        background: linear-gradient(45deg, #3d8bfd, #5a4bda);
        border: none;
        box-shadow: 0 4px 15px rgba(61, 139, 253, 0.4);
    }
}


/* ================================================= */
/* ==== ESTILOS GENERALES Y MODERNOS DE COMENTARIOS ==== */
/* ================================================= */
.comments-section {
    color: #eaeaea !important;
}

.comment-card {
    background: transparent !important;
}

.comment-avatar {
    width: 45px !important;
    height: 45px !important;
}

.comment-card .card-body {
    padding: 1rem 1.25rem !important;
}

.comment-card h5 {
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    letter-spacing: 0.5px !important;
}

.comment-card small {
    color: #a0a0a0 !important;
    padding: 0.2rem 0.5rem !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
}

.comment-card p {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    color: #e0e0e0 !important;
}

p a {
    color: var(--color-accent) !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

p a:hover {
    color: #fff !important;
    text-decoration: underline !important;
}

.vote-buttons .btn {
    border-radius: 20px !important;
    font-size: 0.85rem !important;
    padding: 0.3rem 0.8rem !important;
    transition: all 0.2s ease !important;
}

.vote-buttons .btn:hover {
    transform: translateY(-2px) !important;
}

.vote-buttons .active {
    background-color: var(--color-accent) !important;
    color: #fff !important;
    border-color: var(--color-accent) !important;
}

.reply-link {
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    color: var(--color-accent) !important;
    transition: color 0.2s ease !important;
}

.reply-form textarea {
    background-color: #242424 !important;
    color: #f0f0f0 !important;
    font-size: 0.9rem !important;
    padding: 0.75rem !important;
}

.reply-form button {
    font-size: 0.9rem !important;
    padding: 0.5rem 1rem !important;
    border-radius: 8px !important;
}

.show-replies-btn {
    background: none !important;
    border: none !important;
    color: var(--color-accent) !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    cursor: pointer !important;
    padding: 0.5rem 0 !important;
    text-align: left !important;
    width: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    transition: color 0.2s ease, transform 0.2s ease !important;
}

.show-replies-btn:hover {
    color: #fff !important;
}

.show-replies-btn i {
    transition: transform 0.3s ease !important;
}

.show-replies-btn.collapsed i {
    transform: rotate(0deg) !important;
}

.show-replies-btn:not(.collapsed) i {
    transform: rotate(180deg) !important;
}

.reply-thread {
    margin-left: 15px !important;
    position: relative !important;
    padding-left: 20px !important;
}

.comment-connector {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 2px !important;
    height: 100% !important;
    background-color: rgba(61, 139, 253, 0.3) !important;
    border-radius: 5px !important;
}

/* ================================================= */
/* ==== MEDIA QUERIES PARA DISPOSITIVOS MÓVILES ==== */
/* ================================================= */
@media (max-width: 767px) {
    .comment-card {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 1.5rem 1rem !important;
    }
    
    .comment-avatar {
        margin-bottom: 1rem !important;
        margin-right: 0 !important;
    }

    .comment-card .card-body {
        padding: 0 !important;
    }

    .comment-card h5 {
        font-size: 1.1rem !important;
    }

    .comment-card small {
        margin: 0 auto !important;
    }

    .comment-card p {
        font-size: 1rem !important;
        padding-top: 10px !important;
    }

    .vote-buttons, .reply-link {
        justify-content: center !important;
        width: 100% !important;
    }
    
    .reply-thread {
        margin-left: 10px !important;
        padding-left: 15px !important;
    }
}

/* ==== Media Query para pantallas más grandes (Desktop) ==== */
@media (min-width: 768px) {
    .reply-thread {
        margin-left: 20px !important;
        padding-left: 25px !important;
    }
}