* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #FF0000;
    --secondary-color: #282828;
    --dark-color: #0f0f0f;
    --light-color: #f1f1f1;
    --gray-color: #AAAAAA;
    --card-bg: #1f1f1f;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
    --success-color: #34A853;
    --info-color: #4285F4;
    --warning-color: #FBBC05;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--light-color);
    background-color: var(--dark-color);
    background-image: linear-gradient(to bottom, #0a0a0a, #1a1a1a);
    min-height: 100vh;
    padding-top: 0;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    padding: 0px 0;
    border-bottom: 0px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0px;
    position: relative;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.logo i {
    color: var(--primary-color);
    font-size: 2.5rem;
}

.logo-text h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary-color), #FF6B6B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.logo-text p {
    color: var(--gray-color);
    font-size: 0.9rem;
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--light-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

/* Navigation */
.nav-desktop {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-desktop a {
    color: var(--gray-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 5px;
}

.nav-desktop a:hover {
    color: var(--primary-color);
    background: rgba(255, 0, 0, 0.1);
}

/* Mobile Navigation */
.nav-mobile {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    margin-top: 10px;
    box-shadow: var(--shadow);
    z-index: 100;
}

.nav-mobile.active {
    display: block;
}

.nav-mobile a {
    display: block;
    color: var(--light-color);
    text-decoration: none;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.nav-mobile a:last-child {
    border-bottom: none;
}

.nav-mobile a:hover {
    color: var(--primary-color);
    padding-left: 10px;
}

/* Main Tool Section */
.tool-section {
    padding: 40px 0;
}

.tool-card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow);
    max-width: 900px;
    margin: 0 auto;
}

.tool-header {
    text-align: center;
    margin-bottom: 30px;
}

.tool-header h2 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    color: var(--light-color);
    background: linear-gradient(to right, var(--primary-color), #FF6B6B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tool-header p {
    color: var(--gray-color);
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.api-info {
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
    color: #AAAAAA;
    padding: 5px;
    background: rgba(255, 0, 0, 0.05);
    border-radius: 5px;
    display: inline-block;
}

/* Updated Input Group */
.input-group {
    display: flex;
    margin-bottom: 20px;
    gap: 10px;
    flex-wrap: wrap;
    position: relative;
}

.input-container {
    flex: 1;
    position: relative;
    min-width: 250px;
}

.input-container input {
    width: 100%;
    padding: 18px 120px 18px 20px;
    border: none;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--light-color);
    font-size: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.input-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.1);
}

.input-buttons {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 5px;
}

.small-btn {
    padding: 8px 15px;
    color: white;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 36px;
}

