/**
 * YouTube/TikTok Downloader - Frontend Styles
 */

/* Container & Layout */
.ytd-downloader-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.ytd-downloader-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 40px;
}

.ytd-downloader-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.ytd-downloader-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
}

.ytd-downloader-header p {
    margin: 0;
    font-size: 16px;
    opacity: 0.95;
}

/* Form Styles */
.ytd-form {
    padding: 40px 30px;
}

.ytd-form-group {
    margin-bottom: 30px;
}

.ytd-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ytd-required {
    color: #e74c3c;
    margin-left: 4px;
}

.ytd-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

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

.ytd-input:invalid {
    border-color: #e74c3c;
}

.ytd-help-text {
    display: block;
    margin-top: 8px;
    color: #7f8c8d;
    font-size: 12px;
}

/* Video Info Box */
.ytd-video-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    border-left: 4px solid #667eea;
}

.ytd-info-box {
    display: flex;
    gap: 20px;
}

.ytd-info-thumbnail {
    flex-shrink: 0;
    width: 140px;
    height: 100px;
    border-radius: 6px;
    overflow: hidden;
    background: #ddd;
}

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

.ytd-info-details {
    flex: 1;
}

.ytd-info-details h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #333;
    line-height: 1.4;
}

.ytd-info-details p {
    margin: 6px 0;
    color: #666;
    font-size: 13px;
}

/* Format Options */
.ytd-format-options {
    display: grid;
    gap: 12px;
}

.ytd-format-option {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.ytd-format-option input[type="radio"] {
    margin-top: 4px;
    margin-right: 12px;
    cursor: pointer;
    width: 20px;
    height: 20px;
    accent-color: #667eea;
}

.ytd-format-option input[type="radio"]:checked + .ytd-format-label {
    color: #667eea;
}

.ytd-format-label {
    flex: 1;
    cursor: pointer;
}

.ytd-format-label strong {
    display: block;
    margin-bottom: 4px;
    color: #333;
}

.ytd-format-label small {
    color: #7f8c8d;
}

/* Disclaimer */
.ytd-disclaimer {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin: 30px 0;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.ytd-disclaimer input[type="checkbox"] {
    margin-top: 4px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
    flex-shrink: 0;
}

.ytd-disclaimer label {
    cursor: pointer;
    font-size: 13px;
    color: #333;
    line-height: 1.5;
}

/* Buttons */
.ytd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 40px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
}

.ytd-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.ytd-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ytd-btn-loader {
    display: inline-block;
}

.ytd-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: ytd-spin 0.8s linear infinite;
}

@keyframes ytd-spin {
    to { transform: rotate(360deg); }
}

/* Messages */
#ytd-messages {
    margin-top: 20px;
}

.ytd-message {
    padding: 15px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ytd-message-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.ytd-message-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.ytd-message-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.ytd-message-warning {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

.ytd-message-text {
    flex: 1;
    font-size: 14px;
}

.ytd-message-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: inherit;
    padding: 0;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.ytd-message-close:hover {
    opacity: 1;
}

/* Warning */
.ytd-warning {
    color: #e67e22;
    font-weight: 600;
}

/* FAQ Section */
.ytd-faq {
    background: white;
    border-radius: 12px;
    padding: 40px 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.ytd-faq h3 {
    margin-top: 0;
    color: #333;
    font-size: 24px;
    margin-bottom: 30px;
    text-align: center;
}

.ytd-faq-item {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e0e0e0;
}

.ytd-faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.ytd-faq-item h4 {
    margin: 0 0 10px 0;
    color: #667eea;
    font-size: 16px;
    font-weight: 600;
}

.ytd-faq-item p {
    margin: 0;
    color: #666;
    line-height: 1.6;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ytd-downloader-container {
        margin: 20px auto;
        padding: 0 15px;
    }

    .ytd-downloader-header {
        padding: 30px 20px;
    }

    .ytd-downloader-header h2 {
        font-size: 22px;
    }

    .ytd-form {
        padding: 30px 20px;
    }

    .ytd-info-box {
        flex-direction: column;
    }

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

    .ytd-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .ytd-faq {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .ytd-downloader-header h2 {
        font-size: 18px;
    }

    .ytd-label {
        font-size: 13px;
    }

    .ytd-input {
        padding: 10px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .ytd-form-option {
        padding: 12px;
    }
}
