* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #92929B;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.app-wrapper {
    width: 100%;
    max-width: 1200px;
    background: #28282B;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    height: 90vh;
    overflow: hidden;
}

.window-header {
    background: #28282B;
    border-bottom: 1px solid #3a3a3a;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #ffffff;
    font-size: 13px;
}

.window-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Profile button in window header */
.profile-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.profile-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.profile-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF3D00 0%, #ff8f00 100%);
    color: white;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 61, 0, 0.3);
    transition: all 0.2s ease;
    user-select: none;
}

.profile-avatar.initials {
    text-transform: uppercase;
    font-size: 14px;
}

.profile-btn:hover .profile-avatar {
    box-shadow: 0 0 12px rgba(255, 61, 0, 0.5);
}

.app-header {
    background: #28282B;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #555;
    border-radius: 12px;
    font-size: 14px;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #0078d4;
}

.header-icon {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-icon:hover {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.search-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px 12px;
    font-size: 18px;
}

.search-btn:hover {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.container {
    flex: 1;
    background: #3a3a3a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.list-header {
    display: grid;
    grid-template-columns: 1fr 120px;
    padding: 8px 16px;
    background: #2e2e31;
    border-bottom: 1px solid #3a3a3a;
    font-weight: 600;
    font-size: 13px;
    color: #ffffff;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 12px 16px;
    margin: 16px;
    border-radius: 4px;
    font-size: 14px;
}

.results {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.video-list {
    display: flex;
    flex-direction: column;
}

.video-item {
    display: grid;
    grid-template-columns: 1fr 120px;
    padding: 12px 16px;
    border-bottom: 1px solid #3a3a3a;
    transition: background 0.2s;
    align-items: center;
}

.video-item:hover {
    background: #444448;
}

.video-main {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.video-thumbnail {
    width: 64px;
    height: 36px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

.video-info {
    flex: 1;
    min-width: 0;
}

.video-title {
    font-size: 14px;
    color: #ffffff;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-meta {
    font-size: 12px;
    color: #aaaaaa;
}

.video-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
}

.status-progress {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ffffff;
}

.progress-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    position: relative;
}

.progress-circle.downloading {
    border-color: #ff9800;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

.progress-circle.done {
    border-color: #4caf50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-circle.done::after {
    content: '✓';
    color: #4caf50;
    font-size: 14px;
    font-weight: bold;
}

.status-actions {
    display: flex;
    gap: 4px;
}

.action-btn {
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #666;
}

.action-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0078d4;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

.options-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.options-modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 0;
    max-width: 560px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.modal-video-preview {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
}

.modal-header {
    padding: 20px 24px 16px;
    flex-shrink: 0;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.modal-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #666;
}

.modal-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.modal-body {
    padding: 0 24px 20px;
    flex: 1;
    overflow-y: auto;
}

.format-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.format-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.format-select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.format-select:focus {
    outline: none;
    border-color: #0078d4;
}

.preset-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: #f5f5f5;
    border-radius: 8px;
}

.preset-option {
    flex: 1;
    padding: 12px;
    border: 2px solid #ccc;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.preset-option:hover {
    border-color: #0078d4;
    box-shadow: 0 2px 8px rgba(0,120,212,0.2);
}

.preset-option.selected {
    border-color: #0078d4;
    background: #e7f3ff;
}

.preset-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.preset-subtitle {
    font-size: 12px;
    color: #666;
}

.preset-info {
    margin-top: 12px;
    padding: 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    font-size: 13px;
    color: #856404;
}

.advanced-link {
    margin-top: 12px;
    text-align: center;
    font-size: 13px;
}

.advanced-link a {
    color: #0078d4;
    text-decoration: none;
    cursor: pointer;
}

.advanced-link a:hover {
    text-decoration: underline;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

.modal-btn {
    padding: 8px 20px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: white;
    transition: all 0.2s;
}

.modal-btn:hover {
    background: #f0f0f0;
}

.modal-btn.primary {
    background: #0078d4;
    border-color: #0078d4;
    color: white;
}

.modal-btn.primary:hover {
    background: #005a9e;
}

.playlist-modal .modal-body {
    padding: 16px 0;
}

.playlist-videos-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    max-height: 300px;
    padding: 16px 0;
}

/* Custom scrollbar styling for WebKit browsers */
.playlist-videos-container::-webkit-scrollbar {
    width: 12px;
}

.playlist-videos-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

.playlist-videos-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 6px;
}

.playlist-videos-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Scrollbar styling for Firefox */
.playlist-videos-container {
    scrollbar-width: auto;
    scrollbar-color: #888 #f1f1f1;
}

.playlist-settings-container {
    flex-shrink: 0;
    flex-grow: 0;
    border-top: 1px solid #e0e0e0;
}

.playlist-item {
    display: flex;
    gap: 12px;
    padding: 8px 24px;
    align-items: center;
    transition: background 0.2s;
}

.playlist-item:hover {
    background: #f5f5f5;
}

.playlist-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.playlist-thumbnail {
    width: 80px;
    height: 45px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

.playlist-info {
    flex: 1;
    min-width: 0;
}

.playlist-title {
    font-size: 13px;
    color: #333;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-meta {
    font-size: 11px;
    color: #666;
    display: flex;
    gap: 8px;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #aaaaaa;
    font-size: 14px;
}

/* Settings Dropdown Styles */
.settings-container {
    position: relative;
}

.settings-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.settings-btn:hover {
    background: rgba(255,255,255,0.1);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #2e2e31;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    min-width: 200px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    z-index: 1000;
}

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

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.dropdown-item:hover {
    background: #3a3a3a;
}

.dropdown-item i,
.dropdown-item span:first-child {
    font-size: 16px;
}

/* Description Modal Styles */
.description-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.description-modal.show {
    display: flex;
}

.description-content {
    background: #2e2e31;
    border-radius: 12px;
    padding: 0;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    color: #ffffff;
}

.description-header {
    padding: 20px 24px;
    border-bottom: 1px solid #3a3a3a;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.description-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.description-close {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 4px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.description-close:hover {
    background: rgba(255,255,255,0.1);
}

.description-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

.description-body h1,
.description-body h2,
.description-body h3 {
    color: #ffffff;
    margin-top: 20px;
    margin-bottom: 10px;
}

.description-body h1 {
    font-size: 24px;
}

.description-body h2 {
    font-size: 20px;
}

.description-body h3 {
    font-size: 16px;
}

.description-body p {
    color: #cccccc;
    line-height: 1.6;
    margin-bottom: 12px;
}

.description-body ul,
.description-body ol {
    color: #cccccc;
    margin-left: 20px;
    margin-bottom: 12px;
}

.description-body code {
    background: #1e1e20;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #ff79c6;
}

.description-body pre {
    background: #1e1e20;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 12px;
}

.description-body pre code {
    background: transparent;
    padding: 0;
    color: #f8f8f2;
}

.description-body a {
    color: #0078d4;
    text-decoration: none;
}

.description-body a:hover {
    text-decoration: underline;
}

.description-body img {
    max-width: 100%;
    height: auto;
    margin: 12px 0;
}

.description-body blockquote {
    border-left: 4px solid #0078d4;
    padding-left: 16px;
    margin: 12px 0;
    color: #aaaaaa;
    font-style: italic;
}

/* Educational Disclaimer Modal Styles */
.edu-disclaimer-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 20px;
}

.edu-disclaimer-modal.show {
    display: flex;
}

.edu-disclaimer-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    animation: slideIn 0.3s ease-out;
}

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

.edu-disclaimer-header {
    padding: 24px 24px 16px;
    border-bottom: 2px solid #0078d4;
}

.edu-disclaimer-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    text-align: center;
}

