/* css/profile.css - Styles for the Advanced Profile Page */

:root {
    --profile-theme-accent: var(--primary-color); 
    --profile-theme-accent-rgb: 0, 122, 255;
    --profile-theme-hero-bg-start: var(--secondary-color);
    --profile-theme-hero-bg-end: var(--primary-color);
}

/* Theme variations - applied to #profile-app-container */
#profile-app-container.theme-he { 
    --profile-theme-accent: #0a84ff; 
    --profile-theme-accent-rgb: 10, 132, 255;
    --profile-theme-hero-bg-start: #5ac8fa; 
    --profile-theme-hero-bg-end: #007aff;   
}
#profile-app-container.theme-she { 
    --profile-theme-accent: #ff2d55; 
    --profile-theme-accent-rgb: 255, 45, 85;
    --profile-theme-hero-bg-start: #ff8fab; 
    --profile-theme-hero-bg-end: #ff2d55;   
}
#profile-app-container.theme-they,
#profile-app-container.theme-neutral, 
#profile-app-container:not([class*="theme-"]) 
{
    --profile-theme-accent: #5856d6; 
    --profile-theme-accent-rgb: 88, 86, 214;
    --profile-theme-hero-bg-start: #a2a1f7; 
    --profile-theme-hero-bg-end: #5856d6;   
}


.profile-page-main {
    background-color: #f4f4f8; 
    padding-bottom: 1rem; 
}

.profile-hero {
    background: linear-gradient(135deg, var(--profile-theme-hero-bg-start) 0%, var(--profile-theme-hero-bg-end) 100%);
    color: #fff;
    text-align: center;
    padding: 3rem 1rem 2.5rem 1rem; 
    transition: background 0.5s ease-in-out;
    position: relative;
}
.profile-greeting-editable {
    display: flex;
    align-items: baseline; 
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.1rem; 
}
.profile-hero .profile-page-title { 
    color: #fff;
    font-size: 2.2rem; 
    font-weight: 700;
    margin: 0; 
    display: inline-block; 
}
.edit-icon-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 0.5rem; 
    opacity: 0.7;
    transition: opacity 0.2s ease, color 0.2s ease;
    line-height: 1; 
}
.edit-icon-btn:hover {
    opacity: 1;
    color: #fff;
}
.edit-icon-btn svg {
    width: 18px; 
    height: 18px;
    vertical-align: middle;
}
.profile-main-name-input {
    display: none; 
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    background-color: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    text-align: center;
    width: auto; 
    max-width: 80%;
    margin: 0 auto 0.1rem auto; 
    outline: none;
}
.profile-main-name-input:focus {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.3);
}
.profile-job-title-display {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    min-height: 1.2em; 
}
.profile-hero .profile-page-subtitle { 
    font-size: 0.9rem; 
    opacity: 0.9;
    margin-top: 0.25rem;
}

.profile-quick-links-section { 
    padding: 2.5rem 0;
}
.profile-section-title { 
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2rem; 
    text-align: center;
    position: relative;
    padding-bottom: 0.75rem; 
}
.profile-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70px; 
    height: 3px;
    background-color: var(--profile-theme-accent); 
    border-radius: 2px;
    transition: background-color 0.5s ease-in-out;
}

/* Edit Profile Action Bar */
.profile-edit-action-bar {
    padding: 1.5rem 1rem; 
    text-align: center; 
    background-color: transparent; 
    margin-top: 1rem; 
    margin-bottom: 1rem; 
}
.btn.btn-primary-profile { 
    background-color: var(--profile-theme-accent);
    border-color: var(--profile-theme-accent);
    color: white;
    display: inline-flex; 
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
    min-width: 200px; 
    justify-content: center; 
}
.btn.btn-primary-profile:hover {
    background-color: color-mix(in srgb, var(--profile-theme-accent) 85%, black);
    border-color: color-mix(in srgb, var(--profile-theme-accent) 85%, black);
}
.btn.btn-primary-profile svg {
    width: 18px;
    height: 18px;
}

