/*
    myplaylist/style.css
    This is the generic stylesheet for the player.
    All colors are loaded dynamically from the config.php file.
*/

html { box-sizing: border-box; }
*, *:before, *:after { box-sizing: inherit; }
body { font-family: 'Poppins', sans-serif; background-color: var(--bg-color); color: var(--primary-text); margin: 0; padding: 0; }

.jukebox-wrapper { margin: 0 auto; display: grid; gap: 0.5rem; }
.player-section { background-color: var(--card-bg); border-radius: 8px; padding: 0.5rem; box-shadow: 0 2px 10px rgba(0,0,0,0.1); position: sticky; top: 1rem; z-index: 10; border: 1px solid var(--border-color); }
.video-container-fixed { width: 100%; max-width: 720px; margin: 0 auto; position: relative; }
.video-frame { position: relative; width: 100%; height: 0; padding-bottom: 75%; background: #000; overflow: hidden; }
#main-player { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.player-controls { display: flex; align-items: center; justify-content: center; gap: 1.2rem; margin-top: 1.5rem; margin-bottom: 1rem; min-height: 113px; }

.title-block { 
    text-align: center; 
    width: 90%; 
    flex-shrink: 1; 
    min-width: 0; 
    position: relative;
}

#now-playing-title, #next-up-title {
    line-height: 1.4; white-space: normal; overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

#now-playing-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1.3;
    cursor: pointer;
    transition: color 0.2s ease;
}

#now-playing-title:hover {
    filter: brightness(110%);
}

#next-up-title {
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
    color: var(--secondary-text);
    cursor: pointer;
    transition: color 0.2s ease;
}

#next-up-title:hover {
    color: var(--accent-color);
}

.playlist-section { background-color: var(--card-bg); border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); display: flex; flex-direction: column; overflow: hidden; height: 700px; border: 1px solid var(--border-color); }
.playlist-scroll-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--card-bg);
}

.share-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent-color);
    color: var(--card-bg);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* --- FINAL & COMBINED TOOLTIP STYLES --- */

.tooltip-container {
    position: relative;
}

.share-tooltip {
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 10px;
    position: absolute;
    z-index: 1;
    width: max-content;
    left: 50%;
    transform: translateX(-50%);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    font-size: 12px;
}

/* Pwesto ng Main Title tooltip (Nananatili sa taas) */
#share-tooltip {
    bottom: 100%; 
}

/* INAYOS: Pwesto ng Next Up tooltip (Medyo ibinaba) */
#next-up-tooltip {
    bottom: 55%; /* Pinalitan ang value para bumaba. Pwede mo itong i-adjust (e.g., 50% o 70%) kung gusto mo. */
}

/* Arrow para sa parehong tooltip (nakaturo pababa) */
#share-tooltip::after,
#next-up-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.playlist-scroll-container::-webkit-scrollbar { width: 8px; height: 8px; }
.playlist-scroll-container::-webkit-scrollbar-track { background: var(--card-bg); }
.playlist-scroll-container::-webkit-scrollbar-thumb { background-color: var(--accent-color); border-radius: 4px; }
.playlist-header { padding: 1.5rem; border-bottom: 1px solid var(--border-color); position: sticky; top: 0; background-color: var(--card-bg); z-index: 1; }
.playlist-header-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0rem; justify-content: center; }
.header-logo { width: 2.3rem; height: 2.3rem; border-radius: 50%; object-fit: cover; margin-right: 0.2em; }

.playlist-switcher {
    display: flex;
    align-items: center;
    gap: 0rem;
    font-size: 1.1rem;
    font-weight: 600;
}
.playlist-switcher a {
    color: var(--secondary-text);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
}
.playlist-switcher a:hover {
    color: var(--primary-text);
    background-color: var(--border-color);
}
.playlist-switcher a.active {
    color: var(--accent-color);
}
.playlist-switcher .separator {
    color: var(--border-color);
    font-weight: normal;
}

.playlist { list-style: none; padding: 0 0.5rem 0.5rem; margin: 0; }
.playlist li { border-bottom: 1px solid var(--border-color); height: 97px; padding: 0.50rem; display: flex; align-items: center; gap: 1rem; cursor: pointer; transition: background-color 0.2s ease, border-color 0.2s ease; border: 2px solid transparent; border-radius: 8px; }
.playlist li:hover { background-color: var(--border-color); }
.playlist li.active {
  background-color: rgba(255, 79, 25, 10%);
  border: 3px dotted rgb(255, 79, 25);
}

.video-thumbnail { width: 145px; height: 80px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.video-info { display: flex; flex-direction: column; justify-content: center; gap: 0.25rem; overflow: hidden; }
.video-title { color: var(--primary-text); text-decoration: none; font-size: 0.9rem; line-height: 1.3; font-weight: 550; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.playlist li:hover .video-title, .playlist li.active .video-title { color: var(--primary-text); }
.video-meta { display: flex; gap: 0.75rem; font-size: 0.8rem; color: var(--secondary-text); }

.share-button-container { max-width: 680px; margin: 1rem auto; padding: 0 1rem; text-align: center; }
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}
.action-buttons button {
    flex: 1;
    max-width: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 10px;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}
#share-btn {
    background-color: var(--accent-color);
    color: white;
    border: 1px solid var(--accent-color);
}
#share-btn:hover {
    filter: brightness(110%);
}
#open-comments-btn {
    background-color: #fff;
    border: 1px solid var(--border-color);
    color: var(--secondary-text);
}
#open-comments-btn:hover {
    background-color: #f1f3f4;
    color: var(--primary-text);
}

