/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Mobile safe area support */
:root {
    --safe-area-inset-top: env(safe-area-inset-top);
    --safe-area-inset-right: env(safe-area-inset-right);
    --safe-area-inset-bottom: env(safe-area-inset-bottom);
    --safe-area-inset-left: env(safe-area-inset-left);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #050b10 0%, #121d24 50%, #050b10 100%);
    min-height: 100vh;
    color: #fff;
    /* Extend background to safe areas */
    padding-top: var(--safe-area-inset-top);
    padding-right: var(--safe-area-inset-right);
    padding-bottom: var(--safe-area-inset-bottom);
    padding-left: var(--safe-area-inset-left);
}

/* Utility classes */
.hidden {
    display: none !important;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    min-width: 80px;
    text-align: center;
    box-sizing: border-box;
    line-height: 1.2;
}

.btn-primary {
    background: rgb(250, 185, 7);
    color: #151e27;
    font-weight: 600;
}

.btn-primary:hover {
    background: rgba(250, 185, 7, 0.9);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: rgb(250, 185, 7);
    border: 2px solid rgb(250, 185, 7);
}

.btn-outline:hover {
    background: white;
    color: #333;
}

.btn-full {
    width: 100%;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #da190b;
}

/* Navigation */
.navbar {
    background: rgba(63, 48, 48, 0.1);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-logo {
    color: rgb(250, 185, 7);
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.nav-auth {
    display: flex;
    gap: 10px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

/* Main content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Auth forms */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.auth-form {
    background: rgba(21, 30, 39, 0.95);
    border: 2px solid rgba(250, 185, 7, 0.3);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    width: 100%;
    max-width: 400px;
    color: #fff;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    transform: translateY(10px);
    animation: slideUp 0.5s ease forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: rgb(250, 185, 7);
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.form-group {
    margin-bottom: 20px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(250, 185, 7, 0.3);
    border-radius: 8px;
    font-size: 16px;
    background: rgba(21, 30, 39, 0.8);
    color: #fff;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: rgb(250, 185, 7);
    box-shadow: 0 0 15px rgba(250, 185, 7, 0.3);
    background: rgba(21, 30, 39, 0.9);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: rgb(250, 185, 7);
    font-size: 14px;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: #fff;
}

.auth-switch a {
    color: rgb(250, 185, 7);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-switch a:hover {
    text-decoration: underline;
    color: rgba(250, 185, 7, 0.8);
}

/* Dashboard */
.dashboard {
    display: block;
}

.search-section,
.watching-section {
    background: rgba(250, 185, 7, 0.05);
    border: 1px solid rgba(250, 185, 7, 0.2);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.search-section h2,
.watching-section h2 {
    margin-bottom: 20px;
    color: rgb(250, 185, 7);
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 12px;
    border: 2px solid rgba(250, 185, 7, 0.5);
    border-radius: 5px;
    font-size: 16px;
    background: rgba(250, 185, 7, 0.1);
    color: #fff;
}

.search-input:focus {
    outline: none;
    border-color: rgb(250, 185, 7);
    background: rgba(250, 185, 7, 0.15);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* Search results */
.search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.search-item {
    background: rgba(250, 185, 7, 0.1);
    border: 1px solid rgba(250, 185, 7, 0.3);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.search-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 22px rgba(250, 185, 7, 0.25);
}

.search-item img {
    width: 100%;
    height: 350px;
    object-fit: cover;
}

.search-item-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.search-item-buttons {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 10px;
}

.search-item h3 {
    margin-bottom: 10px;
    font-size: 16px;
    color: #fff;
}

.search-item p {
    color: #fff;
    font-size: 14px;
    margin-bottom: 10px;
}

.search-item .media-type {
    background: rgb(250, 185, 7);
    color: #151e27;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 10px;
}

/* Button container for search items */
.search-item .btn {
    font-size: 13px;
    padding: 10px 16px;
    min-width: 100px;
    flex: 1;
    white-space: normal;
    text-overflow: unset;
    overflow: visible;
}

/* Watching list */
.watching-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 30px;
}

.watching-item {
    background: rgba(250, 185, 7, 0.1);
    border: 1px solid rgba(250, 185, 7, 0.3);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    display: flex;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.watching-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(250, 185, 7, 0.25);
}

.watching-item img {
    width: 150px;
    height: 225px;
    object-fit: cover;
}

.watching-item-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.watching-item h3 {
    margin-bottom: 12px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

.watching-progress {
    margin: 12px 0;
    color: #fff;
    font-weight: 500;
    font-size: 14px;
}

.episode-overview-container {
    margin: 12px 0;
}

.episode-overview {
    padding: 15px;
    background: rgba(250, 185, 7, 0.1);
    border-left: 4px solid rgb(250, 185, 7);
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    max-height: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    transition: max-height 0.3s ease, background 0.3s ease;
    position: relative;
}

.episode-overview.expanded {
    max-height: none;
    overflow: visible;
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    background: rgba(250, 185, 7, 0.15);
}

.read-more-btn {
    background: none;
    border: none;
    color: rgb(250, 185, 7);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 5px;
    padding: 4px 8px;
    text-decoration: underline;
    transition: color 0.3s ease;
    display: block;
}

.read-more-btn:hover {
    color: rgba(250, 185, 7, 0.8);
}

.watching-actions {
    margin-top: auto;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.watching-actions .btn {
    font-size: 13px;
    padding: 8px 14px;
    min-width: 90px;
    flex: 1;
    white-space: normal;
    text-overflow: unset;
    overflow: visible;
}

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

.modal-content {
    background: #151e27;
    border: 2px solid rgb(250, 185, 7);
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    color: #fff;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(250, 185, 7, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: rgb(250, 185, 7);
}

.modal-body {
    padding: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Episode and Season Selectors */
.season-selector,
.episode-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.selector-btn {
    padding: 8px 12px;
    border: 2px solid rgba(250, 185, 7, 0.5);
    border-radius: 6px;
    background: rgba(250, 185, 7, 0.1);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 45px;
    text-align: center;
}

.selector-btn:hover {
    border-color: rgb(250, 185, 7);
    background: rgba(250, 185, 7, 0.2);
}

.selector-btn.active {
    background: rgb(250, 185, 7);
    color: #151e27;
    border-color: rgb(250, 185, 7);
    font-weight: 600;
}

/* Episode buttons with titles */
.episode-btn {
    min-width: 120px;
    max-width: 180px;
    text-align: left;
    padding: 8px 10px;
    white-space: normal;
    height: auto;
    line-height: 1.2;
}

.episode-number {
    font-weight: bold;
    font-size: 12px;
    color: #fff;
}

.episode-btn.active .episode-number {
    color: #151e27;
}

.episode-title {
    font-size: 11px;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Movie toggle interface */
.movie-progress-interface {
    margin: 20px 0;
}

.movie-toggle {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.movie-toggle .selector-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 8px;
}

.movie-toggle .selector-btn:not(.active) {
    background: rgba(250, 185, 7, 0.1);
    color: #fff;
    border-color: rgba(250, 185, 7, 0.5);
}

.movie-toggle .selector-btn:not(.active):hover {
    background: rgba(250, 185, 7, 0.2);
    border-color: rgb(250, 185, 7);
}

/* Loading spinner */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    z-index: 1000;
    min-width: 300px;
}

.notification.error {
    background: #f44336;
}

.notification.warning {
    background: #ff9800;
}

#notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 20px;
    }

    .main-content {
        padding: 20px 10px;
    }

    .search-container {
        flex-direction: column;
    }

    .search-results {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .watching-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .watching-item {
        flex-direction: column;
    }

    .watching-item img {
        width: 100%;
        height: 250px;
    }

    .watching-actions {
        flex-direction: column;
        gap: 10px;
    }

    .watching-actions .btn {
        flex: none;
        width: 100%;
        min-width: auto;
    }

    .search-item .btn {
        font-size: 12px;
        padding: 8px 12px;
        min-width: auto;
    }

    .search-item img {
        height: 280px;
    }

    .search-item-content,
    .watching-item-content {
        padding: 20px;
    }
    
    .episode-overview-container {
        margin: 10px 0;
    }
    
    .episode-overview {
        font-size: 13px;
        max-height: 60px;
        padding: 12px;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }
    
    .episode-overview.expanded {
        max-height: none;
    }
    
    .read-more-btn {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .watching-item h3 {
        font-size: 16px;
    }

    .modal-actions {
        flex-direction: column;
    }
    
    .selector-btn {
        min-width: 40px;
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .episode-btn {
        min-width: 100px;
        max-width: 140px;
        padding: 6px 8px;
    }
    
    .episode-number {
        font-size: 11px;
    }
    
    .episode-title {
        font-size: 10px;
    }
    
    .season-selector,
    .episode-selector {
        gap: 6px;
    }
    
    /* User Profile Mobile Styles */
    .user-profile-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        gap: 15px;
    }
    
    .user-profile-avatar {
        align-self: center;
        margin-bottom: 10px;
    }
    
    .user-profile-info h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .search-item .btn {
        font-size: 11px;
        padding: 6px 10px;
        min-width: 70px;
    }

    .watching-actions .btn {
        font-size: 11px;
        padding: 6px 10px;
        min-width: auto;
    }

    .search-item-content,
    .watching-item-content {
        padding: 12px;
    }

    .search-results {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* User Profile Very Small Screens */
    .user-profile-page {
        padding: 10px;
    }
    
    .user-profile-header {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .user-profile-avatar {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .user-profile-info h1 {
        font-size: 1.25rem;
    }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #fff;
}

.empty-state img {
    width: 100px;
    height: 100px;
    opacity: 0.5;
    margin-bottom: 20px;
}

/* Detail Page */
.detail-page {
    display: block;
}

.back-btn {
    margin-bottom: 20px;
    color: rgb(250, 185, 7);
    border-color: rgb(250, 185, 7);
}

.back-btn:hover {
    background: rgb(250, 185, 7);
    color: #151e27;
}

.detail-content {
    background: rgba(250, 185, 7, 0.05);
    border: 1px solid rgba(250, 185, 7, 0.2);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.detail-header {
    position: relative;
    height: 400px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
}

.detail-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.detail-header-content {
    position: relative;
    z-index: 1;
    padding: 40px;
    color: white;
    display: flex;
    gap: 30px;
    align-items: flex-end;
}

.detail-poster {
    width: 200px;
    height: 300px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.detail-info h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.detail-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.detail-meta span {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 14px;
}

.detail-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 18px;
    font-weight: bold;
}

.detail-body {
    padding: 40px;
}

.detail-section {
    margin-bottom: 40px;
}

.detail-section h2 {
    margin-bottom: 20px;
    color: rgb(250, 185, 7);
    border-bottom: 2px solid rgb(250, 185, 7);
    padding-bottom: 10px;
}

.detail-overview {
    line-height: 1.6;
    color: #fff;
    font-size: 16px;
}

.cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
}

.cast-member {
    text-align: center;
}

.cast-member img {
    width: 100px;
    height: 150px;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 10px;
}

.cast-member h4 {
    font-size: 14px;
    margin-bottom: 5px;
    color: #fff;
}

.cast-member p {
    font-size: 12px;
    color: #fff;
}

.seasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.season-item {
    text-align: center;
    padding: 15px;
    background: rgba(250, 185, 7, 0.1);
    border: 1px solid rgba(250, 185, 7, 0.3);
    border-radius: 8px;
}

.season-item img {
    width: 100px;
    height: 150px;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 10px;
}

.season-item h4 {
    margin-bottom: 5px;
    color: #fff;
}

.season-item p {
    color: #fff;
    font-size: 14px;
}

.similar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.similar-item {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.similar-item:hover {
    transform: translateY(-5px);
}

.similar-item img {
    width: 100%;
    height: 225px;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 10px;
}

.similar-item h4 {
    font-size: 14px;
    color: #fff;
    text-align: center;
}

.detail-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Responsive design for detail page */
@media (max-width: 768px) {
    .detail-header {
        height: 300px;
    }
    
    .detail-header-content {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .detail-poster {
        width: 150px;
        height: 225px;
    }
    
    .detail-info h1 {
        font-size: 2rem;
    }
    
    .detail-body {
        padding: 20px;
    }
    
    .cast-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .seasons-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .similar-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* Placeholder and fallback image styles */
.placeholder-image {
    opacity: 0.7;
    filter: grayscale(50%);
    border: 1px dashed #ccc;
}

.fallback-image {
    opacity: 0.5;
    filter: grayscale(100%);
    border: 2px dashed #999;
    background-color: #f5f5f5;
}

/* Users Section */
.users-section {
    margin-top: 3rem;
}

.users-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 1rem;
}

.user-card {
    background: rgba(21, 30, 39, 0.95);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(250, 185, 7, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.user-card:hover {
    border-color: rgb(250, 185, 7);
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(250, 185, 7, 0.15);
}

.user-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.user-avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgb(250, 185, 7), rgba(250, 185, 7, 0.6));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: bold;
    color: #151e27;
    box-shadow: 0 4px 10px rgba(250, 185, 7, 0.3);
}

.user-info {
    flex: 1;
}

.user-info h3 {
    color: #fff;
    margin-bottom: 5px;
    font-size: 1.3rem;
    font-weight: 600;
}

.user-info p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.currently-watching {
    color: rgb(250, 185, 7);
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(250, 185, 7, 0.1);
    padding: 4px 8px;
    border-radius: 8px;
    margin-top: 8px;
    border-left: 3px solid rgb(250, 185, 7);
}

.user-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 8px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.stat-item:hover {
    background: rgba(250, 185, 7, 0.1);
}

.stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: bold;
    color: rgb(250, 185, 7);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.view-profile-hint {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    font-style: italic;
    padding: 8px;
    background: rgba(250, 185, 7, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.user-card:hover .view-profile-hint {
    color: rgb(250, 185, 7);
    background: rgba(250, 185, 7, 0.1);
}

/* User Profile Page */
.user-profile-page {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.user-profile-content {
    margin-top: 20px;
}

.user-profile-header {
    background: rgba(21, 30, 39, 0.9);
    border-radius: 10px;
    padding: 30px;
    border: 1px solid rgba(250, 185, 7, 0.2);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 25px;
}

.user-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgb(250, 185, 7), rgba(250, 185, 7, 0.6));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
    color: #151e27;
}

.user-profile-info h1 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 2rem;
}

.user-profile-info p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    margin-bottom: 20px;
}

.comprehensive-stats {
    margin-top: 20px;
}

.stats-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    flex: 1;
    min-width: 120px;
    border: 1px solid rgba(250, 185, 7, 0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(250, 185, 7, 0.1);
    border-color: rgba(250, 185, 7, 0.3);
}

.stat-card .stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: rgb(250, 185, 7);
    margin-bottom: 5px;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.media-stat .sub-stat {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

.filter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(250, 185, 7, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn:hover {
    background: rgba(250, 185, 7, 0.1);
    border-color: rgba(250, 185, 7, 0.5);
    color: rgb(250, 185, 7);
}

.filter-btn.active {
    background: rgb(250, 185, 7);
    color: #151e27;
    border-color: rgb(250, 185, 7);
    font-weight: 600;
}

.user-watching-section {
    margin-top: 40px;
}

.user-watching-section h2 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.user-watching-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.user-watching-card {
    background: rgba(21, 30, 39, 0.95);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(250, 185, 7, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.user-watching-card:hover {
    border-color: rgb(250, 185, 7);
    box-shadow: 0 8px 25px rgba(250, 185, 7, 0.15);
    transform: translateY(-3px);
}

.user-watching-header {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.user-watching-poster {
    width: 70px;
    height: 105px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.user-watching-info {
    flex: 1;
}

.show-title {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 8px;
    font-weight: 600;
    line-height: 1.3;
    padding-right: 100px; /* Add space for the media type badge */
}

.progress-container {
    margin-top: 8px;
}

.progress-completed {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.progress-watching {
    background: linear-gradient(135deg, rgb(250, 185, 7), rgba(250, 185, 7, 0.8));
    color: #151e27;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.progress-episode {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    letter-spacing: 0.5px;
}

.progress-details {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    margin-top: 6px;
    line-height: 1.4;
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, rgb(250, 185, 7), rgba(250, 185, 7, 0.8));
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-percentage {
    color: rgb(250, 185, 7);
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 35px;
    text-align: right;
}

.media-type-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-movie {
    background: rgba(156, 39, 176, 0.2);
    color: #ce93d8;
    border: 1px solid rgba(156, 39, 176, 0.3);
}

.badge-tv {
    background: rgba(33, 150, 243, 0.2);
    color: #90caf9;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

/* Completion Banner */
.completion-banner {
    background: rgba(76, 175, 80, 0.2);
    border: 2px solid rgba(76, 175, 80, 0.5);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    color: #fff;
}

.completion-message {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.completion-message span {
    color: #4caf50;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    min-width: auto;
}

/* Small screen adjustments for completion banner */
@media (max-width: 480px) {
    .completion-message {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .completion-message span {
        font-size: 14px;
    }
}

