 /*body {
   background-color: #f8f9fa;
}
*/
/*
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size:  0.8rem;
}
*/
html, body {
    height: 100%;
}
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
}

.card {
    border-radius: 10px;
}

.h1, .h2, .h3, .h4, .h5, .h6 {font-weight: 400;}

header { background: #343a40; color: white; padding: 10px; text-align: center; }

main {
    background: white;
    flex: 1;

}


.profile-card { max-width: 600px; margin: auto; }
/*.table th { width: 30%; }*/
.h5, .h4 { font-size: 1.2rem; !important }
header .dropdown-menu a.dropdown-item {
    font-size: 0.9rem !important;
}

/*Exercises */
.exercise-card, .students.card {
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.exercise-card:hover, .students-card:hover {
    background-color: #f8f9fa;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.exercise-row {
    display: grid;
    grid-template-columns: 80px 1fr 100px 100px 100px 140px 100px;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
}

.students-row {
    display: grid;
    grid-template-columns: 1fr 200px 200px 120px 80px 120px 100px auto;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
}


.badge { font-size: 0.8rem; font-weight: 400; min-width: 75px;}
.status-badge { min-width: 75px; text-align: center; }
.bg-opacity-40 { --bs-bg-opacity: 0.4; }
.bg-opacity-60 { --bs-bg-opacity: 0.6; }
.bg-opacity-80 { --bs-bg-opacity: 0.8; }



/* --- Responsiu per tablets --- */
@media (min-width: 769px) and (max-width: 1024px) {
    .exercise-row {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 1fr; /* dues columnes */
        grid-template-areas:
            "code title available level"
            "value status button button";
        row-gap: 8px;
        column-gap: 12px;
    }
    .exercise-row > div:nth-child(1) { grid-area: code; font-weight: 600; }
    .exercise-row > div:nth-child(2) { grid-area: title; }
    .exercise-row > div:nth-child(3) { grid-area: available; }
    .exercise-row > div:nth-child(4) { grid-area: level; }
    .exercise-row > div:nth-child(5) { grid-area: value; }
    .exercise-row > div:nth-child(6) { grid-area: status; }
    .exercise-row > div:nth-child(7) { grid-area: button; text-align: left; }

     .students-row {
                display: grid;
                grid-template-columns: 1fr 1fr 1fr;
                grid-template-areas:
                    "name username school"
                    "userGroup userYear userClass"
                    "github button button";
                row-gap: 6px;
    }
    .students-row > div:nth-child(1) { grid-area: name; font-weight: 600; }
    .students-row > div:nth-child(2) { grid-area: username; }
    .students-row > div:nth-child(3) { grid-area: school; }
    .students-row > div:nth-child(4) { grid-area: userGroup; }
    .students-row > div:nth-child(5) { grid-area: userYear; }
    .students-row > div:nth-child(6) { grid-area: userClass; }
    .students-row > div:nth-child(7) { grid-area: github; }
    .students-row > div:nth-child(8) { grid-area: button; text-align: left; }
}

/* --- Responsiu per pantalles petites --- */
@media (max-width: 768px) {
    .exercise-row {
        grid-template-columns: 1fr 1fr 1fr;
        grid-template-areas:
            "code title available"
            "level value status"
            "button button button";
        row-gap: 6px;
    }
    .exercise-row > div:nth-child(1) { grid-area: code; font-weight: 600; }
    .exercise-row > div:nth-child(2) { grid-area: title; }
    .exercise-row > div:nth-child(3) { grid-area: available; }
    .exercise-row > div:nth-child(3) { grid-area: level; }
    .exercise-row > div:nth-child(4) { grid-area: value; }
    .exercise-row > div:nth-child(5) { grid-area: status; }
    .exercise-row > div:nth-child(6) { grid-area: button; text-align: left; }



    .students-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            grid-template-areas:
                "name username"
                "school userGroup"
                "userYear userClass"
                "github button";
            row-gap: 6px;
            column-gap: 12px;
        }
        .students-row > div:nth-child(1) { grid-area: name; font-weight: 600; }
        .students-row > div:nth-child(2) { grid-area: username; }
        .students-row > div:nth-child(3) { grid-area: school; }
        .students-row > div:nth-child(4) { grid-area: userGroup; }
        .students-row > div:nth-child(5) { grid-area: userYear; }
        .students-row > div:nth-child(6) { grid-area: userClass; }
        .students-row > div:nth-child(7) { grid-area: github; }
        .students-row > div:nth-child(8) { grid-area: button; text-align: left; }

     aside {
            border-right: none !important;
            border-bottom: 1px solid #ddd;
            padding-bottom: 15px;
            margin-bottom: 15px;
        }
}

/* Sidebar sticky només en pantalles grans */
@media (min-width: 992px) {
    aside {
       position: sticky;
       top: 80px;
       align-self: flex-start;

       /* Espai extra perquè l’últim item no quedi tallat */
       padding-bottom: 120px; /* ajusta segons l’altura del footer */
    }

    /* Opcional: marge extra al final de la llista */
    #sidebarMenu {
        margin-bottom: 20px;
    }
}

