/* Critical CSS */
.watched-videos-container {
    max-width: 800px;
    margin: 0 auto;
}

.watched-video {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.watched-video h2 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    color: #333;
}

.watched-video .video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
}

.watched-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.youtube-video {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 1.25rem;
}

.video-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 100%;
    max-width: 50rem;
    margin: 0 auto;
}

.lazyload-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    margin-bottom: 1rem;
    background-color: #f4f4f4;
}

.youtube-placeholder {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.2s ease;
    will-change: background-image;
    contain: layout paint style;
}

.youtube-placeholder .play-button {
    width: 4rem;
    height: 4rem;
    background-color: rgba(0,0,0,0.7);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
}

.youtube-placeholder .play-button::before {
    content: '';
    width: 0;
    height: 0;
    border-top: 1rem solid transparent;
    border-bottom: 1rem solid transparent;
    border-left: 1.5rem solid white;
    margin-left: 0.5rem;
}

.youtube-placeholder:hover .play-button {
    background-color: rgba(0,0,0,0.9);
}

/* Favorite Button (Global) */
.favorite-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s ease;
    color: #999;
    margin-left: 10px;
}

.favorite-button:hover,
.favorite-button.favorited {
    color: #ff4136;
}

.favorite-video-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding: 0 10px;
    width: 100%;
}

.favorite-video-details .channel-name {
    font-weight: bold;
}

.favorite-video-details .watch-count {
    color: #666;
    font-size: 0.875rem;
}

/* Responsive Video Actions */
@media screen and (min-width: 768px) {
    .video-actions {
        display: flex;
        align-items: center;
        width: 100%;
        margin-top: 0.75rem;
    }

    .video-vote-actions {
        display: flex;
        align-items: center;
        flex-grow: 1;
        gap: 0.75rem;
    }

    .total-votes {
        margin-left: auto;
        color: #666;
        font-size: 0.875rem;
    }
}

/* Form Container */
.add-favorite-form-container {
    max-width: 800px;
    margin: 4rem auto 2rem;
    padding: 2rem;
    border-top: 1px solid #e0e0e0;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.add-favorite-form-container h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #333;
}

.add-favorite-form-container p {
    color: #555;
    line-height: 1.6;
}

/* The Form element */
#add-favorite-form {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* URL Input Field */
#youtube-url-input {
    flex-grow: 1;
    padding: 12px 15px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    width: 100%;
}

#youtube-url-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* "Add Favorite" Button */
#add-favorite-form button {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background-color: #3498db;
    color: white;
    white-space: nowrap;
}

#add-favorite-form button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

/* Status message for feedback */
#add-favorite-status {
    margin-top: 1rem;
    font-size: 0.9rem;
    min-height: 1.4em;
}

/* Responsive Styles for the Form */
@media screen and (max-width: 600px) {
    #add-favorite-form {
        flex-direction: column;
        align-items: stretch;
    }

    .add-favorite-form-container {
        padding: 1.5rem;
    }
}