/* Container */
.ytdp-container {
    background: none;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Main Window */
.ytdp-window {
    width: 90vw;
    max-width: 900px;
    background: #FFFFFF; /* White background */
    border-radius: 20px; /* Rounded corners */
    margin: 0 auto;
}

/* Header */
.ytdp-header {
    background: #282828; /* YouTube dark grey */
    color: #FFFFFF; /* White text */
    padding: 15px;
    text-align: center;
    border-radius: 20px 20px 0 0; /* Rounded top */
    position: relative;
}

.ytdp-header h2 {
    margin: 0;
    font-size: 24px;
    color: white;
}

.ytdp-traffic-lights {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 8px;
}

.ytdp-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.red { background: #ff5f57; }
.yellow { background: #ffbc2f; }
.green { background: #28c941; }

/* Content */
.ytdp-content {
    padding: 20px;
    background: #FFFFFF; /* White background */
    border-radius: 0 0 20px 20px; /* Rounded bottom if no footer */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); /* Shadow on inner container */
}

.ytdp-input {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.ytdp-input:focus {
    border-color: #FF0000; /* YouTube red */
    outline: none;
}

.ytdp-button {
    width: 100%;
    padding: 12px 20px;
    background: #FF0000; /* YouTube red */
    color: #FFFFFF; /* White text */
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold; /* Bold text */
    cursor: pointer;
    transition: all 0.3s ease;
}

.ytdp-button:hover {
    background: #CC0000; /* Darker red on hover */
    transform: translateY(-2px);
}

/* Loading Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #FF0000; /* YouTube red */
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
}

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

/* Result Area */
.ytdp-result {
    display: flex;
    flex-direction: column; /* One below one */
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.thumbnail-wrapper {
    width: 100%;
    max-width: 600px; /* Larger previews */
    position: relative;
    padding: 20px;
    background: #FFFFFF;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); /* Shadow on thumbnails */
}

.thumbnail-wrapper img {
    width: 100%;
    border-radius: 10px;
    animation: fadeIn 0.5s ease-in;
}

.thumbnail-label {
    margin-top: 10px;
    font-weight: bold;
    color: #282828; /* Dark grey */
    text-align: center;
}

.size-info {
    margin-top: 5px;
    color: #888;
    font-size: 14px;
    text-align: center;
}

.download-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 12px 24px;
    background: rgba(255, 0, 0, 0.8); /* YouTube red with transparency */
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold; /* Bold text */
    opacity: 0; /* Hidden by default */
    transition: opacity 0.3s ease;
}

.thumbnail-wrapper:hover .download-button {
    opacity: 1; /* Visible on hover */
}

.download-button:hover {
    background: #CC0000; /* Darker red on hover */
}

/* Footer */
.ytdp-footer {
    padding: 15px;
    text-align: center;
    font-size: 12px;
    color: #FFFFFF; /* White text */
    background: #282828; /* YouTube dark grey */
    border-radius: 0 0 20px 20px; /* Rounded bottom */
}

.ytdp-footer a {
    color: #FF0000; /* YouTube red */
    text-decoration: none;
}

.ytdp-notice {
    margin-top: 5px;
    font-style: italic;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Responsive Design */
@media (max-width: 600px) {
    .ytdp-window {
        width: 100%;
        max-width: 100%;
    }
    .thumbnail-wrapper {
        max-width: 100%;
    }
}