* {
    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;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 800px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-bottom: 40px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

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

#urlInput {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

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

button {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s;
    font-weight: 600;
}

button:hover {
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

.loading, .download-progress {
    text-align: center;
    padding: 30px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

.error {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #c33;
}

.video-info {
    margin-top: 30px;
}

.info-header {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

#thumbnail {
    width: 200px;
    height: 112px;
    object-fit: cover;
    border-radius: 8px;
}

.info-details {
    flex: 1;
}

.info-details h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.info-details p {
    color: #666;
    font-size: 0.9rem;
}

.format-selection {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    justify-content: center;
}

.format-type {
    display: flex;
    align-items: center;
    gap: 8px;
}

.format-type input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.format-type label {
    font-size: 1rem;
    cursor: pointer;
    font-weight: 500;
}

.quality-selection {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.quality-selection label {
    font-size: 1rem;
    font-weight: 500;
    color: #333;
}

#qualitySelect {
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
    min-width: 200px;
}

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

.formats-container {
    margin-bottom: 25px;
}

.formats-container h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.formats-list {
    display: grid;
    gap: 10px;
}

.format-option {
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.format-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.format-option.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.format-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.format-badge {
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.85rem;
}

.format-option.selected .format-badge {
    background: white;
    color: #667eea;
}

.format-size {
    color: #999;
    font-size: 0.85rem;
}

.format-option.selected .format-size {
    color: #eee;
}

.download-btn {
    width: 100%;
    padding: 18px;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.donation-banner {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
}

.donation-banner p:first-child {
    margin: 0 0 15px 0;
    font-weight: 600;
    color: #333;
}

.support-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 10px 0;
}

.donate-btn {
    display: inline-block;
    background: #ff5f5f;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, background 0.2s;
    border: none;
    cursor: pointer;
}

.donate-btn:hover {
    transform: translateY(-2px);
    background: #ff4444;
}

.watch-ad-btn {
    display: inline-block;
    background: #4CAF50;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    transition: transform 0.2s, background 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

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

.ad-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
}

.ad-modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.ad-close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 35px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
}

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

.ad-modal-content h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.ad-modal-content p {
    color: #666;
    margin-bottom: 20px;
}

.ad-container {
    min-height: 250px;
    background: #f5f5f5;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    padding: 20px;
}

.ad-disclaimer {
    font-size: 0.85rem;
    color: #999;
    text-align: center;
    margin-top: 15px;
}

.goal-bar {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    margin: 15px 0 5px 0;
    overflow: hidden;
}

.goal-progress {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.goal-text {
    margin: 5px 0 0 0;
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
}

.info-section {
    background: white;
    width: 100%;
    max-width: 800px;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 40px;
}

.info-container h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.info-container h3 {
    color: #667eea;
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.info-description {
    color: #666;
    line-height: 1.8;
    margin-bottom: 20px;
}

.instructions {
    color: #555;
    line-height: 1.8;
    padding-left: 25px;
}

.instructions li {
    margin-bottom: 12px;
}

.features {
    list-style: none;
    padding: 0;
}

.features li {
    color: #555;
    line-height: 1.8;
    margin-bottom: 12px;
    padding-left: 25px;
    position: relative;
}

.features li:before {
    content: "✓";
    color: #667eea;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.support-text {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    color: #555;
    line-height: 1.6;
    margin-top: 30px;
    border-left: 4px solid #667eea;
}

.footer-links {
    text-align: center;
    margin: 30px 0 20px 0;
    color: #999;
}

.footer-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-links span {
    margin: 0 10px;
    color: #ddd;
}

.copyright {
    text-align: center;
    color: #999;
    font-size: 0.9rem;
    margin: 0;
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .input-section {
        flex-direction: column;
    }

    .info-header {
        flex-direction: column;
    }

    #thumbnail {
        width: 100%;
        height: auto;
    }

    .info-section {
        padding: 25px;
    }

    .info-container h2 {
        font-size: 1.5rem;
    }

    .info-container h3 {
        font-size: 1.2rem;
    }
}
