/* PJESA 1 NGA 2 */

/* Reset e Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4c51bf;
    --primary-color-dark: #434190;
    --card-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    --card-shadow-hover: 0 20px 35px rgba(0, 0, 0, 0.1);
    
    /* Light Theme Variables */
    --bg-primary: #f7fafc;
    --bg-secondary: #ffffff;
    --bg-header: #ffffff;
    --bg-hero: #1a202c;
    --text-primary: #1a365d;
    --text-secondary: #4a5568;
    --text-hero: #ffffff;
    --border-color: #e2e8f0;
}

.dark-theme {
    /* Dark Theme Variables */
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --bg-header: #2d3748;
    --bg-hero: #111827;
    --text-primary: #e2e8f0;
    --text-secondary: #a0aec0;
    --text-hero: #f9fafb;
    --border-color: #4a5568;
    --card-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    --card-shadow-hover: 0 20px 35px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-secondary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s, color 0.3s;
}

body.no-scroll {
    overflow: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    padding-bottom: 24px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.03);
}

.logo-icon-svg {
    width: 32px;
    height: 32px;
    color: var(--text-secondary);
}

.hamburger-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1200;
    padding: 8px;
}

/* Mobile Menu Panel */
.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 80%;
    height: 100%;
    background: var(--bg-secondary);
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1100;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.mobile-menu-panel.open {
    transform: translateX(0);
}

.mobile-menu-panel h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.mobile-menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
.action-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}
.action-btn i {
    width: 20px;
    text-align: center;
}

.menu-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 8px 0;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
    z-index: 1050;
}
.menu-overlay.open {
    opacity: 1;
    visibility: visible;
}


/* Hero Section */
.hero {
    background-color: var(--bg-hero);
    background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5));
    color: var(--text-hero);
    padding: 80px 0;
    text-align: center;
    transition: background-color 0.3s;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0.9;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.search-container {
    flex-grow: 1;
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-input {
    flex: 1;
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: var(--text-hero);
    font-size: 1rem;
    outline: none;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-btn {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50px;
    color: var(--text-hero);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}
.search-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.share-page-btn {
    flex-shrink: 0;
    width: 54px;
    height: 54px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--text-hero);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.share-page-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Filters */
.filters {
    background: var(--bg-secondary);
    padding: 30px 0;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s;
}
.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
.filter-btn {
    padding: 12px 24px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}
.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Main Content */
.main {
    padding: 60px 0;
    min-height: 60vh;
}
.audio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-secondary);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
}
.no-results h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 12px;
}
.no-results p {
    color: var(--text-secondary);
}

/* Continue Prompt & Animation */
.continue-prompt {
    display: none;
    background: var(--bg-secondary);
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    text-align: center;
}
.continue-prompt p {
    color: var(--text-primary);
    margin-bottom: 12px;
}
.prompt-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}
.prompt-actions button {
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s ease;
}
.prompt-actions button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.prompt-actions button#continue-yes {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

@keyframes fly-to-playlist {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 1;
    }
    100% {
        transform: scale(0.1) translate(var(--fly-end-x), var(--fly-end-y));
        opacity: 0;
    }
}
.fly-effect {
    position: fixed;
    z-index: 2000;
    animation: fly-to-playlist 0.7s ease-in forwards;
}

