/* Frontend Styles for Noor Audio Ultimate - Spotify Dark Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Roboto+Mono:wght@400;500&family=Lora:wght@400;500;600&display=swap');

.noor-library-wrapper.noor-dark-theme {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    background-color: #121212 !important;
    color: #b3b3b3 !important;
    border-radius: 8px !important;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 80vh;
    min-height: 600px;
    max-height: 900px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.noor-library-wrapper.noor-dark-theme * {
    box-sizing: border-box;
}

/* Header & Filters */
.noor-library-wrapper .noor-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
    padding: 24px 24px 0 24px;
    flex-shrink: 0;
}

.noor-library-wrapper .noor-search-container input {
    padding: 10px 16px !important;
    border: none !important;
    border-radius: 30px !important;
    font-size: 14px !important;
    width: 100% !important;
    min-width: 250px !important;
    background: #242424 !important;
    color: #fff !important;
    transition: all 0.2s;
    font-family: inherit !important;
    box-shadow: none !important;
}

.noor-library-wrapper .noor-search-container input:focus {
    outline: none !important;
    background: #2a2a2a !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2) !important;
}

.noor-library-wrapper .noor-category-pills {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    cursor: grab;
    user-select: none;
}

.noor-library-wrapper .noor-category-pills.active-drag {
    cursor: grabbing;
}

.noor-library-wrapper .noor-category-pills.active-drag .noor-pill {
    pointer-events: none; /* Prevent clicking while dragging */
}

.noor-library-wrapper .noor-category-pills::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.noor-library-wrapper .noor-pill {
    flex-shrink: 0;
    background: #242424 !important;
    border: none !important;
    padding: 6px 16px !important;
    border-radius: 30px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #fff !important;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit !important;
    text-transform: none !important;
}

.noor-library-wrapper .noor-pill:hover {
    background: #2a2a2a !important;
}

.noor-library-wrapper .noor-pill.active {
    background: #fff !important;
    color: #000 !important;
}

/* List Header & Rows */
.noor-library-wrapper .noor-list-header,
.noor-library-wrapper .noor-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 3fr) minmax(0, 1fr) 40px;
    gap: 16px;
    padding: 8px 16px;
    align-items: center;
}

.noor-library-wrapper .noor-list-header {
    border-bottom: 1px solid #282828;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    margin-bottom: 12px;
    color: #b3b3b3;
    padding-bottom: 12px;
    padding-left: 24px;
    padding-right: 24px;
    flex-shrink: 0;
}

.noor-library-wrapper .noor-list {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 24px 24px 24px;
}

/* Custom scrollbar for the list */
.noor-library-wrapper .noor-list::-webkit-scrollbar {
    width: 8px;
}
.noor-library-wrapper .noor-list::-webkit-scrollbar-track {
    background: transparent;
}
.noor-library-wrapper .noor-list::-webkit-scrollbar-thumb {
    background: #4d4d4d;
    border-radius: 4px;
}
.noor-library-wrapper .noor-list::-webkit-scrollbar-thumb:hover {
    background: #b3b3b3;
}

.noor-library-wrapper .noor-loading {
    color: #b3b3b3;
    font-size: 14px;
    padding: 20px 16px;
}

.noor-library-wrapper .noor-row {
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    background: transparent !important;
}

.noor-library-wrapper .noor-row:hover {
    background-color: #2a2a2a !important;
}

.noor-library-wrapper .noor-row.active-playing-row .noor-title-text {
    color: #1ed760 !important;
}

.noor-library-wrapper .col-num {
    text-align: center;
    font-size: 14px;
    color: #b3b3b3;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.noor-library-wrapper .col-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.noor-library-wrapper .noor-title-text {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
}

.noor-library-wrapper .noor-speaker-text {
    font-size: 13px;
    color: #b3b3b3;
}

.noor-library-wrapper .col-album {
    font-size: 14px;
    color: #b3b3b3;
}

.noor-library-wrapper .col-action {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    color: #b3b3b3;
}

.noor-library-wrapper .noor-row .col-action svg {
    opacity: 1;
    color: #b3b3b3;
    transition: color 0.2s, transform 0.2s;
}

.noor-library-wrapper .noor-row:hover .col-action svg {
    color: #fff;
}

.noor-library-wrapper .noor-row .col-action svg:hover {
    color: #1ed760;
    transform: scale(1.1);
}

.noor-library-wrapper .noor-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sticky Player Bar */
.noor-library-wrapper .noor-player-bar {
    position: relative !important;
    flex-shrink: 0;
    width: 100% !important;
    height: 90px !important;
    background: #181818 !important;
    border-top: 1px solid #282828 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 32px !important;
    z-index: 10 !important;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5) !important;
}

