* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 800px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: #1e3c72;
    margin-bottom: 10px;
    font-size: 2.5em;
}

.header p {
    color: #666;
    font-size: 1.1em;
}

.input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

input {
    flex: 1;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1em;
    transition: border-color 0.3s;
}

input:focus {
    border-color: #1e3c72;
    outline: none;
}

button {
    background: #1e3c72;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s;
}

button:hover {
    background: #2a5298;
}

.quality-options {
    text-align: center;
}

.quality-options h3 {
    color: #1e3c72;
    margin-bottom: 20px;
}

.thumbnails {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.thumbnail-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.thumbnail-item img {
    width: 100%;
    border-radius: 5px;
    margin-bottom: 10px;
}

.thumbnail-item a {
    display: inline-block;
    background: #1e3c72;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
    margin-top: 10px;
    transition: background 0.3s;
}

.thumbnail-item a:hover {
    background: #2a5298;
}

@media (max-width: 600px) {
    .input-section {
        flex-direction: column;
    }
    
    .container {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2em;
    }
}
/* Add to your existing CSS */
.thumbnail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.size-badge {
    background: #1e3c72;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
}

.thumbnail-preview {
    position: relative;
    aspect-ratio: 16/9;
    background: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
}

.thumbnail-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: opacity 0.3s;
}

.available .overlay {
    opacity: 0;
}

.not-available .overlay .status-text {
    content: 'Not Available';
    color: #ff5252;
}

.button-group {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.button-group button {
    flex: 0 0 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-btn {
    flex: 1;
}

.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    position: relative;
}

.modal-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.modal-content button {
    position: absolute;
    top: -40px;
    right: 0;
}

.history-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px;
    margin: 20px 0;
}

.history-item {
    flex: 0 0 100px;
    height: 60px;
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
}

.history-item:hover {
    transform: scale(1.05);
}

.history-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.history-item:hover .history-overlay {
    opacity: 1;
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2ecc71;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 800px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: #1e3c72;
    margin-bottom: 10px;
    font-size: 2.5em;
}

.header h1 i {
    color: #ff0000;
}

.header p {
    color: #666;
    font-size: 1.1em;
}

.input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.url-input-wrapper {
    position: relative;
    flex: 1;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.clear-input {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
}

input {
    width: 100%;
    padding: 15px 45px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1em;
    transition: border-color 0.3s;
}

input:focus {
    border-color: #1e3c72;
    outline: none;
}

.main-button {
    background: #1e3c72;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s;
    white-space: nowrap;
}

.main-button:hover {
    background: #2a5298;
}

.supported-formats {
    text-align: center;
    margin-bottom: 20px;
    color: #666;
    font-size: 0.9em;
}

.quick-history {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    margin-bottom: 20px;
}

.history-item {
    flex: 0 0 100px;
    height: 60px;
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
}

.history-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.history-overlay i {
    color: white;
    font-size: 1.2em;
}

.history-item:hover .history-overlay {
    opacity: 1;
}

.quality-options h3 {
    text-align: center;
    color: #1e3c72;
    margin-bottom: 20px;
}

.thumbnails {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.thumbnail-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.thumbnail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.size-badge {
    background: #1e3c72;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
}

.thumbnail-preview {
    position: relative;
    aspect-ratio: 16/9;
    background: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
}

.thumbnail-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.button-group {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.download-btn {
    flex: 1;
    background: #1e3c72;
    color: white;
    text-decoration: none;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    transition: background 0.3s;
}

.copy-btn, .preview-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.batch-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

.batch-button {
    padding: 12px 24px;
    border-radius: 8px;
}

.batch-button.secondary {
    background: #666;
}

.footer {
    margin-top: 30px;
    text-align: center;
    color: #666;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.social-links {
    margin-top: 10px;
}

.social-links a {
    color: #1e3c72;
    margin: 0 10px;
    font-size: 1.2em;
    text-decoration: none;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    position: relative;
    background: white;
    padding: 20px;
    border-radius: 10px;
}

.close-modal {
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2ecc71;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

@media (max-width: 600px) {
    .input-section {
        flex-direction: column;
    }
    
    .container {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .batch-actions {
        flex-direction: column;
    }
}
/* Add these styles for an improved modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    position: relative;
    background: transparent;
    padding: 20px;
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.close-modal {
    position: absolute;
    right: 0;
    top: -40px;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 5px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.modal-download-btn, .modal-copy-btn {
    background: #1e3c72;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: background 0.3s;
}

.modal-download-btn:hover, .modal-copy-btn:hover {
    background: #2a5298;
}
/* Add these modern modal styles */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    overflow: hidden;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    color: #1e3c72;
    font-size: 1.2em;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    color: #666;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #1e3c72;
}

.modal-image-container {
    position: relative;
    padding: 20px;
    background: #fff;
    text-align: center;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.image-info {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: rgba(0,0,0,0.7);
    padding: 8px 12px;
    border-radius: 20px;
    color: white;
    font-size: 0.9em;
}

.modal-actions {
    display: flex;
    gap: 12px;
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.modal-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
    text-decoration: none;
}

.modal-btn:hover {
    transform: translateY(-2px);
}

.modal-btn.primary {
    background: #1e3c72;
    color: white;
    border: none;
}

.modal-btn.secondary {
    background: #e9ecef;
    color: #1e3c72;
    border: none;
}

.modal-btn.primary:hover {
    background: #2a5298;
}

.modal-btn.secondary:hover {
    background: #dee2e6;
}
/* Add this to style the SVG icon */
.youtube-icon {
    vertical-align: middle;
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.youtube-icon:hover {
    transform: scale(1.1);
}
/* Add these styles for an enhanced mobile modal experience */
.modal-close-mobile {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    color: #1e3c72;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: none;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(4px);
    z-index: 1001;
}

@media (max-width: 768px) {
    .modal-close-mobile {
        display: flex;
    }
    
    .modal-content {
        margin: 0 15px;
    }
}
.modal-close-mobile {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    color: #1e3c72;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: none;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(4px);
    z-index: 1001;
}

@media (max-width: 768px) {
    .modal.active .modal-close-mobile {
        display: flex;
    }
}
.thumbnail-preview {
    position: relative;
    aspect-ratio: 16/9;
    background: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.thumbnail-preview:hover {
    transform: scale(1.02);
}
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 95%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.modal-image-container {
    flex: 1;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    min-height: 200px;
    max-height: 70vh;
    overflow: auto;
}

.modal-image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.modal-actions {
    display: flex;
    gap: 12px;
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.modal-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
    text-decoration: none;
}

.modal-btn.primary {
    background: #1e3c72;
    color: white;
}

.modal-btn.secondary {
    background: #e9ecef;
    color: #1e3c72;
}

.modal-btn:hover {
    transform: translateY(-2px);
}
