/**
 * Public Profile Page Styles
 * External CSS for user/public_profile.php
 */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Tajawal', sans-serif;
    background-color: #f0f5f9;
    color: #334756;
    line-height: 1.6;
}

/* ==================== MAIN CONTAINER ==================== */
.profile-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

/* ==================== GLASS MORPHISM CARDS ==================== */
.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 25px;
    margin-bottom: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(31, 38, 135, 0.2);
}

/* ==================== PROFILE HEADER ==================== */
.profile-header {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-image: linear-gradient(135deg, #5b247a, #1bcedf);
    color: white;
    border-radius: 20px;
    padding: 40px 20px;
    text-align: center;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg,
            rgba(255, 255, 255, 0.1) 25%,
            transparent 25%,
            transparent 50%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.1) 75%,
            transparent 75%,
            transparent);
    background-size: 15px 15px;
    opacity: 0.3;
    z-index: 0;
}

.profile-avatar-wrapper {
    position: relative;
    margin-bottom: 20px;
    z-index: 1;
}

.profile-avatar {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 5px solid white;
    object-fit: cover;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.level-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    background: linear-gradient(135deg, #f83600, #f9d423);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.profile-name {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.profile-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
    z-index: 1;
}

.meta-item {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.meta-item:hover {
    transform: translateY(-3px);
    background-color: rgba(255, 255, 255, 0.3);
}

.meta-item i {
    margin-left: 8px;
    font-size: 1.1rem;
}

/* ==================== PROGRESS BAR ==================== */
.progress-container {
    width: 70%;
    margin: 15px auto;
    position: relative;
    z-index: 1;
}

.progress-bar-bg {
    height: 12px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f83600, #f9d423);
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

/* ==================== FOLLOW BUTTON ==================== */
.follow-section {
    margin-top: 20px;
    z-index: 1;
}

.follow-button {
    background: white;
    color: #5b247a;
    border: none;
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.follow-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.follow-button.following {
    background-color: transparent;
    border: 2px solid white;
    color: white;
}

.notify-toggle {
    margin-right: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notify-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

.notify-toggle.active {
    background: #f83600;
}

/* ==================== STATS SECTION ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff, #f5f7fa);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.stat-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #5b247a, #1bcedf);
    transition: height 0.3s ease;
}

.stat-card:hover::before {
    height: 8px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(91, 36, 122, 0.1);
    color: #5b247a;
    font-size: 1.8rem;
    border-radius: 50%;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1);
    background-color: rgba(91, 36, 122, 0.2);
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    color: #5b247a;
    background: linear-gradient(135deg, #5b247a, #1bcedf);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    margin-top: 8px;
    font-size: 1rem;
    color: #8d99ae;
}

/* ==================== CONTENT SECTIONS ==================== */
.content-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #5b247a;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #5b247a, #1bcedf);
    border-radius: 3px;
}

/* ==================== TOP EXAMS SECTION ==================== */
.exam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.exam-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.exam-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.exam-header {
    padding: 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.exam-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #334756;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    box-orient: vertical;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 2.8rem;
}

.exam-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #8d99ae;
}

.exam-body {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.exam-stat {
    flex: 1 1 30%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

.exam-stat:hover {
    background-color: #e9ecef;
}

.exam-stat i {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: #5b247a;
}

.exam-stat span {
    font-size: 0.9rem;
    font-weight: 600;
    color: #334756;
}

/* ==================== ACTIVITY FEED ==================== */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
}

.activity-item:hover {
    transform: translateX(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.activity-item::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 5px;
    border-radius: 0 12px 12px 0;
}

.activity-item.download::before {
    background-color: #fca311;
}

.activity-item.upload::before {
    background-color: #5b247a;
}

.activity-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.activity-icon.download {
    background-color: rgba(252, 163, 17, 0.1);
    color: #fca311;
}

.activity-icon.upload {
    background-color: rgba(91, 36, 122, 0.1);
    color: #5b247a;
}

.activity-content {
    flex-grow: 1;
}

.activity-title {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 1rem;
}

.activity-title a {
    color: #5b247a;
    text-decoration: none;
    transition: color 0.3s ease;
}

.activity-title a:hover {
    color: #1bcedf;
    text-decoration: underline;
}

.activity-date {
    font-size: 0.85rem;
    color: #8d99ae;
}

/* ==================== ACHIEVEMENTS SECTION ==================== */
.achievements-showcase {
    margin-top: 20px;
}

.achievement-card {
    display: flex;
    background: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    height: 100%;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.achievement-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, #f83600, #f9d423);
    border-radius: 0 15px 15px 0;
}

.achievement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.achievement-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(91, 36, 122, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #5b247a;
    margin-left: 15px;
    flex-shrink: 0;
}

.achievement-content {
    flex-grow: 1;
}

.achievement-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: #334756;
}

.achievement-desc {
    font-size: 0.85rem;
    color: #8d99ae;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
}

.achievement-date {
    font-size: 0.8rem;
    color: #5b247a;
}

.more-achievements-text {
    display: inline-block;
    background: rgba(91, 36, 122, 0.1);
    color: #5b247a;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 600;
}

/* ==================== FOLLOWERS SECTION ==================== */
.followers-section {
    margin-top: 30px;
}

.followers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 20px;
}

.follower-card {
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.follower-card:hover {
    transform: translateY(-5px);
}

.follower-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin: 0 auto 10px;
    transition: all 0.3s ease;
}

.follower-card:hover .follower-avatar {
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: #5b247a;
}

.follower-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0 0 5px 0;
    color: #334756;
}

.follower-date {
    font-size: 0.8rem;
    color: #8d99ae;
}

.see-all-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 25px;
    background: linear-gradient(135deg, #5b247a, #1bcedf);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.see-all-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* ==================== EMPTY STATES ==================== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state i {
    font-size: 3rem;
    color: #d0d7de;
    margin-bottom: 15px;
}

.empty-state-text {
    font-size: 1.1rem;
    color: #8d99ae;
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 300px;
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 15px;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-right: 4px solid #10b981;
}

.toast.error {
    border-right: 4px solid #ef4444;
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.toast.error .toast-icon {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.toast-message {
    flex-grow: 1;
    font-size: 0.95rem;
}

.toast-close {
    background: none;
    border: none;
    color: #8d99ae;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    line-height: 1;
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .profile-avatar {
        width: 120px;
        height: 120px;
    }

    .profile-name {
        font-size: 2rem;
    }

    .progress-container {
        width: 90%;
    }

    .stats-grid {
        gap: 15px;
    }

    .exam-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .profile-meta {
        flex-direction: column;
        gap: 10px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .followers-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .exam-body {
        flex-direction: column;
    }
}
