/* Profile Page Styles - Duolingo-Inspired Layout */

:root {
    --profile-primary: #004080;
    --profile-accent: #0066cc;
    --profile-bg: #f5faff;
    --profile-card-bg: #ffffff;
    --profile-border: #d0e2f3;
    --profile-shadow: rgba(0, 51, 102, 0.1);
    --profile-text: #003366;
    --profile-text-light: #666;
    --sidebar-width: 250px;
}

/* Main Layout */
.profile-layout {
    display: flex;
    min-height: calc(100vh - 60px);
    background: var(--profile-bg);
}

/* Mobile Sidebar Toggle */
.mobile-sidebar-toggle {
    display: none;
    position: fixed;
    top: 80px;
    left: 1rem;
    z-index: 1001;
    background: var(--profile-accent);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
    transition: all 0.3s;
}

.mobile-sidebar-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 102, 204, 0.4);
}

/* Left Sidebar */
.profile-sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--profile-border);
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--profile-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    margin: 0;
    color: var(--profile-primary);
    font-size: 1.25rem;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--profile-text-light);
    padding: 0.25rem;
    line-height: 1;
}

.sidebar-close:hover {
    color: var(--profile-primary);
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    color: var(--profile-text);
}

.nav-item:hover {
    background: var(--profile-bg);
    border-left-color: var(--profile-accent);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(0, 102, 204, 0.1), transparent);
    border-left-color: var(--profile-accent);
    color: var(--profile-accent);
    font-weight: 600;
}

.nav-icon {
    font-size: 1.5rem;
    width: 30px;
    text-align: center;
}

.nav-label {
    font-size: 1rem;
}

/* Main Content Area */
.profile-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Profile Header */
.profile-header {
    background: linear-gradient(135deg, var(--profile-primary) 0%, var(--profile-accent) 100%);
    padding: 3rem 2rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    object-fit: cover;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--profile-primary);
}

.profile-header-info {
    flex: 1;
    min-width: 250px;
}

.profile-header-info h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2.25rem;
    color: white;
}

.profile-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 1rem;
}

.profile-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: bold;
    display: block;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Tab Panels */
.tab-panel {
    display: none;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel-title {
    color: var(--profile-primary);
    font-size: 1.75rem;
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--profile-border);
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Profile Sections */
.profile-section {
    background: var(--profile-card-bg);
    border-radius: 12px;
    padding: 1.75rem;
    box-shadow: 0 4px 12px var(--profile-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px var(--profile-shadow);
}

.profile-section.full-width {
    grid-column: 1 / -1;
}


.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--profile-border);
}

.section-icon {
    font-size: 1.5rem;
}

.section-header h3 {
    margin: 0;
    color: var(--profile-primary);
    font-size: 1.25rem;
}

/* Info Items */
.info-grid {
    display: grid;
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-weight: 600;
    color: var(--profile-text);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    color: var(--profile-text-light);
    font-size: 1rem;
    padding: 0.5rem;
    background: var(--profile-bg);
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid transparent;
    font-family: inherit;
}

input.info-value,
textarea.info-value {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: block;
}

textarea.info-value {
    resize: none;
    min-height: 2.5rem;
}

/* Disabled State: Look like plain text */
.info-value:disabled {
    background-color: var(--profile-bg);
    border-color: transparent;
    cursor: default;
    color: var(--profile-text-light);
    opacity: 1;
}

/* Enabled State: Look like input (edit mode) */
.info-value:not(:disabled) {
    background-color: white;
    border-color: var(--profile-accent);
    cursor: text;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.15);
    outline: none;
    transition: all 0.2s;
}

.info-value:not(:disabled):focus {
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.25);
    border-color: var(--profile-primary);
}

/* Read-only fields (like university email) */
.info-value[readonly] {
    background-color: #f0f0f0;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Skills & Tags */
.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-tag {
    background: linear-gradient(135deg, var(--profile-accent), var(--profile-primary));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: transform 0.2s;
}

.skill-tag:hover {
    transform: scale(1.05);
}

/* Achievements List */
.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.achievement-item {
    padding: 1rem;
    background: var(--profile-bg);
    border-radius: 8px;
    border-left: 4px solid var(--profile-accent);
    transition: transform 0.2s;
}

.achievement-item:hover {
    transform: translateX(5px);
}

.achievement-title {
    font-weight: 600;
    color: var(--profile-primary);
    margin-bottom: 0.25rem;
}

.achievement-details {
    color: var(--profile-text-light);
    font-size: 0.9rem;
}

/* Social Links Editor */
.social-links-editor {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.social-link-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--profile-bg);
    border-radius: 10px;
    transition: all 0.2s;
}

.social-link-item .social-icon {
    font-size: 1.5rem;
    min-width: 40px;
    text-align: center;
}

.social-input-wrapper {
    flex: 1;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.social-input-wrapper .info-value {
    flex: 1;
}

.social-visit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--profile-accent);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.2s;
    opacity: 0.7;
}

.social-visit-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.social-visit-btn[href="#"],
.social-visit-btn[href=""] {
    opacity: 0.3;
    pointer-events: none;
}


.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--profile-text);
}

.progress-bar {
    width: 100%;
    height: 8px;
}

@media (max-width: 768px) {
    .mobile-sidebar-toggle {
        display: block;
    }

    .profile-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1002;
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .profile-sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .profile-header {
        padding: 2rem 1.5rem;
        flex-direction: column;
        text-align: center;
    }

    .profile-header-info h1 {
        font-size: 1.75rem;
    }

    .profile-stats {
        justify-content: center;
    }

    .tab-panel {
        padding: 1.5rem 1rem;
    }

    .panel-title {
        font-size: 1.5rem;
    }

    .profile-section {
        padding: 1.25rem;
    }

    .social-links {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .profile-avatar {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }

    .profile-header-info h1 {
        font-size: 1.5rem;
    }

    .profile-subtitle {
        font-size: 0.95rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .panel-title {
        font-size: 1.25rem;
    }

    .section-header h3 {
        font-size: 1.1rem;
    }

    .nav-label {
        font-size: 0.95rem;
    }
}

/* Sidebar Overlay for Mobile */
@media (max-width: 768px) {
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1001;
    }

    .sidebar-overlay.active {
        display: block;
    }
}



/* Profile Completion Modal */
.profile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 51, 102, 0.6);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.profile-modal-overlay.hidden {
    display: none;
}

.profile-modal {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--profile-primary), var(--profile-accent));
    padding: 1.5rem 2rem;
    color: white;
}

.modal-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
}

.modal-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.modal-form {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--profile-text);
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 1px solid var(--profile-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--profile-accent);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.save-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--profile-accent), var(--profile-primary));
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 1rem;
    transition: transform 0.2s;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 1.25rem;
    }
}

/* Global Edit Profile Button in Header */
.edit-profile-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    /* Push to right */
    backdrop-filter: blur(5px);
}

.edit-profile-btn:hover {
    background: white;
    color: var(--profile-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.edit-profile-btn.saving {
    background: linear-gradient(135deg, #28a745, #20c997);
    border-color: #28a745;
    color: white;
}

@media (max-width: 768px) {
    .edit-profile-btn {
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
        margin-left: 0;
    }
}