/* Harmonisation des couleurs avec character_styles.css */
.profile-character-main-banner { cursor: pointer; }
    .profile-character-main-avatar { cursor: pointer; }
    .profile-character-main-banner input[type="file"],
    .profile-character-main-avatar input[type="file"] {
        display: none;
    }
    .profile-tabs {
        display: flex;
        border-bottom: 2px solid #e3e3e3;
        margin-bottom: 1.5em;
        background: #fff;
        border-radius: 8px 8px 0 0;
        overflow-x: auto;
    }
    .profile-tab {
        flex: 1 1 0;
        text-align: center;
        padding: 0.7em 0.5em;
        cursor: pointer;
        font-weight: 600;
        color: #1976d2;
        border-bottom: 2px solid transparent;
        transition: background 0.15s, border-bottom 0.15s;
        background: #f7fafd;
    }
    .profile-tab.active {
        border-bottom: 2.5px solid #1976d2;
        background: #e3f2fd;
        color: #22334a;
    }
    .profile-tab-content {
        display: none;
    }
    .profile-tab-content.active {
        display: block;
    }
    .profile-copaings-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    .profile-copaing-item {
        display: flex;
        align-items: center;
        padding: 0.5em 0;
    }
    .profile-copaing-link {
        display: flex;
        align-items: center;
        text-decoration: none;
        color: #22334a;
        transition: color 0.15s;
    }
    .profile-copaing-link:hover {
        color: #1976d2;
    }
    .profile-copaing-avatar {
        width: 40px;
        height: 40px;
        object-fit: cover;
        border-radius: 50%;
        margin-right: 0.5em;
    }
    .profile-copaing-initial {
        width: 40px;
        height: 40px;
        background: #8c7ae6;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        margin-right: 0.5em;
        font-weight: bold;
        font-size: 1.2em;
    }

/* Background effects */
#background-glow, #particles-container, #mystic-veil {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100vh;
    pointer-events: none;
    z-index: 0;
}
#background-glow {
    background: radial-gradient(circle at 60% 40%, #7fd8ff33 0%, #0a223a00 80%);
    animation: pulseGlow 10s infinite alternate;
}
@keyframes pulseGlow {
    from { opacity: 0.2; }
    to { opacity: 0.4; }
}
#mystic-veil {
    background: radial-gradient(ellipse at 60% 40%, rgba(110,226,245,0.13) 0%, rgba(40,60,110,0.22) 60%, rgba(10,10,30,0.55) 100%);
    mix-blend-mode: lighten;
    opacity: 0.85;
}

/* Main container */
.profile-container {
    position: relative;
    z-index: 10;
    background: rgba(10, 20, 45, 0.88);
    border-radius: 24px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(127, 216, 255, 0.2) inset;
    max-width: 900px;
    margin: 60px auto 40px auto;
    padding: 40px 40px 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 2.5em;
}

/* Title */
.profile-title {
    color: #b2eaff;
    text-shadow: 0 0 8px #7fd8ff, 0 0 5px #0a223a;
    text-align: left;
    font-size: 2.5rem;
    margin-bottom: 0.5em;
    letter-spacing: 1px;
    font-weight: 700;
}

/* Profile info card */
.profile-info-card {
    display: flex;
    align-items: flex-start;
    gap: 2.5em;
    background: linear-gradient(120deg, #16243a 70%, #22334a 100%);
    border-radius: 18px;
    box-shadow: 0 2px 16px #7fd8ff22;
    padding: 2em 2.5em;
    margin-bottom: 0;
}

.profile-info-card > div:first-child {
    flex-shrink: 0;
}

.profile-info-card img,
.profile-info-card .profile-initial {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    background: #0a223a;
    color: #b2eaff;
    border: 3px solid #7fd8ff;
    box-shadow: 0 0 18px #7fd8ff44;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8em;
    font-weight: bold;
}

.profile-info-card .profile-details {
    display: flex;
    flex-direction: column;
    gap: 0.7em;
    font-size: 1.18em;
}

.profile-info-card .profile-details strong {
    color: #7fd8ff;
}

.profile-info-card .profile-details span[style*="background:"] {
    margin-right: 0.5em;
    vertical-align: middle;
}

/* Settings button */
#toggle-settings-btn {
    float: right;
    margin-top: -2.5em;
    margin-bottom: 1.5em;
    background: #22334a;
    color: #7fd8ff;
    border: 2px solid #7fd8ff;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.1em;
    transition: background 0.2s, color 0.2s;
}
#toggle-settings-btn:hover {
    background: #7fd8ff;
    color: #22334a;
}

/* Settings panel */
#profile-settings-panel {
    background: #16243a;
    border-radius: 16px;
    box-shadow: 0 2px 12px #7fd8ff22;
    padding: 2em 2em 1em 2em;
    margin-bottom: 2em;
    display: flex;
    flex-wrap: wrap;
    gap: 2em;
}