/* ---- Sidebar del menú d'exercicis: 2 columnes només en mòbil ---- */
@media (max-width: 768px) {
    #sidebarMenu {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    #sidebarMenu .nav-item {
        margin: 0 !important;
    }

    #sidebarMenu .nav-link {
        background: white;
        border: 1px solid #ddd;
        border-radius: 6px;
        padding: 10px 6px !important;
        text-align: center;
        display: block;
    }
}


/* Necessari perquè sticky funcioni en Bootstrap */
.row {
    overflow: visible !important;
}



/*login*/
input.form-control {
    font-size: 0.9rem; /* o la mida que vulguis */
    /* padding: 0.25rem 0.5rem; */ /* opcional: fer l’input més compacte */
}


/*profile*/
.profile-card { max-width: 600px; margin: auto; }
/*.table th { width: 30%; }*/
.h5, .h4 { font-size: 1.2rem; !important }
header .dropdown-menu a.dropdown-item {
    font-size: 0.9rem !important;
}

/*register*/

.h5, .h4 { font-size: 1.2rem; !important }
input.form-control,
select.form-select,
textarea.form-control {
    font-size: 0.9rem;
    /*padding: 0.25rem 0.5rem;*/
}
select.form-select option {
    font-size: 0.9rem;
}

/*detail*/
pre { background: #f8f9fa; padding: 10px; border-radius: 5px; overflow-x: auto; }
.submission { font-size: 0.9rem; margin-bottom: 10px; }
.status-success { color: green; }
.status-failed { color: red; }
.status-pending { color: orange; }
.status-compilation { color: black; }
/* width: fit-content;*/
.code { font-family: monospace; background-color: #f0f0f0; padding: 4px 4px; border-radius: 4px; font-size: 0.85rem;}
.output-code { font-family: monospace; background-color: #f0f0f0; padding: 8px; border-radius: 4px; width: fit-content; font-size: 0.85rem;}


#sidebarMenu .nav-link {
  color: #333;
  padding: 8px 0;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

#sidebarMenu .nav-link:hover {
  background: #e9ecef;
  color: #0d6efd;
}

#sidebarMenu .nav-link.active {
  font-weight: 600;
  color: #0d6efd;
  background: #e9ecef;
}

.open-btn {
    border-radius: 8px;   /* Rounded corners */
    background-color: #cbdcf5;

}
/*donar-li un aspecte “opac” a les targetes no disponibles:*/
.exercise-card:not(:has(button.open-btn:not([disabled]))) {
    opacity: 0.6;
}


/* Estil per fer que el cercador sembli més professional */
.search-bar {
    position: relative;
    max-width: 400px;
}
.search-bar .bi-search {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: gray;
}
.search-bar input {
    padding-left: 36px;
    border-color: var(--bs-primary);
}


table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background-color: #fff;
}
th, td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}
th {
    background-color: #2c3e50;
    color: white;
}
tr:nth-child(even) {
    background-color: #f2f2f2;
}

code {
  font-size: 1em;
}

/* REWARDS */

.reward-card:not(.locked) {
    border: 1px solid #ffd700;
}

.reward-card {
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.reward-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}


.locked-img {
    filter: grayscale(50%) blur(0px);
    opacity: 0.6;
}
.reward-img-wrapper {
    position: relative;  /* contenedor relativ */
    background: #f8f9fa;
    padding: 15px;
    overflow: visible;   /* permet que el overlay surti del padding */
}

.locked-overlay {
    position: absolute !important;  /* assegurar que override utilitats globals */
    top: 8px !important;            /* part superior */
    right: 8px !important;          /* a la cantonada superior dreta */
    left: auto !important;          /* ignorem altres utilitats */
    transform: none !important;     /* ignorem translate-middle */
    z-index: 50 !important;         /* sobre la imatge */
    background: rgba(0,0,0,0.75);
    color: white;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: 500;
    pointer-events: none;           /* no bloqueja clicks */
}

.clickable-javamon {
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.clickable-javamon:hover {
  transform: scale(1.05);
}