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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

header h1 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.main-nav {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.nav-link {
    padding: 10px 20px;
    background: #f0f0f0;
    color: #667eea;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s;
    font-weight: 500;
}

.nav-link:hover {
    background: #667eea;
    color: white;
}

.nav-link.active {
    background: #667eea;
    color: white;
}

.search-container {
    position: relative;
    max-width: 600px;
}

.search-container i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 1.2em;
}

#searchInput {
    width: 100%;
    padding: 15px 20px 15px 55px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 1.1em;
    transition: all 0.3s;
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.upload-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.upload-area:hover {
    background: rgba(102, 126, 234, 0.05);
    border-color: #764ba2;
}

.upload-area.drag-over {
    background: rgba(102, 126, 234, 0.1);
    border-color: #764ba2;
    transform: scale(1.02);
}

.upload-area i {
    font-size: 4em;
    color: #667eea;
    margin-bottom: 20px;
}

.upload-area h3 {
    color: #333;
    font-size: 1.5em;
    margin-bottom: 10px;
}

.upload-area p {
    color: #666;
    font-size: 1em;
}

#fileInput {
    display: none;
}

.upload-progress {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

#progressText {
    display: block;
    text-align: center;
    color: #667eea;
    font-weight: bold;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1em;
    color: #333;
}

.stat-item i {
    font-size: 2em;
    color: #667eea;
}

.stat-item span {
    font-weight: bold;
    color: #764ba2;
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.file-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    cursor: pointer;
}

.file-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.file-thumbnail {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.file-thumbnail i {
    font-size: 4em;
    color: white;
    z-index: 1;
}

.file-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.file-thumbnail:hover video {
    filter: brightness(1.1);
}

.file-info {
    padding: 20px;
}

.file-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: flex;
    justify-content: space-between;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.file-actions {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-download {
    background: #667eea;
    color: white;
}

.btn-download:hover {
    background: #5568d3;
}

.btn-copy {
    background: #764ba2;
    color: white;
}

.btn-copy:hover {
    background: #653a8b;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background: #c0392b;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 30px;
    border-radius: 20px;
    max-width: 1100px;
    max-height: 90vh;
    overflow: auto;
    position: relative;
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2em;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #333;
}

.preview-container {
    margin: 20px 0;
    text-align: center;
}

.preview-container video,
.preview-container audio {
    max-width: 100%;
    border-radius: 10px;
}

.preview-container video {
    max-height: 500px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.modal-actions .btn {
    padding: 15px 30px;
    font-size: 1.1em;
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .files-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .stats {
        grid-template-columns: 1fr;
    }
}

.upload-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 15px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tab-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

.tab-btn.active {
    background: #667eea;
    color: white;
}

.url-upload-area {
    border: 3px solid #667eea;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
}

.url-upload-area i {
    font-size: 3em;
    color: #667eea;
    margin-bottom: 20px;
}

.url-upload-area h3 {
    color: #333;
    font-size: 1.5em;
    margin-bottom: 20px;
}

#urlInput {
    width: 100%;
    max-width: 600px;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    margin-bottom: 20px;
}

#urlInput:focus {
    outline: none;
    border-color: #667eea;
}

#urlUploadBtn {
    padding: 15px 30px;
    font-size: 1.1em;
}

.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 25px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn:hover {
    background: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.filehost-container {
    max-width: 1000px;
    margin: 0 auto;
}

.uploaded-files {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.uploaded-files h2 {
    color: #667eea;
    margin-bottom: 20px;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.file-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
}

.file-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.file-item-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.file-item-info i {
    font-size: 2em;
    color: #667eea;
}

.file-item-details h4 {
    color: #333;
    margin-bottom: 5px;
}

.file-item-details p {
    color: #666;
    font-size: 0.9em;
}

.file-item-actions {
    display: flex;
    gap: 10px;
}

.converter-container {
    max-width: 1000px;
    margin: 0 auto;
}

.converter-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.converter-section h2 {
    color: #667eea;
    margin-bottom: 10px;
}

.converter-section > p {
    color: #666;
    margin-bottom: 30px;
}

.conversion-options {
    margin-top: 30px;
}

.file-preview {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 30px;
}

.file-preview i {
    font-size: 3em;
    color: #667eea;
}

.file-details h3 {
    color: #333;
    margin-bottom: 5px;
}

.file-details p {
    color: #666;
}

.format-selector {
    margin-bottom: 30px;
}

.format-selector label {
    display: block;
    color: #333;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.format-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.format-btn {
    padding: 15px;
    border: 2px solid #e0e0e0;
    background: white;
    color: #667eea;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s;
    text-transform: uppercase;
}

.format-btn:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.format-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.conversion-settings {
    margin-bottom: 30px;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    color: #333;
    font-weight: bold;
    margin-bottom: 10px;
}

.setting-group select {
    width: 100%;
    max-width: 300px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    background: white;
}

.setting-group select:focus {
    outline: none;
    border-color: #667eea;
}

.btn-large {
    width: 100%;
    padding: 18px;
    font-size: 1.2em;
}

.conversion-progress {
    text-align: center;
    padding: 40px;
}

.conversion-result {
    text-align: center;
    padding: 40px;
}

.conversion-result i {
    font-size: 4em;
    color: #28a745;
    margin-bottom: 20px;
}

.conversion-result h3 {
    color: #333;
    margin-bottom: 30px;
}

.conversion-result .btn {
    margin: 10px;
}

.supported-formats {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.supported-formats h3 {
    color: #667eea;
    margin-bottom: 20px;
}

.format-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.format-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
}

.format-card i {
    font-size: 3em;
    color: #667eea;
    margin-bottom: 15px;
}

.format-card h4 {
    color: #333;
    margin-bottom: 10px;
}

.format-card p {
    color: #666;
    font-size: 0.9em;
}

.converter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.converter-tab {
    flex: 1;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.converter-tab:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

.converter-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.youtube-input-area {
    margin: 30px 0;
}

.youtube-input-area .input-group {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.youtube-input-area .input-group:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.youtube-input-area .input-group i {
    font-size: 2em;
    color: #ff0000;
}

.youtube-input-area input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.1em;
    color: #333;
    outline: none;
}

.youtube-input-area input::placeholder {
    color: #999;
}

.btn-preview {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-preview:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-preview:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.youtube-preview {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
}

.preview-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.preview-container img {
    width: 320px;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.preview-info {
    flex: 1;
}

.preview-info h3 {
    color: #333;
    font-size: 1.3em;
    margin-bottom: 10px;
    line-height: 1.4;
}

.preview-info p {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 8px;
}

.ffmpeg-warning {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding: 12px 16px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    color: #856404;
    font-size: 0.95em;
}

.ffmpeg-warning i {
    font-size: 1.2em;
    color: #ffc107;
}

.ffmpeg-warning a {
    color: #667eea;
    text-decoration: underline;
    font-weight: 500;
}

.ffmpeg-warning a:hover {
    color: #5568d3;
}

.youtube-options {
    margin-top: 30px;
}

.progress-note {
    font-size: 0.9em;
    color: #666;
    margin-top: 10px;
}

.convert-btn.secondary {
    background: #6c757d;
    margin-left: 10px;
}

.convert-btn.secondary:hover {
    background: #5a6268;
}

@media (max-width: 768px) {
    .preview-container {
        flex-direction: column;
    }

    .preview-container img {
        width: 100%;
        height: auto;
    }

    .youtube-input-area .input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-preview {
        width: 100%;
        justify-content: center;
    }
}
