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

/* LOGOUT BUTTON - Animated, Fixed Right Position, Responsive */
.logout-btn {
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 24px 10px 18px;
    font-size: 1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px #e74c3c22;
    outline: none;
    opacity: 0;
    animation: fadeInRightBtn 0.8s 0.2s cubic-bezier(.21,1.02,.73,1.07) forwards;
    transition: background 0.22s, box-shadow 0.18s, transform 0.12s;
}

@keyframes fadeInRightBtn {
    from { opacity: 0; transform: translateY(-50%) translateX(60px) scale(0.95);}
    to   { opacity: 1; transform: translateY(-50%) translateX(0) scale(1);}
}

.logout-btn i {
    font-size: 1.18em;
}

.logout-btn:hover, .logout-btn:focus {
    background: #c0392b;
    box-shadow: 0 4px 16px #e74c3c44;
    transform: translateY(-50%) scale(1.06);
    outline: none;
}

@media (max-width: 900px) {
    .navbar {
        flex-wrap: wrap;
        height: auto;
        min-height: 54px;
        padding-bottom: 8px;
        position: relative;
    }
    .logout-btn {
        position: static;
        margin: 10px 0 0 auto;
        transform: none;
        width: auto;
        font-size: 0.96em;
        padding: 8px 18px 8px 12px;
        opacity: 1;
        animation: fadeInRightBtnMobile 0.7s 0.18s cubic-bezier(.21,1.02,.73,1.07) forwards;
    }
    @keyframes fadeInRightBtnMobile {
        from { opacity: 0; transform: translateX(40px) scale(0.95);}
        to   { opacity: 1; transform: translateX(0) scale(1);}
    }
}

@media (max-width: 600px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 0 6px 0;
        box-shadow: 0 1px 4px #0002;
        height: auto;
    }
    .logout-btn {
        width: 95vw;
        margin: 10px auto 0 auto;
        border-radius: 7px;
        padding: 9px 0;
        justify-content: center;
        font-size: 1em;
        opacity: 1;
    }
}




/* Responsive, animated style for datetime and user login in navbar */

.datetime-display {
    background: linear-gradient(90deg, #ffe0b2 0%, #ffcc80 100%);
    color: #444;
    padding: 7px 18px;
    border-radius: 8px;
    font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
    font-weight: 600;
    font-size: 1.02rem;
    margin-right: 10px;
    margin-left: 12px;
    box-shadow: 0 1px 4px #ffb30025;
    display: inline-block;
    letter-spacing: 0.5px;
    animation: navbarFadeIn 0.8s cubic-bezier(.33,1.2,.44,1) both;
    transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}
.user-login-display {
    background: linear-gradient(90deg, #bbdefb 0%, #90caf9 100%);
    color: #1565c0;
    padding: 7px 18px;
    border-radius: 8px;
    font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
    font-weight: 700;
    font-size: 1.02rem;
    margin-right: 18px;
    margin-left: 8px;
    display: inline-block;
    letter-spacing: 0.8px;
    box-shadow: 0 1px 4px #64b5f625;
    animation: navbarFadeInRight 1.1s cubic-bezier(.33,1.2,.44,1) both 0.12s;
    transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}
@keyframes navbarFadeIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.95);}
    to { opacity: 1; transform: translateY(0) scale(1);}
}
@keyframes navbarFadeInRight {
    from { opacity: 0; transform: translateX(40px) scale(0.95);}
    to   { opacity: 1; transform: translateX(0) scale(1);}
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .datetime-display,
    .user-login-display {
        font-size: 0.95rem;
        padding: 6px 12px;
        margin-right: 6px;
        margin-left: 6px;
        border-radius: 7px;
    }
}
@media (max-width: 600px) {
    .datetime-display,
    .user-login-display {
        font-size: 0.91rem;
        display: block;
        width: 92vw;
        margin: 5px auto;
        text-align: left;
        padding: 6px 9vw 6px 6vw;
        border-radius: 6px;
    }
}

