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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.input-section {
    margin-bottom: 30px;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#urlInput {
    flex: 1;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
}

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

.btn-primary {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-text {
    display: inline;
}

.btn-loading {
    display: none;
}

.btn-primary.loading .btn-text {
    display: none;
}

.btn-primary.loading .btn-loading {
    display: inline;
}

.supported-platforms {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.platform-tag {
    padding: 5px 15px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
}

.result-section,
.error-section {
    margin-bottom: 30px;
}

.hidden {
    display: none;
}

.result-card {
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 20px;
    background: #fafafa;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.result-header h3 {
    font-size: 1.3rem;
    color: #333;
}

.content-type {
    padding: 5px 15px;
    background: #667eea;
    color: white;
    border-radius: 20px;
    font-size: 14px;
}

.result-content {
    display: flex;
    gap: 20px;
}

.thumbnail-wrapper {
    flex-shrink: 0;
    width: 200px;
    height: 150px;
    border-radius: 10px;
    overflow: hidden;
    background: #e0e0e0;
}

.thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.info-section {
    flex: 1;
}

.info-section h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.meta-info {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.download-options {
    display: flex;
    gap: 10px;
}

.btn-play,
.btn-secondary {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-play {
    background: #4CAF50;
    color: white;
}

.btn-play:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.video-player {
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.video-player video {
    width: 100%;
    max-height: 400px;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.error-card {
    background: #fff3f3;
    border: 2px solid #ff6b6b;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

.error-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

.error-card p {
    color: #ff6b6b;
    font-size: 16px;
}

.history-section {
    border-top: 2px solid #e0e0e0;
    padding-top: 30px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-header h3 {
    font-size: 1.2rem;
    color: #333;
}

.btn-text {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 14px;
    padding: 5px 10px;
}

.btn-text:hover {
    text-decoration: underline;
}

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

.empty-history {
    text-align: center;
    color: #999;
    padding: 20px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 10px;
    transition: all 0.3s ease;
}

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

.history-thumbnail {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #e0e0e0;
    flex-shrink: 0;
}

.history-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

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

.history-meta {
    font-size: 12px;
    color: #999;
}

.history-actions {
    display: flex;
    gap: 8px;
}

.history-actions button {
    padding: 8px 12px;
    font-size: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-download-small {
    background: #4CAF50;
    color: white;
}

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

.btn-download-small:hover {
    background: #45a049;
}

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

footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    font-size: 14px;
    opacity: 0.8;
}

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

    main {
        padding: 20px;
    }

    .result-content {
        flex-direction: column;
    }

    .thumbnail-wrapper {
        width: 100%;
        height: 200px;
    }

    .download-options {
        flex-direction: column;
    }

    .history-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-thumbnail {
        width: 100%;
        height: 150px;
    }

    .history-actions {
        width: 100%;
        justify-content: flex-end;
    }
}