/**
 * Public CSS for the Video Downloader plugin.
 *
 * @since      1.0.0
 */

.wp-video-downloader-container {
    max-width: 100%;
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    /* Default loader color if not specified */
    --loader-color: #0073aa;
}

.wp-video-downloader-title {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    text-align: center;
    color: #333;
}

/* Form styling */
.wp-video-downloader-form {
    margin-bottom: 1.5rem;
}

.wp-video-downloader-input-field {
    margin-bottom: 15px;
}

.wp-video-downloader-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.wp-video-downloader-input:focus {
    border-color: #0073aa;
}

.wp-video-downloader-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.wp-video-downloader-submit {
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    background-color: #0073aa;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    flex: 1;
}

.wp-video-downloader-submit:hover {
    background-color: #005d8c;
}

.wp-video-downloader-paste-clipboard {
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    background-color: #e8f5e9;
    color: #2e7d32; /* Default color, can be overridden via inline styles */
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    flex: 1;
}

.wp-video-downloader-paste-clipboard:hover {
    background-color: #c8e6c9;
    opacity: 0.9;
}

.wp-video-downloader-error {
    margin-top: 10px;
    padding: 10px;
    background-color: #ffecec;
    color: #d63638;
    border-left: 4px solid #d63638;
    display: none;
}

/* Loading indicator */
.wp-video-downloader-loading {
    display: flex; /* Using flex for alignment */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    visibility: hidden; /* Hidden by default, but keeps layout intact */
    opacity: 0; /* Fully transparent */
    height: 0; /* No height when hidden */
    overflow: hidden; /* Hide overflow content */
    transition: opacity 0.3s, visibility 0.3s, height 0.3s;
}

.wp-video-downloader-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--loader-color);
    animation: wp-video-downloader-spin 1s linear infinite;
}

@keyframes wp-video-downloader-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Results area */
.wp-video-downloader-results {
    display: none;
    margin-top: 30px;
}

.wp-video-downloader-video-info {
    display: flex;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.wp-video-downloader-thumbnail {
    width: 160px;
    flex-shrink: 0;
    margin-right: 20px;
}

.wp-video-downloader-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    object-fit: cover;
}

.wp-video-downloader-details {
    flex: 1;
}

.wp-video-downloader-video-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.wp-video-downloader-video-platform,
.wp-video-downloader-video-duration {
    color: #666;
    margin: 5px 0;
}

/* Tabs */
.wp-video-downloader-download-options h4 {
    margin-top: 0;
    margin-bottom: 15px;
}

.wp-video-downloader-tab-buttons {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.wp-video-downloader-tab-button {
    padding: 10px 15px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    transition: all 0.2s;
}

.wp-video-downloader-tab-button:hover {
    color: var(--loader-color);
}

.wp-video-downloader-tab-button.active {
    color: var(--loader-color);
    border-bottom-color: var(--loader-color);
}

.wp-video-downloader-tab-content {
    display: none;
}

.wp-video-downloader-tab-content.active {
    display: block;
}

/* Download items */
.wp-video-downloader-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    transition: box-shadow 0.2s;
}

.wp-video-downloader-file-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wp-video-downloader-file-info {
    display: flex;
    align-items: center;
}

.wp-video-downloader-quality {
    font-weight: bold;
    margin-right: 10px;
}

.wp-video-downloader-format {
    background-color: #eee;
    color: #666;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8rem;
    margin-right: 10px;
}

.wp-video-downloader-size {
    color: #666;
    font-size: 0.9rem;
}

.wp-video-downloader-file-actions {
    display: flex;
}

.wp-video-downloader-download-button,
.wp-video-downloader-copy-button {
    padding: 8px 12px;
    margin-left: 10px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.wp-video-downloader-download-button {
    background-color: var(--loader-color);
    color: white;
    text-decoration: none;
}

.wp-video-downloader-download-button:hover {
    background-color: var(--loader-color);
    opacity: 0.9;
    text-decoration: none;
}

.wp-video-downloader-copy-button {
    background-color: #f0f0f0;
    color: #333;
}

.wp-video-downloader-copy-button:hover {
    background-color: #e0e0e0;
}

.wp-video-downloader-no-results {
    padding: 15px;
    background-color: #f8f8f8;
    color: #666;
    text-align: center;
    border-radius: 4px;
}

/* Supported platforms */
.wp-video-downloader-supported-platforms {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.wp-video-downloader-supported-platforms h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.wp-video-downloader-platform-logos {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.wp-video-downloader-platform {
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
}

.wp-video-downloader-platform.youtube {
    background-color: #ff0000;
}

.wp-video-downloader-platform.facebook {
    background-color: #1877f2;
}

.wp-video-downloader-platform.instagram {
    background-color: #c32aa3;
}

.wp-video-downloader-platform.tiktok {
    background-color: #000000;
}

/* Instructions */
.wp-video-downloader-instructions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.wp-video-downloader-instructions h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.wp-video-downloader-instructions ol {
    margin-left: 20px;
}

.wp-video-downloader-instructions li {
    margin-bottom: 8px;
}

/* Responsive styles */
@media screen and (max-width: 768px) {
    .wp-video-downloader-video-info {
        flex-direction: column;
    }
    
    .wp-video-downloader-thumbnail {
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .wp-video-downloader-file-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .wp-video-downloader-file-actions {
        margin-top: 10px;
        width: 100%;
    }
    
    .wp-video-downloader-download-button,
    .wp-video-downloader-copy-button {
        flex: 1;
        text-align: center;
        margin-left: 0;
        margin-right: 10px;
    }
    
    .wp-video-downloader-download-button:last-child,
    .wp-video-downloader-copy-button:last-child {
        margin-right: 0;
    }
    
    .wp-video-downloader-tab-buttons {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
    }
}