footer { margin: 0.5rem auto; max-width: 1040px; text-align: center; padding: 1rem 1rem; margin-top: 2rem; border-top: 1px solid var(--border-color); color: var(--secondary-text); font-size: 0.8rem; }
footer p { max-width: 690px; margin: 0.5rem auto; color: var(--secondary-text); }

.modal-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
}
.modal-content {
    background-color: var(--card-bg);
    margin: auto;
    padding: 30px;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.modal-close-btn {
    color: var(--secondary-text);
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px; right: 20px;
    cursor: pointer;
}
.modal-close-btn:hover, .modal-close-btn:focus { color: var(--primary-text); text-decoration: none; }
.modal-content h3 { margin-top: 0; color: var(--accent-color); }
.modal-content p { color: var(--secondary-text); }

#lead-form input[type="text"], #lead-form input[type="email"], #lead-form textarea {
    width: 100%; padding: 12px; margin-bottom: 15px; border: 1px solid var(--border-color); border-radius: 4px;
    background-color: var(--card-bg); color: var(--primary-text); box-sizing: border-box; font-size: 16px;
    font-family: 'Poppins', sans-serif;
}
#lead-form button {
    background-color: var(--accent-color); color: white; padding: 14px 20px; margin-top: 10px; border: none;
    border-radius: 4px; cursor: pointer; width: 100%; font-size: 16px; font-weight: bold;
}

.social-proof-popup {
    position: fixed; bottom: 20px; left: -350px; width: 320px; background-color: var(--card-bg);
    color: var(--primary-text); border-radius: 8px; padding: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 1000; font-size: 0.9rem; transition: all 0.5s ease-in-out;
}
.social-proof-popup.show { left: 20px; }
.social-proof-popup p { margin: 0; line-height: 1.4; }
.social-proof-popup strong { color: var(--accent-color); font-weight: 600; }

/* Comment Modal Styles */
.comments-modal .modal-content { width: 90%; max-width: 600px; }
.comments-modal .comments-section { border: none; box-shadow: none; padding: 0; margin: 0; }
#comments-list { margin-top: 1.5rem; max-height: 40vh; overflow-y: auto; padding-right: 10px; }
.comment-item { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
.comment-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: 600; font-size: 1.2rem; flex-shrink: 0; background-color: var(--secondary-text); }
.comment-content .name { font-weight: 600; color: var(--primary-text); }
.comment-content .date { font-size: 0.8rem; color: var(--secondary-text); margin-left: 0.5rem; }
.comment-content .text { margin-top: 0.25rem; color: var(--primary-text); white-space: pre-wrap; }
.comment-form input, .comment-form textarea { width: 100%; padding: 0.75rem; margin-bottom: 0.75rem; border: 1px solid var(--border-color); border-radius: 4px; font-family: 'Poppins', sans-serif; background-color: #f1f3f4; box-sizing: border-box; font-size: 1rem; }
.comment-form button { background-color: var(--accent-color); color: white; border: none; padding: 10px 20px; border-radius: 50px; cursor: pointer; font-weight: 600; transition: filter 0.2s; }
#comment-form-response { font-size: 0.9rem; font-weight: 600; margin-top: 1rem; padding: 0.75rem; border-radius: 4px; display: none; }
#comment-form-response.success { color: var(--success-color); background-color: rgba(0, 123, 255, 0.1); }
#comment-form-response.error { color: var(--error-color); background-color: rgba(217, 48, 37, 0.1); }

/* ========== PC VIEW CHANGES ========== */
@media (min-width: 992px) {
    .jukebox-wrapper { 
        grid-template-columns: 2.2fr 1fr; 
        padding: 0.5rem; 
        max-width: 1400px; /* Increased to accommodate wider player */
    }
    .player-section { position: static; }
    #now-playing-title { font-size: 1.5rem; }
    
    /* 16:9 Ratio for PC View */
    .video-container-fixed { 
        max-width: 960px; /* Increased to maintain height with 16:9 ratio */
    }
    .video-frame { 
        padding-bottom: 56.25%; /* Changed from 75% to 56.25% for 16:9 aspect ratio */
    }
    
    /* Adjust share button container to match new width */
    .share-button-container { 
        max-width: 720px; 
    }
}

/* ========== MOBILE VIEW (UNCHANGED) ========== */
@media (max-width: 991px) {
    .jukebox-wrapper { padding: 0.5rem; grid-template-columns: 1fr; gap: 0.5rem; }
    .player-section { position: sticky; top: 2.3rem; padding: 0.5rem; }
    .playlist-header { position: static; }
    .player-controls { display: flex; align-items: center; justify-content: center; gap: 1.2rem; margin-top: 0.5rem; margin-bottom: 0.3rem; min-height: 113px; }
    .playlist-section { max-height: 340px; }
    .playlist-header { padding: 1.2rem; }
    .video-thumbnail { width: 100px; height: 58px; }
    .video-title { font-size: 0.85rem; }
    .video-meta { font-size: 0.67rem; }
    .playlist li { padding: 0.5rem; gap: 0.5rem; height: 80px; }
    
    /* Mobile view keeps the original 4:3 ratio */
    .video-container-fixed {
        max-width: 720px; /* Original value */
    }
    .video-frame {
        padding-bottom: 75%; /* Original 4:3 ratio */
    }
	.no-wrap {
		white-space: nowrap;
	}
}
