* {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        font-family: 'Inter', sans-serif;
    }

    body {
        background: #000000;
        color: #ffffff;
        min-height: 100vh;
        line-height: 1.5;
    }

    /* Menu Button and Dropdown */
    .menu-btn {
        position: absolute;
        bottom: 10px;
        right: 10px;
        background: none;
        border: none;
        font-size: 1.2rem;
        color: #b0b0b0;
        cursor: pointer;
        padding: 4px;
    }

    .menu-btn:hover {
        color: #ffffff;
    }

    .dropdown-menu {
        position: absolute;
        bottom: 30px;
        right: 10px;
        background: #1a1a1a;
        border-radius: 8px;
        box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
        z-index: 10;
        display: none;
        min-width: 120px;
    }

    .dropdown-menu.active {
        display: block;
    }

    .dropdown-item {
        display: flex;
        align-items: center;
        padding: 8px 12px;
        font-size: 0.9rem;
        color: #ff5555;
        cursor: pointer;
        border-radius: 8px;
    }

    .dropdown-item:hover {
        background: #2a2a2a;
    }

    .dropdown-item svg {
        margin-right: 8px;
    }

    .playlist-card {
        position: relative;
    }

    .container {
        max-width: 1280px;
        margin: 0 auto;
        padding: 32px 16px; /* Natural top padding */
        min-height: 100vh;
    }

    /* Header */
    .header {
        text-align: center;
        margin: 32px 0;
    }

    .header h1 {
        font-size: 2rem;
        font-weight: 700;
        color: #ffffff;
        margin-bottom: 8px;
    }

    .header p {
        font-size: 1rem;
        color: #b0b0b0;
    }

    /* Dialog Box */
    .dialog-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.8);
        justify-content: center;
        align-items: center;
        z-index: 1000;
    }

    .dialog-box {
        background: #1a1a1a;
        border-radius: 12px;
        padding: 20px;
        max-width: 480px;
        width: 90%;
        box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
        animation: slideIn 0.3s ease-out;
    }

    .dialog-box h3 {
        font-size: 1.25rem;
        font-weight: 600;
        color: #ffffff;
        margin-bottom: 12px;
    }

    .dialog-box .url-input {
        width: 100%;
        padding: 10px 14px;
        font-size: 0.95rem;
        border: 1px solid #3a3a3a;
        border-radius: 8px;
        outline: none;
        background: #2a2a2a;
        color: #ffffff;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .dialog-box .url-input:focus {
        border-color: #3b82f6;
        box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
    }

    .dialog-box .url-input::placeholder {
        color: #b0b0b0;
    }

    .dialog-box .button-group {
        display: flex;
        gap: 8px;
        justify-content: flex-end;
    }

    .cancel-btn {
        padding: 8px 14px;
        background: #2a2a2a;
        color: #3b82f6;
        border: 1px solid #3a3a3a;
        border-radius: 8px;
        font-size: 0.9rem;
        font-weight: 500;
        cursor: pointer;
        transition: background 0.2s ease;
    }

    .cancel-btn:hover {
        background: #3a3a3a;
    }

    @keyframes slideIn {
        from { opacity: 0; transform: translateY(-20px); }
        to { opacity: 1; transform: translateY(0); }
    }

    /* Add Button */
    .add-btn {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
        background: #3b82f6;
        color: #ffffff;
        border: none;
        border-radius: 50%;
        font-size: 1.5rem;
        cursor: pointer;
        display: none;
        align-items: center;
        justify-content: center;
        box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
        transition: background 0.2s ease, transform 0.2s ease;
        z-index: 1000;
    }

    .add-btn:hover {
        background: #2563eb;
        transform: scale(1.1);
    }

    .add-btn.active {
        display: flex;
    }

    /* Sections */
    .recent-learning-section, .playlists-section {
        margin-bottom: 32px;
        width: 100%;
        display: none;
    }

    .recent-learning-section.active, .playlists-section.active {
        display: block;
    }

    .recent-learning-grid, .playlists-grid, .videos-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 280px));
        gap: 30px;
        justify-content: start; /* Reverted to left alignment */
        width: 100%;
    }

    .recent-video-card, .playlist-card, .video-card {
        background: #1a1a1a;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        cursor: pointer;
        max-width: 280px;
        width: 100%;
    }

    .recent-video-card:hover, .playlist-card:hover, .video-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
    }

    .recent-video-thumbnail, .playlist-thumbnail, .video-thumbnail {
        width: 100%;
        height: 160px;
        object-fit: cover;
        border-radius: 12px 12px 0 0;
    }

    .recent-video-info, .playlist-info, .video-info {
        padding: 10px;
    }

    .recent-video-title, .playlist-title, .video-title {
        font-size: 0.95rem;
        font-weight: 600;
        color: #ffffff;
        margin-bottom: 4px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .recent-video-duration, .playlist-video-count, .video-duration {
        font-size: 0.85rem;
        color: #b0b0b0;
        font-weight: 400;
    }

    .progress-container {
        margin-top: 6px;
        background: #3a3a3a;
        border-radius: 4px;
        height: 5px;
        overflow: hidden;
    }

    .progress-bar {
        height: 100%;
        background: #3b82f6;
        transition: width 0.2s ease;
    }

    .progress-text {
        font-size: 0.8rem;
        color: #b0b0b0;
        margin-top: 4px;
    }

    /* Playlist Screen */
/* Playlist Header */

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
   
    padding: 10px 16px; /* Consistent padding */
}