.edu-disclaimer-body {
    padding: 24px;
    color: #333;
    line-height: 1.8;
}

.edu-disclaimer-body p {
    margin-bottom: 16px;
    font-size: 15px;
}

.license-text {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    background: #f9f9f9;
    text-align: left;
}

.checkbox-container {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.checkbox-container input {
    margin-right: 10px;
}

.edu-disclaimer-body strong {
    color: #d32f2f;
    font-weight: 600;
}

.edu-disclaimer-footer {
    padding: 16px 24px 24px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.edu-disclaimer-btn {
    padding: 12px 32px;
    border: 2px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    background: white;
    transition: all 0.2s;
    min-width: 120px;
}

.edu-disclaimer-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

.edu-disclaimer-btn.primary {
    background: #0078d4;
    border-color: #0078d4;
    color: white;
}

.edu-disclaimer-btn.primary:hover {
    background: #005a9e;
    border-color: #005a9e;
}

/* Auth Modal — Full-size floating overlay */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.auth-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.auth-modal-content {
    position: relative;
    background: #28282B;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.35s ease;
}

.auth-modal.show .auth-modal-content {
    transform: translateY(0) scale(1);
}

.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0 16px;
    background: rgba(0, 0, 0, 0.1);
}

.auth-tabs {
    display: flex;
    gap: 16px;
}

.auth-tab {
    background: none;
    border: none;
    color: #8a8a90;
    font-size: 15px;
    font-weight: 600;
    padding: 16px 4px;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
}

.auth-tab:hover {
    color: #ffffff;
}

.auth-tab.active {
    color: #ffffff;
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: #FF3D00;
    border-radius: 3px 3px 0 0;
}

.auth-modal-close {
    background: none;
    border: none;
    color: #8a8a90;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.auth-modal-close:hover {
    color: #ffffff;
}

.auth-modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #b0b0b5;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: #FF3D00;
    box-shadow: 0 0 0 2px rgba(255, 61, 0, 0.2);
}