/* Audio Cards */
.audio-card {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    border: 2px solid transparent;
    overflow: hidden;
}
.audio-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
}
.audio-card.is-playing {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(76, 81, 191, 0.2), var(--card-shadow-hover);
    transform: translateY(-4px);
}
.card-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.add-to-playlist-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 24px;
    line-height: 34px;
    text-align: center;
    z-index: 5;
    transition: all 0.3s ease;
}
.add-to-playlist-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1) rotate(90deg);
}
.card-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.card-icon { width: 50px; height: 50px; background: linear-gradient(135deg, var(--primary-color), #6b46c1); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: white; flex-shrink: 0; }
.card-title { font-size: 1.3rem; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.card-category { align-self: flex-start; padding: 6px 12px; background: rgba(76, 81, 191, 0.1); color: var(--primary-color); border-radius: 20px; font-size: 0.8rem; font-weight: 500; margin-bottom: 16px; }
.card-description { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 20px; line-height: 1.6; flex-grow: 1; }
.card-footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.play-btn { background: var(--primary-color); color: white; border: none; padding: 12px 24px; border-radius: 50px; cursor: pointer; font-weight: 500; transition: all 0.3s ease; display: flex; align-items: center; gap: 8px; }
.play-btn:hover { transform: scale(1.05); background: var(--primary-color-dark); }
.duration { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; }

/* Modern Player Modal */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); z-index: 1000; backdrop-filter: blur(8px); }
.modal.active { display: flex; align-items: center; justify-content: center; animation: fadeIn 0.3s ease; }
.modal-content { background: transparent; max-width: 400px; width: 90%; position: relative; animation: slideUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4); border-radius: 24px; }
.modal-close { position: absolute; top: 12px; right: 12px; background: rgba(0, 0, 0, 0.2); border: none; font-size: 1.5rem; color: #fff; cursor: pointer; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: all 0.3s ease; z-index: 10; }
.modal-close:hover { background: rgba(0, 0, 0, 0.4); transform: rotate(90deg); }
.player-card { display: flex; flex-direction: column; background: var(--bg-secondary); border-radius: 24px; overflow: hidden; }
.player-visual { height: 150px; background: linear-gradient(135deg, var(--primary-color), #8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: rgba(255, 255, 255, 0.8); position: relative; }
.player-visual-icon.is-playing-effect span { display: inline-block; background-color: rgba(255, 255, 255, 0.8); width: 4px; height: 10px; margin: 0 2px; border-radius: 2px; animation: pulse 1.2s infinite ease-in-out; }
.player-visual-icon.is-playing-effect span:nth-child(2) { animation-delay: 0.2s; }
.player-visual-icon.is-playing-effect span:nth-child(3) { animation-delay: 0.4s; }
.player-visual-icon.is-playing-effect span:nth-child(4) { animation-delay: 0.6s; }
.player-visual-icon.is-playing-effect span:nth-child(5) { animation-delay: 0.8s; }
@keyframes pulse { 0%, 100% { transform: scaleY(0.5); } 50% { transform: scaleY(1.5); } }
.player-details { padding: 24px; text-align: center; }
.modal-title { font-size: 1.5rem; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.audio-description { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.5; height: 55px; overflow: auto; }
.progress-container { background: var(--border-color); border-radius: 5px; cursor: pointer; margin: 20px 0 10px; height: 6px; }
.progress-bar { background: var(--primary-color); border-radius: 5px; height: 100%; width: 0%; transition: width 0.1s linear; }
.time-container { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 20px; }
.player-controls-main { display: flex; justify-content: center; align-items: center; gap: 20px; margin-bottom: 24px; }
.nav-btn-main { background: transparent; border: none; cursor: pointer; color: var(--text-secondary); transition: all 0.2s ease; }
.nav-btn-main:hover { color: var(--primary-color); }
.nav-btn-main svg { width: 32px; height: 32px; }
.play-btn-main { width: 64px; height: 64px; border-radius: 50%; background: var(--primary-color); color: white; display: flex; align-items: center; justify-content: center; }
.play-btn-main:hover { background: var(--primary-color-dark); }
.play-btn-main .play-icon { display: none; }
.play-btn-main .pause-icon { display: block; }
.play-btn-main.is-playing .play-icon { display: block; }
.play-btn-main.is-playing .pause-icon { display: none; }
.player-controls-secondary { display: flex; justify-content: space-around; align-items: center; }
.nav-btn-secondary { background: transparent; border: none; cursor: pointer; color: var(--text-secondary); padding: 8px; border-radius: 50%; transition: all 0.2s ease; }
.nav-btn-secondary svg { width: 20px; height: 20px; display: block; }
.nav-btn-secondary:hover { background: var(--bg-primary); color: var(--primary-color); }
.nav-btn-secondary.active { color: var(--primary-color); }
.speed-control-select { background: transparent; border: none; font-size: 0.9rem; color: var(--text-secondary); cursor: pointer; -webkit-appearance: none; -moz-appearance: none; appearance: none; padding: 8px; }
.speed-control-select:hover { color: var(--primary-color); }
.dark-theme .speed-control-select { color: var(--text-secondary); }

.timer-container {
    position: relative;
}
.timer-dropdown {
    display: none;
    position: absolute;
    bottom: 120%; 
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    width: 150px;
    overflow: hidden;
    z-index: 10;
}
.timer-dropdown.show {
    display: block;
}
.timer-option {
    display: block;
    width: 100%;
    padding: 10px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
    cursor: pointer;
}
.timer-option:last-child {
    border-bottom: none;
}
.timer-option:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}
.timer-option.cancel {
    color: #ef4444;
}
.timer-container .nav-btn-secondary.active {
    color: var(--primary-color);
    background-color: var(--bg-primary);
}

/* PJESA 2 NGA 2 */

/* Playlist System */
.playlist-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(76, 81, 191, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 990;
    transition: all 0.3s ease;
}
.playlist-toggle-btn:hover {
    transform: scale(1.1);
}
.playlist-toggle-btn svg {
    width: 28px;
    height: 28px;
}
.playlist-counter {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #dc2626;
    color: white;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    transform: scale(0);
    opacity: 0;
    transition: all 0.3s ease;
}
.playlist-toggle-btn.has-items .playlist-counter {
    transform: scale(1);
    opacity: 1;
}
.playlist-container {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 90%;
    height: 100vh;
    background: var(--bg-secondary);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    z-index: 1100;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    flex-direction: column;
}
.playlist-container.open {
    transform: translateX(0);
}
.playlist-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.playlist-header h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
}
.playlist-close {
    font-size: 2rem;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}
.playlist-close:hover {
    color: var(--text-primary);
}
.playlist-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
}
.empty-playlist {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}
.playlist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.playlist-item:hover {
    background-color: var(--bg-primary);
}
.item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-icon {
    font-size: 1.2rem;
}
.item-name {
    color: var(--text-primary);
}
.remove-item-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}
.remove-item-btn:hover {
    color: #ef4444;
}
.playlist-actions {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}
.playlist-action-btn {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.playlist-action-btn.primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
.playlist-action-btn.primary:hover {
    background: var(--primary-color-dark);
}
.playlist-action-btn:not(.primary) {
    border-color: var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.playlist-action-btn:not(.primary):hover {
    background: var(--bg-primary);
}

/* Footer, Toast, Animations, Responsive */
.footer {
    background: var(--bg-hero);
    color: white;
    padding: 60px 0 40px;
}
.footer-content {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr;
    gap: 50px;
}
.footer-section h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #e2e8f0;
}
.footer-section p {
    color: var(--text-light);
    margin-bottom: 12px;
}
.provided-by a {
    color: #fff;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid #718096;
    transition: all 0.3s ease;
}
.provided-by a:hover {
    color: var(--text-light);
    border-color: var(--text-light);
}
.social-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.social-links a {
    color: var(--text-light);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}
.social-links a:hover {
    color: white;
    transform: translateX(5px);
}
.toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: fixed;
    z-index: 2000;
    left: 50%;
    transform: translateX(-50%);
    bottom: 30px;
    font-size: 1rem;
    opacity: 0;
    transition: all 0.4s ease;
}
.toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 50px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 850px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    .social-links a {
        justify-content: center;
    }
}
@media (max-width: 768px) {
    .hero-title { font-size: 2.2rem; }
    .logo { font-size: 1.8rem; }
    .audio-grid { grid-template-columns: 1fr; gap: 20px; }
    .modal-content { padding: 0; }
}
@media (max-width: 480px) {
    .hero-actions { flex-direction: column; gap: 16px; align-items: stretch; }
    .search-container { padding: 4px; }
    .share-page-btn {
        width: 54px; /* Rregullimi për butonin share */
        height: 54px;
        align-self: center; /* Qendrimi i butonit */
    }
    .card-footer { flex-direction: column; gap: 16px; align-items: stretch; }
    .play-btn { justify-content: center; }
    .playlist-container { width: 100%; }
}
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.dark-theme::-webkit-scrollbar-track {
    background: #4a5568;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 5px;
}
.dark-theme::-webkit-scrollbar-thumb {
    background: #718096;
}
::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* FUNDI I PJESËS 2 NGA 2 */