.tpl-add-to-playlist {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--secondary-color);
    color: var(--white);
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    z-index: 1000;
    transition: background 0.2s;
}

.tpl-add-to-playlist:hover {
    background-color: var(--white);
    color: var(--primary-color);
}

/* MODAL */
.tpl-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #00000070;
    justify-content: center;
    align-items: center;
}

.tpl-modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--white);
    padding: 30px;
    width: 100%;
    max-width: 90%;
    height: 100%;
    min-height: 70vh;
    max-height: 70vh;
    margin: 100px auto 0;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.tpl-modal-header {
    border-bottom: 1px solid var(--primary-color);
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

#tpl-close-modal {
    position: absolute;
    top: 18px;
    right: 30px;
    border: none;
    background-color: transparent;
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 42px;
    cursor: pointer;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s ease;
    padding: 0;
}

.tpl-modal-header h2 {
    font-size: 22px;
}

.tpl-modal-body {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
    height: 100%;
}

.tpl-modal-body-content {
    display: flex;
    flex-direction: column;
}

#tpl-create-new-playlist-btn {
    width: fit-content;
}

#tpl-save-to-playlist {
    width: 100%;
    border-radius: 6px;
    background: var(--secondary-color);
    color: #fff;
    border: none;
    padding: 10px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.tpl-playlist-item-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.tpl-playlist-title {
   text-transform: uppercase; 
}

.tpl-btn {
    border-radius: 5px;
    align-self: center;
}

#tpl-user-playlists {
  max-height: 250px;
  overflow-y: auto;
  padding-right: 6px;
}

/* Opcional: mejorar apariencia del scroll */
#tpl-user-playlists::-webkit-scrollbar {
  width: 6px;
}
#tpl-user-playlists::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}
#tpl-user-playlists::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Submodal general */
.tpl-submodal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  transition: opacity 0.25s ease;
}

.tpl-submodal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
}