.auth-error-msg {
    color: #ff5252;
    font-size: 12px;
    margin-bottom: 16px;
    min-height: 16px;
    line-height: 1.4;
}

.auth-submit-btn {
    width: 100%;
    padding: 12px;
    background: #FF3D00;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.auth-submit-btn:hover {
    background: #e03500;
}

/* Logged-in profile card inside auth modal */
.auth-profile-card {
    text-align: center;
    padding: 32px 0 24px;
}

.auth-profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF3D00 0%, #ff8f00 100%);
    color: white;
    font-weight: 700;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    text-transform: uppercase;
    box-shadow: 0 4px 16px rgba(255, 61, 0, 0.4);
}

.auth-profile-name {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.auth-profile-email {
    font-size: 13px;
    color: #8a8a90;
}

.logout-btn {
    background: rgba(244, 67, 54, 0.15) !important;
    color: #ff5252 !important;
    border: 1px solid rgba(244, 67, 54, 0.25) !important;
    margin-top: 8px;
}

.logout-btn:hover {
    background: rgba(244, 67, 54, 0.25) !important;
    border-color: rgba(244, 67, 54, 0.4) !important;
}

.hero-disclaimer {
    font-size: 13px;
    color: #aaaaaa;
    line-height: 1.5;
    padding: 12px 16px;
    background: rgba(255, 152, 0, 0.1);
    border-left: 3px solid #ff9800;
    border-radius: 4px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero-disclaimer strong {
    color: #ff9800;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        padding: 0;
        align-items: stretch;
    }

    .app-wrapper {
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .window-header {
        padding: 10px 12px;
        font-size: 12px;
    }

    .profile-avatar {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .app-header {
        padding: 10px 12px;
    }

    .search-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .hero-disclaimer {
        font-size: 12px;
        padding: 10px 12px;
    }

    .list-header {
        font-size: 12px;
        padding: 6px 12px;
    }

    .video-item {
        padding: 10px 12px;
        font-size: 13px;
    }

    .video-thumbnail {
        width: 56px;
        height: 32px;
    }

    .video-title {
        font-size: 13px;
    }

    .video-meta {
        font-size: 11px;
    }

    /* Modal adjustments for mobile */
    .options-modal {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content {
        max-width: 100%;
        width: 100%;
        max-height: 95vh;
        border-radius: 12px 12px 0 0;
        margin: 0;
    }

    .modal-video-preview {
        max-height: 200px;
    }

    .modal-header {
        padding: 16px;
    }

    .modal-title {
        font-size: 15px;
    }

    .modal-meta {
        font-size: 12px;
        gap: 12px;
    }

    .modal-body {
        padding: 0 16px 16px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .playlist-videos-container {
        max-height: 40vh;
        padding: 12px 0;
    }

    .playlist-item {
        padding: 8px 16px;
        gap: 8px;
    }

    .playlist-thumbnail {
        width: 60px;
        height: 34px;
    }

    .playlist-title {
        font-size: 12px;
    }

    .playlist-meta {
        font-size: 10px;
    }

    .playlist-settings-container {
        padding: 16px !important;
    }

    .preset-selector {
        padding: 8px;
        gap: 4px;
        flex-wrap: nowrap;
    }

    .preset-option {
        padding: 8px 4px;
        flex: 1;
        min-width: 0;
    }

    .preset-title {
        font-size: 12px;
        margin-bottom: 0;
    }

    .preset-subtitle {
        font-size: 9px;
        display: none;
    }

    .preset-info {
        font-size: 11px;
        padding: 8px;
        margin-top: 6px;
    }

    .format-label {
        font-size: 12px;
    }

    .format-select {
        font-size: 14px;
        padding: 10px;
    }

    .modal-footer {
        padding: 12px 16px;
        flex-wrap: wrap;
        position: sticky;
        bottom: 0;
        background: white;
        box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    }

    .modal-btn {
        padding: 10px 16px;
        font-size: 14px;
        flex: 1;
        min-width: 100px;
    }

    /* Description modal mobile adjustments */
    .description-modal {
        padding: 0;
    }

    .description-content {
        max-width: 100%;
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .description-header {
        padding: 16px;
    }

    .description-title {
        font-size: 16px;
    }

    .description-body {
        padding: 16px;
        font-size: 14px;
    }

    /* Educational disclaimer modal mobile adjustments */
    .edu-disclaimer-modal {
        padding: 20px;
    }

    .edu-disclaimer-content {
        max-width: 100%;
    }

    .edu-disclaimer-title {
        font-size: 18px;
    }

    .edu-disclaimer-body {
        padding: 20px;
    }

    .edu-disclaimer-body p {
        font-size: 14px;
    }

    .edu-disclaimer-footer {
        flex-direction: column;
    }

    .edu-disclaimer-btn {
        width: 100%;
        padding: 12px 24px;
    }
}

/* Extra small devices (phones in portrait mode) */
@media (max-width: 480px) {
    .window-header {
        font-size: 11px;
    }

    .hero-title {
        font-size: 16px;
    }

    .hero-description {
        font-size: 12px;
    }

    .modal-title {
        font-size: 14px;
    }

    .preset-option {
        min-width: 10%;
    }

    .video-item {
        grid-template-columns: 1fr auto;
    }

    .video-status {
        flex-direction: column;
        gap: 4px;
    }
}

/* ── V1.5: Window Controls + Quota Badge ───────────────────── */

.window-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quota-badge {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #a0a0a0;
    cursor: default;
    transition: all 0.2s ease;
}

.quota-count {
    color: #4caf50;
    transition: color 0.2s ease;
}

.quota-sep {
    color: #555;
}

.quota-limit {
    color: #888;
}

.quota-badge.quota-low .quota-count {
    color: #ff9800;
}

.quota-badge.quota-low {
    border-color: rgba(255, 152, 0, 0.3);
    background: rgba(255, 152, 0, 0.08);
}

.quota-badge.quota-exhausted .quota-count {
    color: #f44336;
}

.quota-badge.quota-exhausted {
    border-color: rgba(244, 67, 54, 0.3);
    background: rgba(244, 67, 54, 0.08);
}

/* ── History Modal ──────────────────────────────────────────── */

.history-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.history-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.history-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.history-modal-content {
    position: relative;
    background: #28282B;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 90%;
    max-width: 640px;
    max-height: 80vh;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.35s ease;
}

.history-modal.show .history-modal-content {
    transform: translateY(0) scale(1);
}

.history-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.history-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.history-modal-close {
    background: none;
    border: none;
    color: #8a8a90;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.history-modal-close:hover {
    color: #ffffff;
}

.history-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    min-height: 200px;
}

.history-list {
    display: flex;
    flex-direction: column;
}

.history-item {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.2s ease;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.history-item-failed {
    opacity: 0.7;
}

.history-item-main {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.history-status {
    flex-shrink: 0;
    font-size: 14px;
    margin-top: 2px;
}

.history-info {
    flex: 1;
    min-width: 0;
}

.history-title {
    font-size: 14px;
    color: #ffffff;
    font-weight: 500;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: #8a8a90;
}

.history-time {
    font-size: 11px;
    color: #666;
    margin-top: 6px;
}

.history-error {
    font-size: 12px;
    color: #f44336;
    margin-top: 6px;
    padding: 6px 10px;
    background: rgba(244, 67, 54, 0.08);
    border-radius: 4px;
    word-break: break-word;
}

.history-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 14px;
}

/* History icon button */
.history-icon {
    font-size: 18px;
    line-height: 1;
}