.noor-library-wrapper .noor-player-left {
    width: 30%;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.noor-library-wrapper .noor-player-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    width: 100%;
}

.noor-library-wrapper .noor-player-title-wrapper {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.noor-library-wrapper .noor-is-overflowing {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
}

.noor-library-wrapper .noor-marquee-inner {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    will-change: transform;
}

.noor-library-wrapper .noor-title-part {
    font-weight: 500 !important;
    font-size: 14px !important;
    color: #fff !important;
}

.noor-library-wrapper .noor-title-spacer {
    color: #b3b3b3;
    font-size: 10px;
}

.noor-library-wrapper .noor-player-category {
    font-size: 12px !important;
    color: #b3b3b3 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.noor-library-wrapper .noor-player-center {
    width: 40%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.noor-library-wrapper .noor-player-controls {
    display: flex;
    align-items: center;
    gap: 24px;
}

.noor-library-wrapper .noor-control-btn {
    background: none !important;
    border: none !important;
    font-size: 16px !important;
    color: #b3b3b3 !important;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0 !important;
}

.noor-library-wrapper .noor-control-btn:hover {
    color: #fff !important;
}

.noor-library-wrapper .noor-play-circle {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: #fff !important;
    color: #000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    padding: 0 !important;
    transition: transform 0.2s !important;
}

.noor-library-wrapper .noor-play-circle:hover {
    transform: scale(1.05) !important;
    background: #fff !important;
    color: #000 !important;
}

.noor-library-wrapper .noor-progress-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 600px;
}

.noor-library-wrapper .noor-time {
    font-size: 11px !important;
    color: #a7a7a7 !important;
    min-width: 40px;
    text-align: center;
}

.noor-library-wrapper .noor-progress-bar {
    flex-grow: 1;
    height: 4px !important;
    background: #4d4d4d !important;
    border-radius: 2px !important;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
}

.noor-library-wrapper .noor-progress-bar:hover .noor-progress-filled {
    background: #1ed760 !important;
}

.noor-library-wrapper .noor-progress-filled {
    height: 100% !important;
    background: #fff !important;
    border-radius: 2px !important;
    width: 0%;
}

.noor-library-wrapper .noor-player-right {
    width: 30%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.noor-library-wrapper .noor-icon-btn {
    background: none !important;
    border: none !important;
    font-size: 13px !important;
    color: #b3b3b3 !important;
    cursor: pointer;
    font-weight: 500 !important;
    display: flex;
    align-items: center;
    gap: 6px;
}

.noor-library-wrapper .noor-icon-btn:hover {
    color: #fff !important;
}

.noor-library-wrapper .noor-volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.noor-library-wrapper .noor-volume-container input[type="range"] {
    width: 90px !important;
    height: 4px !important;
    -webkit-appearance: none !important;
    background: linear-gradient(to right, #fff var(--vol-fill, 100%), #4d4d4d var(--vol-fill, 100%)) !important;
    border-radius: 2px !important;
    outline: none !important;
    box-shadow: none !important;
}

.noor-library-wrapper .noor-volume-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    width: 12px !important;
    height: 12px !important;
    border-radius: 50% !important;
    background: #fff !important;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5) !important;
}

.noor-library-wrapper .noor-volume-container:hover input[type="range"]::-webkit-slider-thumb {
    opacity: 1;
}

.noor-library-wrapper .noor-volume-container:hover input[type="range"] {
    background: linear-gradient(to right, #1ed760 var(--vol-fill, 100%), #4d4d4d var(--vol-fill, 100%)) !important;
}

/* Transcript Modal */
.noor-library-wrapper .noor-modal-backdrop {
    position: absolute !important;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.noor-library-wrapper .noor-modal {
    position: absolute !important;
    top: 50%; left: 50%;
    transform: translate(-50%, -48%) scale(0.98);
    width: 90%;
    max-width: 800px;
    height: 90%;
    max-height: 800px;
    background: #181818 !important;
    border: 1px solid #282828 !important;
    border-radius: 12px;
    box-shadow: 0 24px 48px rgba(0,0,0,0.5);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.noor-library-wrapper .noor-modal.open,
.noor-library-wrapper .noor-modal-backdrop.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.noor-library-wrapper .noor-modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid #282828;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.noor-library-wrapper .noor-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    font-family: inherit !important;
    color: #fff !important;
}

.noor-library-wrapper .noor-modal-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.noor-library-wrapper .noor-copy-btn {
    background: transparent !important;
    color: #b3b3b3 !important;
    border: 1px solid #b3b3b3 !important;
    padding: 6px 16px !important;
    border-radius: 30px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer;
    transition: all 0.2s;
}

.noor-library-wrapper .noor-copy-btn:hover {
    color: #fff !important;
    border-color: #fff !important;
    transform: scale(1.02);
}

.noor-library-wrapper .noor-modal-content {
    padding: 32px;
    overflow-y: auto;
    flex-grow: 1;
    position: relative;
}

.noor-library-wrapper .noor-transcript-text {
    margin-bottom: 32px;
}

.noor-library-wrapper .noor-transcript-block {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 32px;
    margin-bottom: 32px;
    align-items: stretch;
}

.noor-library-wrapper .noor-ts {
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    border-right: 2px solid #282828;
    padding-right: 24px;
    text-align: right;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.noor-library-wrapper .noor-ts:hover {
    color: #1ed760;
    border-color: #1ed760;
}

.noor-library-wrapper .noor-text {
    font-family: 'Lora', serif;
    font-size: 18px;
    line-height: 1.8;
    color: #888;
    transition: color 0.3s ease;
    text-align: left;
}

.noor-library-wrapper .noor-transcript-block.active-block .noor-ts {
    color: #1ed760;
    border-color: #1ed760;
}

.noor-library-wrapper .noor-transcript-block.active-block .noor-text {
    color: #fff;
}

.noor-library-wrapper .noor-download-btn {
    width: 100%;
    background: #fff !important;
    color: #000 !important;
    border: none !important;
    padding: 12px !important;
    border-radius: 30px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: transform 0.2s;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-family: inherit !important;
}

.noor-library-wrapper .noor-download-btn:hover {
    transform: scale(1.02);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .noor-library-wrapper.noor-dark-theme {
        height: 85vh;
        min-height: 500px;
    }
    
    .noor-library-wrapper .noor-header-actions {
        padding: 16px 16px 0 16px;
    }

    .noor-library-wrapper .noor-list {
        padding: 0 16px 16px 16px;
    }

    .noor-library-wrapper .noor-list-header {
        display: none !important;
    }

    .noor-library-wrapper .noor-row {
        grid-template-columns: minmax(0, 1fr) 40px;
        padding: 16px 16px; /* Increased vertical spacing for touch */
        gap: 12px;
    }

    .noor-library-wrapper .col-num,
    .noor-library-wrapper .col-album {
        display: none !important;
    }

    .noor-library-wrapper .noor-mobile-category {
        display: inline !important;
    }

    /* Sticky Player Bar Mobile */
    .noor-library-wrapper .noor-player-bar {
        height: auto !important;
        padding: 16px 16px 24px 16px !important;
        flex-direction: column !important;
        gap: 16px !important;
        align-items: center !important;
    }

    .noor-library-wrapper .noor-player-left {
        width: 100%;
        justify-content: center;
        text-align: center;
        margin-bottom: 0;
    }

    .noor-library-wrapper .noor-player-info {
        align-items: center;
    }

    .noor-library-wrapper .noor-player-center {
        width: 100%;
        gap: 16px;
    }

    .noor-library-wrapper .noor-player-controls {
        width: 100%;
        justify-content: center;
        gap: 40px;
    }

    .noor-library-wrapper .noor-progress-container {
        position: relative;
        width: 100%;
        padding: 0;
    }

    .noor-library-wrapper .noor-player-right {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        justify-content: center;
    }

    .noor-library-wrapper .noor-volume-container {
        display: none !important; /* Hide volume on mobile */
    }

    .noor-library-wrapper .noor-time {
        display: none !important;
    }

    .noor-library-wrapper .noor-progress-bar {
        height: 6px !important; /* Thicker for touch */
        border-radius: 0 !important;
    }

    /* Transcript Modal Mobile */
    .noor-library-wrapper .noor-modal {
        width: 100%;
        height: 100%;
        max-width: 100%;
        top: 100%;
        left: 0;
        transform: none;
        border-radius: 0;
        border: none !important;
        transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .noor-library-wrapper .noor-modal.open {
        top: 0;
        transform: none;
    }
    
    .noor-library-wrapper .noor-modal-header {
        padding: 16px;
    }
    
    .noor-library-wrapper .noor-modal-content {
        padding: 16px;
    }

    .noor-library-wrapper .noor-transcript-block {
        grid-template-columns: 60px 1fr;
        gap: 16px;
        margin-bottom: 24px;
    }

    .noor-library-wrapper .noor-ts {
        padding-right: 12px;
        font-size: 12px;
    }

    .noor-library-wrapper .noor-text {
        font-size: 16px;
    }
}
