/* Profile Page Styling */
.profile-page {
    color: var(--heading);
    min-height: 100vh;
    direction: ltr;
    position: relative;
    background: #00031c; /* Consistent with Movie and Series Details */
}

.profile-page .section-divider {
    border: none;
    height: 2px;
    background: linear-gradient(248.28deg, var(--btn-bgcolor) 9.54%, rgba(142,97,255,0) 32.8%), 
                radial-gradient(81.71% 279.87% at -16.57% -92%, var(--btn-bgcolor2) 28.69%, rgba(205,219,248,0) 69.54%), 
                var(--btn-bgcolor3);
    margin: 10px 0 20px;
    opacity: 0.8;
}

/* Header Section */
.profile-page .profile-header {
    position: relative;
    height: 500px;
    overflow: hidden;
    z-index: 1; /* Ensure header is below profile-info */
}

.profile-page .profile-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7) blur(5px);
}

.profile-page .profile-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, #00031c 20%, rgb(0 3 28 / 70%) 80%, rgba(0, 3, 28, 0) 91.32%), 
                linear-gradient(90deg, #00031c 0%, rgba(0, 3, 28, 0) 78.64%);
}

.profile-info-container2 {
    position: absolute;
    top: 120px;
    left: 0;
    width: 100%;
    padding: 0 60px;
    margin: 0 auto;
    z-index: 20; /* Above header */
}

.profile-info {
    background: linear-gradient(to top, #00031c 0%, rgb(118 118 118 / 62%) 100%);
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    min-height: 300px;
    z-index: 20; /* Ensure above header */
}

.profile-page .profile-avatar {
    width: 250px;
    height: 0%;
    /* min-width: 80px; */
    border: 1px solid var(--main);
    object-fit: cover;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    border-radius: 12px;
}

.profile-page .profile-avatar:hover {
    transform: scale(1.05);
}

.profile-page .profile-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-page .profile-name {
    font-size: 1.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--heading);
    transition: color 0.3s ease;
}

.profile-page .profile-name:hover {
    color: var(--main);
}

.profile-page .profile-bio {
    font-size: 1rem;
    color: var(--body);
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.5;
    max-height: 100px; /* Limit height to prevent overlap */
    overflow: hidden;
    position: relative;
}

.profile-page .bio-more {
    color: var(--main);
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
    transition: color 0.3s ease;
}

.profile-page .bio-more:hover {
    color: var(--heading);
}

.profile-page .profile-language {
    font-size: 1rem;
    color: var(--body);
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.5;
}

/* Biography Modal */
.bio-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 3, 28, 0.9);
    backdrop-filter: blur(5px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.bio-modal.active {
    display: flex;
}

.bio-modal-content {
    position: relative;
    background: var(--background-item);
    padding: 20px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    animation: modalEntrance 0.5s ease-out forwards;
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--main) var(--background-item);
}

.bio-modal-content::-webkit-scrollbar {
    width: 8px;
}

.bio-modal-content::-webkit-scrollbar-track {
    background: var(--background-item);
}

.bio-modal-content::-webkit-scrollbar-thumb {
    background: var(--main);
    border-radius: 4px;
}