.profile-form-group {
    flex: 1 1 260px;
    min-width: 220px;
    margin-bottom: 0.5em;
}
.profile-form-group label {
    color: #b2eaff;
    font-weight: 600;
    margin-bottom: 0.3em;
    display: block;
}
.profile-form-group input,
.profile-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: #101c2b;
    color: #b2eaff;
    border: 1.5px solid #7fd8ff88;
    border-radius: 6px;
    box-shadow: 0 0 6px #7fd8ff22;
    font-family: 'EB Garamond', serif;
    font-size: 1em;
    margin-top: 4px;
}
.profile-form-group input:focus,
.profile-form-group textarea:focus {
    border-color: #b2eaff;
    box-shadow: 0 0 12px #b2eaff44;
    outline: none;
}
.profile-edit-btn {
    display: block;
    width: 100%;
    padding: 10px 0;
    background: linear-gradient(90deg, #7fd8ff 0%, #b2eaff 100%);
    color: #0a223a;
    font-size: 1.08em;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    box-shadow: 0 0 10px #7fd8ff22;
    margin-top: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.profile-edit-btn:hover {
    background: #7fd8ff;
    color: #0a223a;
}

/* Profile sections (posts, scenarios, characters, likes) */
.profile-section {
    background: #16243a;
    color: #fffbe7;
    border-radius: 14px;
    box-shadow: 0 2px 10px #7fd8ff11;
    padding: 1.5em 2em 1.2em 2em;
    margin-bottom: 1.5em;
}

.profile-section h3 {
    color: #b2eaff;
    margin-top: 0;
    margin-bottom: 1em;
    font-size: 1.25em;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.profile-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.profile-section li {
    margin-bottom: 0.8em;
    display: flex;
    align-items: center;
    gap: 0.7em;
    font-size: 1.08em;
}
.profile-section li img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 6px;
    border: 1.5px solid #7fd8ff44;
    background: #e3f2fd;
}
.profile-section li span,
.profile-section li a {
    color: #b2eaff;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}
.profile-section li a:hover {
    color: #7fd8ff;
    text-decoration: underline;
}
.profile-section li .profile-character-desc {
    color: #7fd8ff;
}

/* Copaings Tab Content */
.profile-copaings-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5em;
}

.profile-copaing-item {
    background: #22334a;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 0 5px rgba(127, 216, 255, 0.1) inset;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.profile-copaing-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4), 0 0 10px rgba(127, 216, 255, 0.2) inset;
}

.profile-copaing-link {
    display: flex;
    align-items: center;
    padding: 1em;
    text-decoration: none;
    color: #b2eaff;
}

.profile-copaing-avatar,
.profile-copaing-initial {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 1em;
    object-fit: cover;
    border: 2px solid #7fd8ff;
    background-color: #0a223a;
}
.profile-copaing-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    color: #b2eaff;
}

.profile-copaing-username {
    font-weight: 600;
    font-size: 1.05em;
    word-break: break-word;
}

.profile-copaing-link:hover .profile-copaing-username {
    color: #7fd8ff;
}

/* General styles for items in copaing lists (both current and requests) */
.profile-copaings-list .profile-copaing-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8em 0.5em; /* Consistent padding */
    border-bottom: 1px solid #e0e0e03a; /* Light separator for dark theme */
    color: #e0e0e0; /* Text color for items if not in a link */
}
.profile-copaings-list .profile-copaing-item:last-child {
    border-bottom: none;
}

/* The link part containing avatar and username */
.profile-copaings-list .profile-copaing-item .profile-copaing-link {
    flex-grow: 1; /* Allows the info part to take up available space */
    margin-right: 10px; /* Space before action buttons */
    color: #c5dcff; /* Link color */
}
.profile-copaings-list .profile-copaing-item .profile-copaing-link:hover {
    color: #ffffff;
}


/* Forms/buttons for actions (Accept, Decline, Remove) */
.copaing-action-form, 
.profile-copaing-actions form {
    display: inline-block;
    margin-left: 5px; /* Spacing between multiple action buttons */
    flex-shrink: 0; /* Prevent buttons from shrinking */
}
.profile-copaing-actions { /* Container for accept/decline buttons if grouped */
    flex-shrink: 0;
}

.profile-copaing-actions .btn,
.copaing-action-form .btn {
    min-width: 80px;
    padding: 0.25rem 0.5rem; /* Smaller buttons */
    font-size: 0.8rem;
}


/* Styles for request list items (can inherit or override) */
/* .profile-requests-list .profile-copaing-item is covered by the general .profile-copaings-list .profile-copaing-item */

.profile-requests-list .profile-copaing-info { /* If you have a specific div for info in requests */
    flex-grow: 1;
}


/* Profile banner */
.profile-banner {
    width: 100%;
    max-width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
    border-radius: 0 0 32px 32px;
    box-shadow: 0 8px 32px #7fd8ff33, 0 1.5px 8px #0a223a22;
    margin-bottom: -60px;
    z-index: 5;
    position: relative;
}