.tpl-submodal-content {
  position: relative;
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  width: 320px;
  max-width: 90%;
  z-index: 100000;
  text-align: center;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.tpl-submodal-content h3 {
    font-size: 18px;
}

.tpl-submodal-content input {
    width: 100%;
    border-radius: 5px;
}

.tpl-submodal-buttons {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.tpl-btn-secondary {
  background: #001F5420;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--primary-color);
}

#tpl-new-playlist-submit {
    width: 100%;
}

.tpl-btn-remove {
    width: 100%;
    border: 1px solid #c0392b;
    background-color: transparent !important;
    color: #c0392b !important;
    font-weight: 400 !important;
}

.tpl-btn-remove:hover {
    background-color: #c0392b !important;
    color: var(--white) !important;
}

.tpl-loader {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: tpl-spin 0.7s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes tpl-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Animaciones */
.tpl-modal-content {
    animation: fadeInUp 0.3s ease;
}

.tpl-select-circle {
  transition: all 0.25s ease;
}

.tpl-select-circle svg {
  transition: transform 0.25s ease;
}

.tpl-playlist-item.selected .tpl-select-circle svg {
  transform: scale(1.1);
}

@keyframes fadeInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes tpl-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.tpl-btn-loader {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: tpl-spin 0.8s linear infinite;
}

/* Pagina archivo playlists */
.playlists-page .site-content {
    flex-direction: column;
}

.tpl-header {
    width: 100vw;
    min-height: 20vh;
    background-image: url('/wp-content/uploads/2025/06/comming-soon-bg.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-blend-mode: multiply;
    background-color: var(--primary-color);
    color: var(--white);
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tpl-container {
    width: 100%;
    margin: 0 auto;
    padding: 50px 24px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tpl-btn-search-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.btn-create-playlist-container {
    display: flex;
    justify-content: center;
    width: auto;
    min-width: fit-content;
}

.tpl-search {
    width: 100%;
}

.tpl-search input {
    width: 100%;
    border-radius: 5px !important;
    border: 1px solid var(--primary-color);
}

.tpl-playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.tpl-playlists-grid a {
    text-decoration: none;
    color: inherit;
}

.tpl-playlist-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    text-align: center;
    padding: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tpl-playlist-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.tpl-playlist-card h3 {
    margin-bottom: 0 !important;
    font-size: 20px;
}

.tpl-playlist-card p {
    color: var(--primary-color);
    margin-bottom: 0 !important;
}

.tpl-playlist-card .tpl-playlist-play {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tpl-playlist-card .tpl-playlist-video-count {
    color: #001F5480;
}

.tpl-playlist-card .tpl-playlist-play .tpl-play-icon {
    width: 18px;
    height: 18px;
}

.tpl-no-playlists {
    text-align: center;
    font-size: 18px;
    color: #666;
}


/*
.tpl-dashboard-playlists {
  padding-top: 50px 0;
}

.tpl-playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.tpl-playlist-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.tpl-playlist-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tpl-playlist-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
}

.tpl-playlist-sidebar {
  background: #f7f7f7;
  border-radius: 8px;
  padding: 10px;
  overflow-y: auto;
  max-height: 75vh;
}

.tpl-playlist-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tpl-lesson-item {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
  transition: background 0.2s;
}

.tpl-lesson-item:hover {
  background: #eee;
}

.tpl-playlist-player iframe {
  width: 100%;
  height: 75vh;
  border-radius: 8px;
}
*/

/* Icono dashboard TutorLMS */
.tutor-icon-playlists::before {
    content: "";
    display: inline-block;
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="%23001f54" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/><path stroke-linecap="round" stroke-linejoin="round" d="M15.91 11.672a.375.375 0 0 1 0 .656l-5.603 3.113a.375.375 0 0 1-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112Z"/></svg>');
}

/* SINGLE PLAYLIST */
.tpl-single-playlist {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
    padding: 50px 24px;
}

.tpl-single-playlist .tpl-playlist-sidebar {
    width: 100%;
    border-right: 1px solid #eff1f6;
}

.tpl-single-playlist .tpl-playlist-sidebar a {
    text-decoration: none;
}

.tpl-single-playlist .tpl-playlist-accordion {
    margin-top: 1rem;
}

.tpl-single-playlist .tpl-playlist-accordion .tpl-course-header {
    background: #eff1f6;
    cursor: pointer;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
    font-weight: 500;
    font-size: 16px;
}

.tpl-single-playlist .tpl-playlist-accordion .tpl-course-header .tpl-arrow {
    display: inline-block;
    width: 14px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24.125' height='13.562' viewBox='0 0 24.125 13.562'%3E%3Cpath d='M4.5,18.191,14.441,8.25l9.941,9.941' transform='translate(-2.379 -6.75)' fill='none' stroke='%23001f54' stroke-linecap='round' stroke-linejoin='round' stroke-width='3'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.35s ease;
}

.tpl-arrow.open {
    transform: rotate(180deg);
}

.tpl-single-playlist .tpl-playlist-accordion .tpl-course-lessons {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tpl-single-playlist .tpl-playlist-accordion .tpl-course-lessons .tpl-play-icon::before {
    content: "";
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-top: 5px;
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='15' viewBox='0 0 20 15'%3E%3Cg transform='translate(-415.756 -647.223)'%3E%3Crect width='20' height='15' rx='4' transform='translate(415.756 647.223)' fill='%23001f54'/%3E%3Cpath d='M5.25,5.187a.66.66,0,0,1,.978-.578L13,8.332a.66.66,0,0,1,0,1.157L6.228,13.211a.66.66,0,0,1-.978-.578V5.187Z' transform='translate(417.189 645.814)' fill='%23fff'/%3E%3C/g%3E%3C/svg%3E");
}

.tpl-single-playlist .tpl-playlist-accordion .tpl-lesson-item {
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.tpl-single-playlist .tpl-playlist-accordion .tpl-lesson-info {
    display: flex;
    gap: 1rem;
}

.tpl-single-playlist .tpl-playlist-video {
    width: 100%;
}

.tpl-single-playlist .tpl-playlist-video #tpl-lesson-summary {
    margin-top: 1rem;
}

.tpl-single-playlist .tpl-playlist-video .tutor-video-player-wrapper {
    aspect-ratio: 16 / 9;
}

.tpl-single-playlist .tpl-playlist-video .tutor-video-player-wrapper .tutor-video-player, .tpl-single-playlist .tpl-playlist-video .tutor-video-player-wrapper .tutor-video-player iframe {
    width: 100%;
    height: 100%;
}

@media (min-width: 992px) {
    .tpl-dashboard-playlists {
        padding: 100px 0;
    }
    
    .tpl-title {
        font-size: 70px;
        padding: 180px 0 30px 0;
        margin-bottom: 0 !important;
    }
    
    .tpl-header {
        min-height: 30vh;
    }
    
    .tpl-container {
        padding: 100px 24px;
        gap: 2rem;
    }
    
    .tpl-modal-content {
        width: 50vw;
    }
    
    .tpl-single-playlist {
        flex-direction: row;
        padding: 0;
        margin-bottom: 100px;
    }
    
    .tpl-single-playlist .tpl-playlist-sidebar {
        width: 40%;
    }
    
    .tpl-single-playlist .tpl-playlist-video {
        width: 60%;
    }
}

@media (min-width: 1200px) {
    .tpl-container {
        padding: 0 0 100px;
    }
}