@keyframes modalEntrance {
    from { opacity: 0; transform: scale(0.7) translateY(-50px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.bio-modal-content h2 {
    font-size: 1.5rem;
    color: var(--heading);
    margin-bottom: 15px;
}

.bio-modal-content p {
    font-size: 1rem;
    color: var(--body);
    line-height: 1.6;
}

.close-bio {
    position: absolute;
    top: -15px;
    right: -15px;
    background: var(--main);
    color: var(--heading);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.3s ease, transform 0.3s ease;
}

.close-bio:hover {
    background: var(--main);
    transform: rotate(90deg);
}

/* Social Links Styling */
.social-links {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.social-links a {
    color: var(--heading);
    font-size: 1.5rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    color: var(--main);
    transform: scale(1.1);
}

/* Content Section */
.profile-page .profile-content {
    margin: 0 auto;
    padding: 40px 60px;
    position: relative;
    z-index: 10; /* Below profile-info */
}

.profile-page .profile-section {
    margin-bottom: 50px;
}

.profile-page .profile-section-title {
    font-size: 1.3rem;
    font-weight: 500;
    text-align: left;
    font-family: 'Metropolitano', 'Arial', sans-serif;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--heading);
}

.profile-page .movies-no-content {
    color: var(--body);
    text-align: center;
    padding: 40px;
    font-size: 1rem;
}

/* Movies Grid */
.profile-page .movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    box-sizing: border-box;
    padding: 15px 0;
    position: relative;
    z-index: 5; /* Below profile-info */
}

.profile-page .movie-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: var(--background-item);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    animation: cardEntrance 0.8s ease-out forwards;
}

.profile-page .movie-card[data-index="0"] { animation-delay: 0.1s; }
.profile-page .movie-card[data-index="1"] { animation-delay: 0.2s; }
.profile-page .movie-card[data-index="2"] { animation-delay: 0.3s; }
.profile-page .movie-card[data-index="3"] { animation-delay: 0.4s; }
.profile-page .movie-card[data-index="4"] { animation-delay: 0.5s; }
.profile-page .movie-card[data-index="5"] { animation-delay: 0.6s; }
.profile-page .movie-card[data-index="6"] { animation-delay: 0.7s; }
.profile-page .movie-card[data-index="7"] { animation-delay: 0.8s; }
.profile-page .movie-card[data-index="8"] { animation-delay: 0.9s; }
.profile-page .movie-card[data-index="9"] { animation-delay: 1.0s; }

@keyframes cardEntrance {
    from { opacity: 0; transform: translateY(50px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.profile-page .movie-card:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6);
}

.profile-page .movie-poster {
    position: relative;
}

.profile-page .movie-poster img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s ease, filter 0.6s ease;
}

.profile-page .movie-card:hover .movie-poster img {
    transform: scale(1.12);
    filter: brightness(0.65);
}

.profile-page .movie-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.profile-page .vignette-card {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    background: linear-gradient(to top, #00031c 30%, transparent 100%); /* Consistent with Movie Details */
    opacity: 0;
    transition: opacity 0.5s ease;
}

.profile-page .movie-card:hover .vignette-card {
    opacity: 1;
}

.profile-page .movie-title {
    color: var(--heading);
    font-size: 0.85rem;
    font-weight: 700;
    text-align: left;
    margin: 0 0 3px;
    opacity: 0;
    transform: translateY(-12px);
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.profile-page .movie-card:hover .movie-title {
    transform: translateY(0);
    opacity: 1;
}

.profile-page .movie-overview {
    color: var(--body);
    font-size: 0.65rem;
    line-height: 1.3;
    text-align: left;
    margin: 0;
    transform: translateY(12px);
    opacity: 0;
    transition: transform 0.4s ease 0.1s, opacity 0.4s ease 0.1s;
}

.profile-page .movie-card:hover .movie-overview {
    transform: translateY(0);
    opacity: 1;
}

.profile-page .movie-meta {
    color: var(--body);
    font-size: 0.6rem;
    text-align: left;
    margin: 3px 0 0;
    transform: translateY(12px);
    opacity: 0;
    transition: transform 0.4s ease 0.2s, opacity 0.4s ease 0.2s;
}

.profile-page .movie-card:hover .movie-meta {
    transform: translateY(0);
    opacity: 1;
}

.profile-page .movie-rating {
    position: absolute;
    top: 6px;
    right: 6px;
    color: var(--heading);
    font-size: 0.65rem;
    font-weight: 600;
    background: rgb(1 3 28 / 83%);
    padding: 2px 4px;
    border-radius: 50px;
    opacity: 1;
}

.profile-page .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    color: var(--heading);
    background: var(--main);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    transition: transform 0.4s ease 0.3s, opacity 0.4s ease 0.3s;
}

.profile-page .play-button i {
    font-size: 1.2rem;
}

.profile-page .movie-card:hover .play-button {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.profile-page .load-more-button {
    background: var(--main);
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    color: var(--heading);
    font-size: 1rem;
    cursor: pointer;
    display: block;
    margin: 20px auto;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-page .load-more-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 991px) {
    .profile-page {
        padding: 0 15px; /* Matches Movie and Series Details */
    }
    .profile-info-container2 {
        padding: 0 15px;
    }
    .profile-page .profile-content {
        padding: 30px 15px;
    }
}

@media (max-width: 576px) {
    .profile-page {
        padding: 0 10px; /* Matches Movie and Series Details */
    }
    .profile-info-container2 {
        padding: 0 10px;
    }
    .profile-page .profile-content {
        padding: 20px 10px;
    }
    .profile-page .movie-overlay {
        padding: 12px; /* Matches Movie and Series Details */
    }
    .profile-page .movie-title {
        font-size: 0.8rem; /* Matches Movie and Series Details */
    }
    .profile-page .movie-overview {
        font-size: 0.6rem; /* Matches Movie and Series Details */
    }
    .profile-page .movie-meta,
    .profile-page .movie-rating {
        font-size: 0.55rem; /* Matches Movie and Series Details */
    }
    .profile-page .play-button {
        width: 35px;
        height: 35px;
    }
    .profile-page .play-button i {
        font-size: 1rem;
    }
    .profile-page .profile-name {
        font-size: 1.8rem;
    }
    .profile-page .profile-bio,
    .profile-page .profile-language {
        font-size: 1rem;
    }
}

@media (max-width: 1024px) {
    .profile-page .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    .profile-page .profile-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        max-height: 400px;
            overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--main) var(--background-item);
    }
    .profile-page .profile-avatar {
        margin-bottom: 15px;
    }
    .profile-info-container2 {
        top: 100px;
    }
}

@media (max-width: 768px) {
    .profile-page .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    .profile-page .profile-section-title {
        font-size: 1.2rem; /* Matches Movie and Series Details */
    }
    .profile-page .profile-header {
        height: 350px;
    }
    .profile-info-container2 {
        top: 80px;
        padding: 0 10px;
    }
    .profile-page .profile-content {
        padding: 30px 10px;
        margin-top: 150px;
    }
    .profile-page .profile-avatar {
        width: 70px;
        height: 70px;
        min-width: 70px;
        max-width: 70px;
    }
}

@media (max-width: 640px) {
    .profile-page .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
    .profile-page .profile-section-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .profile-page .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    .profile-page .profile-section-title {
        font-size: 1rem; /* Matches Movie and Series Details */
    }
    .profile-page .movie-title {
        font-size: 0.75rem; /* Matches Movie and Series Details */
    }
    .profile-page .movie-overview {
        font-size: 0.55rem; /* Matches Movie and Series Details */
    }
    .profile-page .movie-meta,
    .profile-page .movie-rating {
        font-size: 0.5rem; /* Matches Movie and Series Details */
    }
    .profile-page .play-button {
        width: 32px;
        height: 32px; /* Matches Movie and Series Details */
    }
    .profile-page .play-button i {
        font-size: 0.9rem; /* Matches Movie and Series Details */
    }
    .profile-page .profile-name {
        font-size: 1.6rem;
    }
    .profile-page .profile-bio,
    .profile-page .profile-language {
        font-size: 0.9rem;
    }
    .profile-page .profile-avatar {
        width: 60px;
        height: 60px;
        min-width: 60px;
        max-width: 60px;
    }
}