/* Fiche personnage sur la bannière */
.profile-character-card {
    position: absolute;
    left: 50%;
    top: 160px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    background: #22334a;
    color: #b2eaff;
    border-radius: 18px;
    box-shadow: 0 4px 24px #7fd8ff33, 0 1.5px 8px #0a223a22;
    padding: 1.5em 2.5em;
    z-index: 20;
    min-width: 320px;
    max-width: 90vw;
    gap: 2em;
}

.profile-character-avatar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-character-avatar img,
.profile-character-avatar .profile-initial {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    background: #0a223a;
    color: #b2eaff;
    border: 3px solid #7fd8ff;
    box-shadow: 0 0 18px #7fd8ff44;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8em;
    font-weight: bold;
}

.profile-character-details {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    justify-content: center;
    align-items: flex-start;
    color: #b2eaff;
}
.profile-character-username {
    font-size: 1.5em;
    font-weight: bold;
    color: #7fd8ff;
}
.profile-character-email {
    color: #b2eaff;
    font-size: 1.1em;
}
.profile-character-color {
    color: #b2eaff;
    margin-top: 0.2em;
    font-size: 1em;
}
.profile-character-limits {
    margin-top: 0.3em;
    color: #7fd8ff;
    font-size: 1em;
    max-width: 350px;
    word-break: break-word;
}

/* Fiche personnage principale */
.profile-character-main-card {
    max-width: 480px;
    margin: 60px auto 40px auto;
    background: #22334a;
    color: #b2eaff;
    border-radius: 24px;
    box-shadow: 0 8px 32px #7fd8ff33, 0 1.5px 8px #0a223a22;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 10;
    padding-bottom: 2em;
}

.profile-character-main-banner {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    border-radius: 24px 24px 0 0;
    position: relative;
    background-color: #16243a;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.profile-character-main-avatar {
    position: absolute;
    left: 50%;
    bottom: -55px;
    transform: translateX(-50%);
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: #0a223a;
    color: #b2eaff;
    border: 3px solid #7fd8ff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-character-main-avatar img,
.profile-character-main-avatar .profile-initial {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #0a223a;
    color: #b2eaff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-character-main-details {
    margin-top: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7em;
    width: 100%;
    padding: 0 2em;
    color: #b2eaff;
}
.profile-character-main-username {
    font-size: 1.7em;
    font-weight: bold;
    color: #7fd8ff;
    margin-top: 0.5em;
}
.profile-character-main-email {
    color: #b2eaff;
    font-size: 1.1em;
}
.profile-character-main-color {
    color: #b2eaff;
    margin-top: 0.2em;
    font-size: 1em;
}
.profile-character-main-limits {
    color: #7fd8ff;
    margin-top: 0.3em;
    font-size: 1em;
    max-width: 350px;
    word-break: break-word;
    text-align: center;
}

/* Footer */
footer.bg-dark {
    background: linear-gradient(90deg, #101c2b 0%, #22334a 100%);
    color: #b2eaff;
    text-shadow: 0 0 8px #7fd8ff44;
}

/* Responsive */
@media (max-width: 1100px) {
    .profile-container {
        max-width: 98vw;
        padding: 18px 4vw 18px 4vw;
    }
    .profile-info-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.2em;
        padding: 1.2em 1em;
    }
    #profile-settings-panel {
        flex-direction: column;
        gap: 1em;
        padding: 1.2em 1em 1em 1em;
    }
    .profile-section {
        padding: 1.2em 1em 1em 1em;
    }
    .profile-copaings-list { /* Adjust grid for medium screens */
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1em;
    }
}

@media (max-width: 700px) {
    .profile-character-card {
        flex-direction: column;
        align-items: center;
        padding: 1em 0.5em;
        top: 120px;
        min-width: 0;
        width: 96vw;
        gap: 1em;
    }
    .profile-character-details {
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .profile-container {
        margin: 10px 2px 10px 2px;
        padding: 10px 2px 10px 2px;
    }
    .profile-title {
        font-size: 1.3rem;
    }
    .profile-info-card img,
    .profile_info_card .profile-initial {
        width: 60px;
        height: 60px;
        font-size: 1.5em;
    }
    .profile-info-card .profile-details {
        font-size: 1em;
    }
    #toggle-settings-btn {
        font-size: 1em;
        margin-top: -1.5em;
    }
    .profile-character-main-card {
        max-width: 98%;
        margin: 20px auto 10px auto;
        padding-bottom: 1em;
    }
    .profile-character-main-banner {
        height: 120px;
    }
    .profile-character-main-avatar {
        width: 70px;
        height: 70px;
        bottom: -35px;
    }
    .profile-character-main-details {
        margin-top: 45px;
        padding: 0 0.5em;
    }
    .profile-character-main-username {
        font-size: 1.2em;
    }
    .profile-copaings-list { /* Single column on small screens */
        grid-template-columns: 1fr;
        gap: 1em;
    }
    .profile-copaing-avatar,
    .profile-copaing-initial {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
    }
    .profile-copaing-username {
        font-size: 1em;
    }
}