/* --- NAVBAR (kept as before, with animation) --- */
.navbar {
    z-index: 1000;
    display: flex;
    height: 60px;
    width: 100%;
    background-color: rgb(255, 255, 255);
    align-items: center;
    position: fixed;
    opacity: .95;
    box-shadow: 0px .1px 3px;
    top: 0;
    left: 0;
    animation: navFadeIn 1.1s;
}
@keyframes navFadeIn {
    from { opacity: 0; transform: translateY(-40px);}
    to { opacity: 1; transform: translateY(0);}
}
.navlogo {
    height: 45px;
    width: 90px;
    margin-left: 30px;
}
.navlogo img {
    height: 45px;
    width: 90px;
    animation: logoPop 1.5s;
}
@keyframes logoPop {
    from { transform: scale(0.7) rotate(-15deg); opacity: 0; }
    60% { transform: scale(1.1) rotate(3deg); opacity: 1; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}
.navtext ol {
    display: flex;
    gap: 40px;
    margin-left: 60px;
    font-family: cursive;
    color: rgb(75, 84, 81);
    font-weight: bold;
}
.navtext .hov-home a:hover,
.navtext .hov-courses:hover,
.navtext .hov-roadmap:hover,
.navtext .hov-compiler:hover,
.navtext .hov-competitive:hover,
.navtext .hov-aiassiatant:hover,
.navtext .hov-profile:hover {
    color: orange;
    transition: color .3s ease;
    animation: navItemPulse 0.4s;
}
@keyframes navItemPulse {
    0% { color: orange; }
    50% { color: #f6a933; }
    100% { color: orange; }
}
.navtext ol li { list-style: none; }
.navtext ol li a {
    text-decoration: none;
    color: black;
    position: relative;
    transition: color .3s ease;
}
.navtext ol li a:hover {
    color: orange;
    transition: color .3s ease;
}
.navtext ol li a::after {
    display: none !important;
}
.navtext ol li a {
    text-decoration: none !important;
}

/* Profile Container */
.profile-container {
    padding-top: 100px;
    min-height: 100vh;
    background: #f8f9fa;
    position: relative;
    transition: background 0.7s;
    animation: fadeInProfile 0.7s;
}
@keyframes fadeInProfile {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Profile Header Section */
.profile-header {
    position: relative;
    margin-bottom: 180px;
    animation: slideHeaderIn 1s;
}
@keyframes slideHeaderIn {
    from { opacity: 0; transform: translateY(-60px);}
    to { opacity: 1; transform: translateY(0);}
}
.profile-cover {
    height: 250px;
    background: var(--gradient-primary, linear-gradient(135deg, #ffb347 0%, #ff9966 100%));
    position: relative;
    overflow: hidden;
    animation: gradientMove 6s infinite linear alternate;
}
@keyframes gradientMove {
    0% { background-position: left top; }
    100% { background-position: right bottom; }
}

/* Profile Info Section */
.profile-info {
    position: absolute;
    left: 50%;
    bottom: -140px;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 2;
    animation: fadeInProfileInfo 1.2s;
}
@keyframes fadeInProfileInfo {
    from { opacity: 0; transform: translateY(80px);}
    to { opacity: 1; transform: translateY(0);}
}

/* Profile Avatar */
.profile-avatar {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 8px solid white;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background: white;
    position: relative;
    z-index: 3;
    animation: avatarBounceIn 1.2s;
}
@keyframes avatarBounceIn {
    0% { transform: scale(0.7); opacity: 0;}
    70% { transform: scale(1.15); opacity: 1;}
    100% { transform: scale(1); opacity: 1; }
}
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Profile Details */
.profile-details {
    padding: 2rem;
    width: 100%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-top: -30px;
    animation: fadeInProfileDetails 1.3s;
}
@keyframes fadeInProfileDetails {
    from { opacity: 0; transform: scale(0.95);}
    to { opacity: 1; transform: scale(1);}
}
.profile-details h1 {
    margin: 0;
    padding: 0.5rem 0;
    color: var(--text-color, #333);
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 1px;
    animation: colorWipe 1.5s;
}
@keyframes colorWipe {
    from { color: #ff9800;}
    to { color: var(--text-color, #333);}
}
.username {
    color: var(--primary-color, #ff9800);
    font-weight: 600;
    font-size: 1.2rem;
    margin: 0.5rem 0;
    padding: 0;
    letter-spacing: 0.5px;
}
.joined-date {
    color: #666;
    font-size: 0.9rem;
    margin: 0.5rem 0;
    padding: 0;
    letter-spacing: 0.3px;
}

/* Stats Section */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    animation: statsFadeIn 1.3s;
}
@keyframes statsFadeIn {
    0% { opacity: 0; transform: translateY(50px);}
    100% { opacity: 1; transform: translateY(0);}
}
.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s cubic-bezier(.32,2,.55,.27), box-shadow 0.3s;
    animation: statCardPopIn 1.1s;
    will-change: transform;
}
@keyframes statCardPopIn {
    0% { opacity: 0; transform: scale(0.89) rotate(-7deg);}
    70% { opacity: 1; transform: scale(1.03) rotate(2deg);}
    100% { opacity: 1; transform: scale(1) rotate(0);}
}
.stat-card:hover {
    transform: translateY(-7px) scale(1.04) rotate(-2deg);
    box-shadow: 0 12px 32px #ff98001a;
}
.stat-card i {
    font-size: 2.5rem;
    color: var(--primary-color, #ff9800);
    margin-bottom: 1rem;
    animation: iconGlow 2s infinite alternate;
}
@keyframes iconGlow {
    from { text-shadow: 0 0 0 #ff9800; }
    to { text-shadow: 0 0 12px #ff9800, 0 0 20px #ff980055; }
}
.stat-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color, #333);
    font-size: 1.2rem;
    letter-spacing: 0.7px;
}
.stat-card p {
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--primary-color, #ff9800);
    margin: 0;
    letter-spacing: 1px;
    animation: statNumPop 2s cubic-bezier(.52,2.5,.5,.6) 1;
}
@keyframes statNumPop {
    0% { transform: scale(0.7); opacity: 0.6;}
    70% { transform: scale(1.06);}
    100% { transform: scale(1); opacity: 1;}
}

/* Profile Content Section */
.profile-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 5%;
    animation: fadeInProfileContent 1.1s 0.3s backwards;
}
@keyframes fadeInProfileContent {
    from { opacity: 0; transform: translateY(60px);}
    to { opacity: 1; transform: translateY(0);}
}

/* Tabs Section */
.profile-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: white;
    padding: 1rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    animation: tabSlideIn 1.3s;
}
@keyframes tabSlideIn {
    from { opacity: 0; transform: translateY(40px);}
    to { opacity: 1; transform: translateY(0);}
}
.tab-btn {
    padding: 1rem 2rem;
    border: none;
    background: none;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(.34,2,.65,.24);
    font-size: 1.07rem;
    letter-spacing: .5px;
}
.tab-btn.active {
    color: white;
    background: var(--primary-color, #ff9800);
    box-shadow: 0 2px 10px #ff980044;
    animation: tabActivePop 0.6s;
}
@keyframes tabActivePop {
    from { background: #ffb347; }
    to { background: var(--primary-color, #ff9800);}
}

/* Progress Section */
.course-progress {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeInProgress 1.5s;
}
@keyframes fadeInProgress {
    from { opacity: 0; }
    to { opacity: 1; }
}
.progress-item {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    animation: progressPop 1.15s;
}
@keyframes progressPop {
    from { opacity: 0; transform: scale(.93);}
    to { opacity: 1; transform: scale(1);}
}
.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.progress-header h3 {
    font-size: 1.1rem;
    color: var(--text-color, #333);
    margin: 0;
}
.progress-header span {
    font-weight: 600;
    color: var(--primary-color, #ff9800);
}
.progress-bar {
    height: 10px;
    background: #eee;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 10px #ff98001a;
    margin-top: 2px;
}
.progress {
    height: 100%;
    background: linear-gradient(90deg, #ff9800, #ff5722 80%);
    border-radius: 5px;
    transition: width 0.7s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 1px 6px #ff980025;
}

/* Animations for fade/slide in elements */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    animation: slideInLeft 0.5s ease forwards;
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px);}
    to { opacity: 1; transform: translateX(0);}
}
.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    animation: slideInRight 0.5s ease forwards;
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px);}
    to { opacity: 1; transform: translateX(0);}
}

/* Responsive Design */
@media (max-width: 1200px) {
    .profile-container,
    .profile-content,
    .profile-stats {
        max-width: 100vw;
        padding-left: 2vw;
        padding-right: 2vw;
    }
    .profile-details { max-width: 95vw; }
}
@media (max-width: 1024px) {
    .profile-stats {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1.3rem;
        padding: 2rem 2vw;
    }
    .profile-content { padding: 2rem 2vw; }
}
@media (max-width: 900px) {
    .profile-header { margin-bottom: 210px; }
    .profile-info { bottom: -170px; width: 96%; }
    .profile-avatar { width: 120px; height: 120px; border-width: 4px; }
    .profile-details { padding: 1rem; }
    .profile-details h1 { font-size: 1.5rem;}
    .stat-card { padding: 1.2rem;}
    .stat-card i { font-size: 2rem;}
    .stat-card p { font-size: 1.3rem;}
    .profile-tabs { flex-direction: column; padding: 0.5rem; }
    .tab-btn { width: 100%; text-align: center; padding: 0.7rem; font-size: 1rem;}
    .course-progress { gap: 1rem;}
    .progress-item { padding: 1rem; }
    .progress-header h3 { font-size: 1rem;}
}
@media (max-width: 700px) {
    .profile-header { margin-bottom: 240px;}
    .profile-info { bottom: -190px;}
    .profile-avatar { width: 100px; height: 100px; }
    .profile-details { padding: 0.6rem;}
    .profile-details h1 { font-size: 1.1rem;}
    .username { font-size: .95rem;}
}
@media (max-width: 540px) {
    .profile-container { padding-top: 70px; }
    .profile-header { margin-bottom: 260px;}
    .profile-info { bottom: -215px;}
    .profile-avatar { width: 80px; height: 80px; }
    .profile-details { padding: 0.5rem;}
    .stat-card { padding: 0.6rem;}
    .profile-content { padding: 1rem 1vw;}
    .profile-tabs { padding: 0.3rem;}
    .tab-btn { padding: 0.4rem; font-size: 0.93rem;}
}
@media (max-width: 400px) {
    .profile-header { margin-bottom: 275px;}
    .profile-info { bottom: -235px; width: 99%; }
    .profile-avatar { width: 60px; height: 60px; }
    .profile-details { padding: 0.2rem;}
    .profile-details h1 { font-size: 0.9rem;}
    .stat-card { padding: 0.3rem;}
    .stat-card i { font-size: 1.5rem;}
    .stat-card p { font-size: 1rem;}
    .profile-content { padding: 0.3rem;}
}