/**
 * User activity styles: auth, favorites, ratings, subscriptions
 */

/* Auth navigation */
#guest-nav,
#user-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

#guest-nav a,
#user-nav a {
    color: #fff;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

#guest-nav a:hover,
#user-nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* User dropdown */
.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 4px;
    min-width: 160px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.user-dropdown:hover .user-dropdown-menu {
    display: block;
}

.user-dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: #fff;
    text-decoration: none;
}

.user-dropdown-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Favorite button on video cards */
.favorite-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.favorite-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.favorite-btn.favorited {
    color: #ff4757;
}

.favorite-btn.favorited i {
    color: #ff4757;
}

/* Favorite count badge */
.fav-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff4757;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    padding: 0 4px;
}

/* Rating display on video cards */
.video-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #ffc107;
}

/* Clickable star rating on video thumbnails */
.video-rating-stars {
    cursor: pointer;
    transition: transform 0.2s;
}

.video-rating-stars:hover {
    transform: scale(1.1);
}

.video-rating-stars i {
    color: #ffc107;
}

.video-rating-stars .avg-rating {
    color: #fff;
}

/* Inline Rating Popup on Thumbnail */
.rating-popup {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 8px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.rating-popup-content {
    text-align: center;
    padding: 10px;
    width: 100%;
}

.rating-popup-close {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 20px;
    cursor: pointer;
    color: #888;
    transition: color 0.2s;
}

.rating-popup-close:hover {
    color: #fff;
}

.rating-popup-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.rating-popup-stars {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
}

.rating-popup-stars .popup-star {
    cursor: pointer;
    font-size: 24px;
    transition: transform 0.15s;
}

.rating-popup-stars .popup-star:hover {
    transform: scale(1.2);
}

.rating-popup-stars .popup-star i {
    color: #ffc107;
}

.rating-popup-info {
    font-size: 12px;
    color: #888;
}

.rating-popup-info .popup-avg {
    color: #fff;
}

.rating-popup-info .popup-avg strong {
    color: #ffc107;
}

.video-rating .stars {
    display: flex;
    gap: 1px;
}

.video-rating .avg-rating {
    color: #fff;
    margin-left: 4px;
}

.video-rating .rating-count {
    color: #888;
    font-size: 11px;
}

/* Rating Modal */
.rating-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.rating-modal-content {
    background: #1a1a2e;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    position: relative;
}

.rating-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    color: #888;
    cursor: pointer;
}

.rating-modal-close:hover {
    color: #fff;
}

.rating-modal h3 {
    margin: 0 0 20px;
    color: #fff;
}

.rating-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.rating-stars .star {
    font-size: 32px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.rating-stars .star:hover,
.rating-stars .star.active {
    color: #ffc107;
    transform: scale(1.1);
}

.rating-stars .star i {
    transition: color 0.2s;
}

.rating-info {
    margin-bottom: 16px;
    color: #888;
    font-size: 14px;
}

.rating-info strong {
    color: #ffc107;
}

.rating-submit-btn {
    background: #e94560;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.rating-submit-btn:hover:not(:disabled) {
    background: #d63355;
}

.rating-submit-btn:disabled {
    background: #555;
    cursor: not-allowed;
}

/* Subscribe button */
.subscribe-btn {
    background: transparent;
    border: 1px solid #e94560;
    color: #e94560;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.subscribe-btn:hover {
    background: #e94560;
    color: #fff;
}

.subscribe-btn.subscribed {
    background: #e94560;
    color: #fff;
}

/* View count - compact for mobile-first (98% traffic) */
.view-count {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: #777;
    opacity: 0.85;
}

.view-count i {
    font-size: 10px;
}

/* Slightly larger on desktop */
@media (min-width: 768px) {
    .view-count {
        font-size: 11px;
        gap: 4px;
    }
    .view-count i {
        font-size: 11px;
    }
}

/* Thumbnail meta (feed source, time, view count) */
.thumbnail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    font-size: 12px;
    color: #888;
    flex-wrap: wrap;
}

.thumbnail-meta .feed-source a {
    color: #e94560;
    text-decoration: none;
    font-weight: 500;
}

.thumbnail-meta .feed-source a:hover {
    text-decoration: underline;
}

.thumbnail-meta .time-ago {
    color: #666;
}

.thumbnail-meta .time-ago::before {
    content: "•";
    margin-right: 8px;
    color: #444;
}

/* Thumbnail categories */
.thumbnail-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px 0;
}

.thumbnail-categories a {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #aaa;
    text-decoration: none;
    font-size: 11px;
    transition: all 0.2s;
}

.thumbnail-categories a:hover {
    background: #e94560;
    color: #fff;
}

/* User Dashboard */
.user-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}

.dashboard-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #e94560;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
}

.dashboard-info h1 {
    margin: 0 0 8px;
    font-size: 24px;
}

.dashboard-info p {
    margin: 0;
    color: #888;
}

.dashboard-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
}

.dashboard-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.dashboard-tab:hover {
    color: #fff;
}

.dashboard-tab.active {
    color: #e94560;
    border-bottom-color: #e94560;
}

.dashboard-content {
    min-height: 400px;
}

/* Favorites grid */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

/* Subscriptions list */
.subscriptions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.subscription-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.subscription-item a {
    color: #fff;
    text-decoration: none;
}

.subscription-item a:hover {
    color: #e94560;
}

.subscription-remove {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px 8px;
}

.subscription-remove:hover {
    color: #ff4757;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #fff;
    text-decoration: none;
}

.pagination a:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pagination .current,
.pagination .active {
    background: #e94560;
    font-weight: bold;
}

/* Login/Signup forms */
.auth-form-container {
    max-width: 400px;
    margin: 40px auto;
    padding: 32px;
    background: #1a1a2e;
    border-radius: 12px;
}

.auth-form h1 {
    text-align: center;
    margin-bottom: 24px;
}

.auth-form .form-group {
    margin-bottom: 16px;
}

.auth-form label {
    display: block;
    margin-bottom: 6px;
    color: #888;
    font-size: 14px;
}

.auth-form input {
    width: 100%;
    padding: 12px;
    background: #0f0f1a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
}

.auth-form input:focus {
    outline: none;
    border-color: #e94560;
}

.auth-form button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: #e94560;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    margin-top: 8px;
}

.auth-form button[type="submit"]:hover {
    background: #d63355;
}

.auth-form .form-error {
    display: none;
    color: #ff4757;
    text-align: center;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 71, 87, 0.1);
    border-radius: 6px;
}

.auth-form .form-footer {
    text-align: center;
    margin-top: 20px;
    color: #888;
}

.auth-form .form-footer a {
    color: #e94560;
}
