/* ==========================================================================
   Profile Page Styles - Modernized with Web Awesome Components
   ========================================================================== */

/* ==========================================================================
   Main Grid Layout (2-column, no ads)
   ========================================================================== */

#profile_main_grid {
    display: grid;
    grid-template-areas: "main";
    grid-template-columns: minmax(0, 900px);
    gap: 16px;
    padding: 20px;
    background: #000;
    min-height: calc(100vh - 80px);
    max-width: 950px;
    margin: 0 auto;
    justify-content: center;
}

/* Tablet/Mobile: Adjust padding */
@media (max-width: 900px) {
    #profile_main_grid {
        grid-template-areas: "main";
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 15px;
    }
}

/* ==========================================================================
   Sidebar (Hidden in single-column layout)
   ========================================================================== */

.profile-sidebar {
    display: none;
}

/* ==========================================================================
   Profile Sidebar Card (shared with link.php)
   ========================================================================== */

.profile-sidebar-card {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
}

.profile-sidebar-card::part(base) {
    background: #1a1a1a;
    border-color: #333;
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    background: linear-gradient(180deg, #252525 0%, #1a1a1a 100%);
}

.profile-avatar-container {
    cursor: pointer;
    margin-bottom: 12px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid #00fff6;
    object-fit: cover;
}

.profile-avatar-container:hover .profile-avatar {
    box-shadow: 0 0 20px rgba(0, 255, 246, 0.5);
}

.profile-name {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px;
    text-align: center;
}

/* Edit icon button (pencil icons) */
.edit-icon-btn {
    background: transparent;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: #666;
    font-size: 0.8rem;
    vertical-align: middle;
    margin-left: 4px;
    transition: color 0.2s;
}

.edit-icon-btn:hover {
    color: #00fff6;
}

.profile-headline {
    color: #888;
    font-size: 14px;
    text-align: center;
    margin: 0;
}

.profile-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #00fff6;
}

.stat-label {
    font-size: 12px;
    color: #888;
}

.profile-follow-btn {
    padding: 12px 16px;
    border-bottom: 1px solid #333;
}

.profile-follow-btn wa-button {
    width: 100%;
}

.profile-bio {
    padding: 16px;
}

.profile-bio h4 {
    color: #fff;
    font-size: 14px;
    margin: 0 0 8px;
}

.profile-bio p {
    color: #aaa;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.profile-bio-more {
    color: #00fff6;
    font-size: 13px;
    cursor: pointer;
    margin-top: 8px;
    display: inline-block;
}

.profile-bio-more:hover {
    text-decoration: underline;
}

/* Utility class for muted text */
.text-muted {
    color: #888;
}

/* ==========================================================================
   Main Column
   ========================================================================== */

#profile-main-column {
    grid-area: main;
}

/* ==========================================================================
   Profile Header Card (Top of page)
   ========================================================================== */

.profile-header-card {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 20px;
}

.profile-header-card::part(base) {
    background: #1a1a1a;
    border-color: #333;
}

.profile-header-content {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    min-width: 120px;
    border-radius: 50%;
    border: 3px solid #00fff6;
    background-size: cover;
    background-position: center;
    background-color: #2a2a2a;
}

.profile-header-info {
    flex: 1;
}

.profile-name-large {
    color: #fff;
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 8px;
}

.profile-headline-large {
    color: #00fff6;
    font-size: 1rem;
    margin: 0 0 12px;
}

.profile-bio-preview {
    color: #aaa;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

@media (max-width: 600px) {
    .profile-header-card {
        padding: 20px;
    }

    .profile-header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-avatar-large {
        width: 100px;
        height: 100px;
        min-width: 100px;
    }

    .profile-name-large {
        font-size: 1.5rem;
    }
}

/* ==========================================================================
   Settings Card
   ========================================================================== */

.profile-settings-card {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 24px;
}

.profile-settings-card::part(base) {
    background: #1a1a1a;
    border-color: #333;
}

.profile-settings-card h2 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #333;
}

/* ==========================================================================
   Settings Sections
   ========================================================================== */

.settings-section {
    padding: 20px 0;
    border-bottom: 1px solid #333;
}

.settings-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.settings-section h3 {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 8px;
}

.section-hint {
    color: #888;
    font-size: 0.875rem;
    margin: 0 0 16px;
    line-height: 1.4;
}

/* ==========================================================================
   Form Elements
   ========================================================================== */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    color: #aaa;
    font-size: 0.875rem;
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    padding: 12px;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00fff6;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #666;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* ==========================================================================
   Profile Picture
   ========================================================================== */

.profile-pic-preview {
    margin-bottom: 16px;
}

.profile-picture-btn {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 3px solid #00fff6;
    background-size: cover;
    background-position: center;
    background-color: #2a2a2a;
    cursor: pointer;
    transition: box-shadow 0.2s;
    padding: 0;
}

.profile-picture-btn:hover {
    box-shadow: 0 0 20px rgba(0, 255, 246, 0.5);
}

/* ==========================================================================
   Banner Image Preview
   ========================================================================== */

.banner-preview {
    width: 100%;
    height: 120px;
    border-radius: 8px;
    margin-bottom: 16px;
    background-size: cover;
    background-position: center;
    border: 2px solid #333;
}

.banner-crop-dialog {
    --width: min(95vw, 580px);
}

#profileBannerCropModal::part(dialog) {
    background: #1a1a1a;
    border: 1px solid #333;
}

#profileBannerCropModal::part(header) {
    background: #1a1a1a;
}

#profileBannerCropModal::part(title) {
    color: #fff;
}

#profileBannerCropModal::part(close-button) {
    color: #aaa;
}

#profileBannerCropModal::part(body) {
    background: #1a1a1a;
    overflow: auto;
    padding: 16px;
    max-height: calc(100vh - 180px);
}

#profileBannerCropModal::part(footer) {
    background: #1a1a1a;
    border-top: 1px solid #333;
}

#profileBannerCropArea {
    max-height: calc(100vh - 280px);
    overflow: hidden;
}

#profileBannerCropArea .cr-boundary {
    background: #222;
}

#profileBannerCropArea .cr-slider-wrap {
    margin: 12px 0 0;
}

/* ==========================================================================
   File Upload
   ========================================================================== */

.upload-file-input {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}

.upload-file-input input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Upload Progress */
#prfl_upload_progress {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #888;
    margin-bottom: 16px;
}

/* ==========================================================================
   Message Callout
   ========================================================================== */

.profile-settings-card wa-callout {
    margin-bottom: 20px;
}

.profile-settings-card wa-callout::part(base) {
    background: #fff;
    border: 1px solid #00fff6;
    border-left-width: 4px;
    color: #000;
}

.profile-settings-card wa-callout::part(message) {
    color: #333;
}

.profile-settings-card wa-callout a {
    color: #0c6af5;
    text-decoration: none;
}

.profile-settings-card wa-callout a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.settings-section wa-button {
    margin-top: 8px;
}

/* Disabled button state indicator */
.settings-section wa-button[disabled] {
    opacity: 0.5;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 600px) {
    .profile-settings-card {
        padding: 16px;
    }

    .profile-settings-card h2 {
        font-size: 1.25rem;
    }

    .settings-section {
        padding: 16px 0;
    }

    .profile-picture-btn {
        width: 100px;
        height: 100px;
    }
}
