* {
    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: 1200px;
    margin: 0 auto;
}

h1 {
    color: white;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.tab-button {
    padding: 12px 30px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.tab-button.active {
    background-color: white;
    color: #667eea;
    border-color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.upload-section {
    text-align: center;
    margin-bottom: 40px;
}

#fileInput, #videoInput {
    display: none;
}

.upload-button {
    display: inline-block;
    padding: 15px 40px;
    background-color: #4CAF50;
    color: white;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.upload-button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* YouTube Section */
.youtube-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.youtube-section h2 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.youtube-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.youtube-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.youtube-input:focus {
    border-color: #667eea;
}

.fetch-button {
    padding: 12px 30px;
    background-color: #FF0000;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(255, 0, 0, 0.3);
}

.fetch-button:hover {
    background-color: #cc0000;
    transform: translateY(-2px);
}

.youtube-preview {
    min-height: 50px;
}

.youtube-info {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
}

.youtube-info h3 {
    color: #333;
    margin-bottom: 10px;
}

.youtube-info p {
    color: #666;
    margin: 5px 0;
}

.youtube-info .warning {
    color: #ff9800;
    font-weight: bold;
    margin-top: 10px;
}

.download-youtube-btn {
    margin-top: 15px;
    padding: 12px 30px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.download-youtube-btn:hover {
    background-color: #45a049;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.image-card, .video-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.image-card:hover, .video-card:hover {
    transform: translateY(-5px);
}

.image-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.video-card video {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #000;
}

.image-info, .video-info {
    margin-bottom: 10px;
}

.image-name, .video-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    word-break: break-all;
}

.url-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.url-input {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    background-color: #f9f9f9;
}

.copy-button {
    padding: 10px 20px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.copy-button:hover {
    background-color: #0b7dda;
}

.copy-button.copied {
    background-color: #4CAF50;
}

.delete-button {
    width: 100%;
    padding: 10px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.delete-button:hover {
    background-color: #da190b;
}

.no-images {
    text-align: center;
    color: white;
    font-size: 1.2rem;
    margin-top: 50px;
    opacity: 0.8;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
}

#trimVideo {
    width: 100%;
    max-height: 400px;
    background: #000;
    border-radius: 10px;
    margin-bottom: 20px;
}

.trim-controls {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.trim-input-group {
    margin-bottom: 15px;
}

.trim-input-group label {
    display: block;
    color: #333;
    font-weight: bold;
    margin-bottom: 5px;
}

.trim-input-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.trim-duration {
    text-align: center;
    font-size: 1.2rem;
    color: #667eea;
    font-weight: bold;
    margin-top: 15px;
}

.trim-duration.error {
    color: #f44336;
}

.trim-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.preview-button, .confirm-button {
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.preview-button {
    background-color: #2196F3;
    color: white;
}

.preview-button:hover {
    background-color: #0b7dda;
}

.confirm-button {
    background-color: #4CAF50;
    color: white;
}

.confirm-button:hover {
    background-color: #45a049;
}

.confirm-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.loading {
    text-align: center;
    color: #667eea;
    font-size: 1.1rem;
    margin: 20px 0;
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }
    
    .gallery {
        grid-template-columns: 1fr;
    }

    .youtube-input-container {
        flex-direction: column;
    }

    .trim-buttons {
        flex-direction: column;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
}