.paste-btn-small {
    background: linear-gradient(to right, var(--info-color), #34A853);
}

.paste-btn-small:hover {
    background: linear-gradient(to right, #34A853, var(--info-color));
    transform: translateY(-1px);
}

.clean-btn-small {
    background: linear-gradient(to right, #FFA500, #FFD700);
    color: #333;
}

.clean-btn-small:hover {
    background: linear-gradient(to right, #FFD700, #FFA500);
    transform: translateY(-1px);
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 10px;
}

.action-btn {
    padding: 0 25px;
    color: white;
    border: none;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 56px;
}

.extract-btn {
    background: linear-gradient(to right, var(--primary-color), #FF6B6B);
    flex: 1;
}

.extract-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.3);
}

/* Small Copy Button */
.copy-tools-btn {
    background: linear-gradient(to right, var(--info-color), #5C6BC0);
    min-width: 180px;
    padding: 0 15px;
    font-size: 14px;
    min-height: 48px;
    display: none; /* Initially hidden */
}

.copy-tools-btn:hover {
    background: linear-gradient(to right, #5C6BC0, var(--info-color));
    transform: translateY(-2px);
}

/* Results Section */
.results-section {
    display: none;
    margin-top: 30px;
}

.results-section.active {
    display: block;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-header h3 {
    font-size: 1.5rem;
    color: var(--light-color);
}

.video-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-item i {
    color: var(--primary-color);
    font-size: 18px;
}

.info-text {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.info-label {
    font-size: 12px;
    color: var(--gray-color);
}

.info-value {
    font-weight: 500;
    color: var(--light-color);
    word-break: break-word;
    padding-right: 30px;
    position: relative;
}

.copy-icon {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(66, 133, 244, 0.1);
    border: none;
    color: var(--info-color);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.copy-icon:hover {
    background: rgba(66, 133, 244, 0.2);
    transform: translateY(-50%) scale(1.1);
}

/* Description Box */
.description-box {
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid var(--info-color);
    display: none;
}

.description-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.description-header h4 {
    font-size: 1.1rem;
    color: var(--light-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-all-btn {
    background: linear-gradient(to right, var(--info-color), #5C6BC0);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.copy-all-btn:hover {
    background: linear-gradient(to right, #5C6BC0, var(--info-color));
    transform: translateY(-1px);
}

.description-content {
    color: var(--gray-color);
    font-size: 14px;
    line-height: 1.5;
    max-height: 100px;
    overflow-y: auto;
    padding-right: 10px;
    position: relative;
}

.description-content.expanded {
    max-height: none;
}

.show-more-btn {
    background: none;
    border: none;
    color: var(--info-color);
    cursor: pointer;
    font-size: 13px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.show-more-btn:hover {
    color: #5C6BC0;
}

/* Thumbnails Grid */
.thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.thumbnail-card {
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.thumbnail-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    border-color: var(--primary-color);
}

.thumbnail-preview {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    background-color: #000;
}

.thumbnail-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.thumbnail-card:hover .thumbnail-preview img {
    transform: scale(1.05);
}

.thumbnail-info {
    padding: 20px;
}

.thumbnail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.thumbnail-header h4 {
    font-size: 1.2rem;
    color: var(--light-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.quality-badge {
    background: linear-gradient(to right, var(--primary-color), #FF6B6B);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.thumbnail-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 14px;
    color: var(--gray-color);
}

.thumbnail-actions {
    display: flex;
    gap: 10px;
}

.thumbnail-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.preview-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--light-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--info-color);
    color: var(--info-color);
}

.download-btn {
    background: linear-gradient(to right, var(--primary-color), #FF6B6B);
    color: white;
}

.download-btn:hover {
    background: linear-gradient(to right, #FF6B6B, var(--primary-color));
    transform: translateY(-2px);
}

/* Instructions */
.instructions {
    padding: 60px 0;
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 30px;
    margin: 40px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2.2rem;
    margin-bottom: 15px;
    color: var(--light-color);
}

.section-title p {
    color: var(--gray-color);
    max-width: 600px;
    margin: 0 auto;
}

.steps {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 50px;
}

.step {
    flex: 1;
    min-width: 250px;
    text-align: center;
    padding: 20px;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(to right, var(--primary-color), #FF6B6B);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 24px;
    font-weight: 700;
}

.step h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--light-color);
}

.step p {
    color: var(--gray-color);
}

/* Features */
.features {
    padding: 60px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.feature-card i {
    font-size: 40px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--light-color);
}

.feature-card p {
    color: var(--gray-color);
}

/* Footer */
footer {
    padding: 60px 0 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 60px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column {
    flex: 1;
    min-width: 200px;
}

.footer-column h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--light-color);
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    color: var(--gray-color);
    text-decoration: none;
    transition: var(--transition);
}

.footer-column ul li a:hover {
    color: var(--primary-color);
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--gray-color);
    font-size: 14px;
}

/* Loading */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.active {
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 0, 0, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error Message */
.error-message {
    display: none;
    text-align: center;
    padding: 15px;
    background-color: rgba(255, 0, 80, 0.1);
    border-radius: 10px;
    border-left: 4px solid #FF6B6B;
    margin-top: 15px;
    color: #ff6b9d;
}

.error-message.active {
    display: block;
}

/* Success Message */
.success-message {
    display: none;
    text-align: center;
    padding: 15px;
    background-color: rgba(52, 168, 83, 0.1);
    border-radius: 10px;
    border-left: 4px solid #34A853;
    margin-top: 15px;
    color: #34A853;
}

.success-message.active {
    display: block;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(to right, var(--primary-color), #FF6B6B);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    max-width: 300px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification i {
    font-size: 20px;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Preview Modal */
.preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.preview-modal.active {
    display: flex;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.modal-content img {
    width: 100%;
    height: auto;
    display: block;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--primary-color);
}

.modal-actions {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

/* Responsive */
@media (max-width: 992px) {
    .tool-header h2 {
        font-size: 1.8rem;
    }
    
    .logo-text h1 {
        font-size: 1.5rem;
    }
    
    .thumbnails-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .nav-desktop {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .tool-card {
        padding: 30px 20px;
    }

    .header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .mobile-menu-btn {
        display: block;
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
    }

    .nav-desktop {
        display: none;
    }

    .logo {
        width: 100%;
    }

    .input-container input {
        padding-right: 100px;
    }

    .input-buttons {
        right: 5px;
    }

    .small-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-height: 32px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }

    .copy-tools-btn {
        min-width: 100%;
    }

    .results-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .thumbnails-grid {
        grid-template-columns: 1fr;
    }

    .thumbnail-actions {
        flex-direction: column;
    }

    .steps {
        flex-direction: column;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .tool-header h2 {
        font-size: 1.5rem;
    }

    .section-title h2 {
        font-size: 1.8rem;
    }
    
    .logo i {
        font-size: 2rem;
    }
    
    .input-container input {
        padding-right: 90px;
    }
    
    .small-btn {
        padding: 5px 8px;
        font-size: 11px;
        min-height: 28px;
    }
    
    .logo-text h1 {
        font-size: 1.3rem;
    }
}