.playlist-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff; /* Bright white for contrast */
}

.back-btn {
    padding: 8px 14px;
    background-color: #2a2a2a; /* Subtle dark gray */
    color: #3b82f6; /* Blue for the button text */
    border: 1px solid #3a3a3a; /* Matching border */
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease; /* Simple hover transition */
}

.back-btn:hover {
    background-color: #3a3a3a; /* Slightly lighter on hover */
}

   /* Player Screen */
  /* Player Container */


/* Player Header */
.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
  
    padding: 10px 16px; /* Consistent padding */
  
}

.player-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff; /* White text for contrast */
}

.video-player {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

.video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
}

.player-notes-wrapper {
    display: flex;
    gap: 24px;
    width: 100%;
}

.video-section {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.notes-section {
    flex: 1;
    background: #1a1a1a;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.notes-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 12px;
}

.notes-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.notes-btn, .notes-select {
    padding: 6px 12px;
    background: #2a2a2a;
    color: #ffffff;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.notes-btn:hover, .notes-select:hover {
    background: #3a3a3a;
}

.notes-editor {
    flex: 1;
    background: #2a2a2a;
    border-radius: 8px;
    padding: 12px;
    color: #ffffff;
    font-size: 1rem;
    outline: none;
    overflow-y: auto;
    min-height: 300px;
    resize: vertical;
}

.notes-editor img {
    max-width: 150px;
    height: auto;
    cursor: pointer;
    margin: 8px 0;
    border-radius: 8px;
}

.notes-editor img.enlarged {
    max-width: 300px;
}

.video-description {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 16px;
    font-size: 0.95rem;
    color: #b0b0b0;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
    max-height: 200px;
    overflow-y: auto;
}

.context-menu {
    position: fixed;
    background: #1a1a1a;
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
    z-index: 1000;
    display: none;
    min-width: 150px;
}

.context-menu.active {
    display: block;
}

.context-item {
    padding: 8px 12px;
    font-size: 0.9rem;
    color: #ffffff;
    cursor: pointer;
    border-radius: 4px;
}

.context-item:hover {
    background: #2a2a2a;
}

/* Responsive Design */
@media (max-width: 768px) {
    .player-notes-wrapper {
        flex-direction: column;
        gap: 16px;
    }

    .video-section, .notes-section {
        flex: none;
        width: 100%;
    }

    .notes-editor {
        min-height: 200px;
    }

    .video-player {
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .notes-toolbar {
        gap: 6px;
    }

    .notes-btn, .notes-select {
        padding: 4px 8px;
        font-size: 0.85rem;
    }
}





    /* Loading State */
    .loading {
        display: none;
        justify-content: center;
        align-items: center;
        padding: 32px;
    }

    .loading-spinner {
        width: 32px;
        height: 32px;
        border: 3px solid rgba(59, 130, 246, 0.2);
        border-top-color: #3b82f6;
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }

    @keyframes spin {
        to { transform: rotate(360deg); }
    }

    /* Error State */
    .error-message {
        display: none;
        padding: 10px;
        background: #4a1a1a;
        color: #ff5555;
        border-radius: 8px;
        margin-bottom: 16px;
        text-align: center;
        font-size: 0.9rem;
        font-weight: 500;
    }

    /* Screen Transitions */
    .screen {
        display: none;
        width: 100%;
        min-height: 100vh;
        background: #000000;
        animation: fadeIn 0.3s ease-out;
    }

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

    .screen.active {
        display: block;
    }

    /* Empty State */
    .empty-state {
        display: none;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 60vh;
        text-align: center;
        width: 100%;
    }

    .empty-state.active {
        display: flex;
    }

    #lottie-animation {
        width: 200px;
        height: 200px;
        margin-bottom: 16px;
    }

    .empty-state-text {
        font-size: 1rem;
        color: #3b82f6;
        font-weight: 500;
        max-width: 300px;
    }

    /* Responsive Design */
    @media (max-width: 768px) {
        .container {
            padding: 12px;
        }

        .recent-learning-grid, .playlists-grid, .videos-grid {
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 12px;
            justify-content: center; /* Adjusted back to center for smaller screens, but can revert to start */
            justify-items: center;
            padding: 0 12px;
        }

        .recent-video-card, .playlist-card, .video-card {
            max-width: 100%;
            width: 100%;
        }

        .header h1 {
            font-size: 1.75rem;
        }

        .add-btn {
            width: 44px;
            height: 44px;
            font-size: 1.25rem;
        }

        .dialog-box {
            width: 95%;
            padding: 16px;
        }
    }

    @media (max-width: 480px) {
        .recent-learning-grid, .playlists-grid, .videos-grid {
            grid-template-columns: 1fr;
            gap: 10px;
            justify-content: center; /* Adjusted back to center for smaller screens, but can revert to start */
            justify-items: center;
            padding: 0 8px;
        }

        .recent-video-card, .playlist-card, .video-card {
            max-width: 100%;
            width: 100%;
        }
    }