/* Profile Edit Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex; 
    align-items: center;
    justify-content: center;
    z-index: 2000; 
    opacity: 0;
    visibility: hidden; 
    transition: opacity 0.3s ease, visibility 0s linear 0.3s; 
}
.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.profile-edit-modal-content {
    background-color: var(--bg-card);
    border-radius: var(--card-radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(10px); 
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease; 
    opacity: 0; 
}
.modal-overlay.visible .profile-edit-modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.profile-edit-modal-content .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--separator-color);
}
.profile-edit-modal-content .modal-header .modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}
.profile-edit-modal-content .modal-close-btn {
    font-size: 1.8rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}
.profile-edit-modal-content .modal-close-btn:hover {
    color: var(--text-primary);
}

.profile-edit-modal-content .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}
.profile-edit-modal-content .profile-form { 
    max-width: 100%;
    padding: 0;
    box-shadow: none;
    background-color: transparent;
}
.profile-edit-modal-content .form-group { margin-bottom: 1.25rem; }
.profile-edit-modal-content .form-group label { font-size: 0.85rem; margin-bottom: 0.4rem; }
.profile-edit-modal-content .form-group input, 
.profile-edit-modal-content .form-group textarea,
.profile-edit-modal-content .form-group select {
    padding: 0.75rem 1rem; font-size: 0.95rem;
}
.profile-edit-modal-content .form-actions { margin-top: 1.5rem; }
.profile-edit-modal-content .profile-save-btn,
.profile-edit-modal-content .profile-clear-btn {
    font-size: 0.9rem; padding: 0.7rem 1.2rem;
}
.profile-edit-modal-content .profile-save-btn { 
    background-color: var(--profile-theme-accent);
    border-color: var(--profile-theme-accent);
}
.profile-edit-modal-content .profile-save-btn:hover {
    background-color: color-mix(in srgb, var(--profile-theme-accent) 85%, black);
    border-color: color-mix(in srgb, var(--profile-theme-accent) 85%, black);
}

.profile-save-status { 
    text-align: center;
    margin-top: 1rem;
    font-weight: 500;
    min-height: 1.5em; 
    transition: opacity 0.3s ease;
}
.profile-save-status.success { color: var(--accent-color-bright); }
.profile-save-status.error { color: #e74c3c; }


/* Profile Quick Links/Downloads Section */
.profile-quick-links-section {
    background-color: #f0f2f5; 
    border-top: 1px solid var(--separator-color);
}
.profile-quick-links-grid { 
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.profile-quick-link-item { 
    background-color: var(--bg-card);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    box-shadow: 0 6px 18px rgba(0,0,0,0.07);
    display: flex;
    align-items: flex-start; 
    gap: 1rem;
    text-align: left; 
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none; 
    color: var(--text-primary);
}
.profile-quick-link-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.profile-quick-link-item .item-icon { 
    width: 40px; 
    height: 40px;
    flex-shrink: 0; 
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-quick-link-item .item-icon img,
.profile-quick-link-item .item-icon svg {
    width: 28px;
    height: 28px;
    opacity: 0.8;
    fill: var(--profile-theme-accent); 
    transition: fill 0.3s ease;
}
.profile-quick-link-item:hover .item-icon img,
.profile-quick-link-item:hover .item-icon svg {
    opacity: 1;
}

.profile-quick-link-item .item-info {
    flex-grow: 1;
}
.profile-quick-link-item h4 {
    font-size: 1.05rem; 
    font-weight: 600;
    margin-bottom: 0.35rem; 
    color: var(--text-primary);
}
.profile-quick-link-item p.item-description { 
    font-size: 0.85rem; 
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}
.profile-quick-link-item .btn { 
    margin-top: 0.5rem; 
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    align-self: flex-start; 
}

@media (max-width: 767px) {
    .profile-hero { padding: 2rem 1rem; }
    .profile-hero .profile-page-title { font-size: 1.8rem; }
    .profile-main-name-input { font-size: 1.8rem; }
    .profile-job-title-display { font-size: 0.9rem; }
    .profile-hero .profile-page-subtitle { font-size: 0.9rem; }

    .profile-section-title { font-size: 1.5rem; }
    
    .profile-edit-action-bar .btn.btn-primary-profile {
        width: 100%; 
        max-width: 320px; 
        margin-left: auto;
        margin-right: auto;
    }

    .profile-edit-modal-content .modal-body { padding: 1.25rem; }
    .profile-edit-modal-content .form-group { margin-bottom: 1rem; }

    .profile-quick-links-grid {
        grid-template-columns: 1fr; 
    }
    .profile-quick-link-item .btn {
        width: auto; 
    }
}