/* ---- Admin slide-out side panel ---- */
#admin_side_panel {
    position: fixed;
    left: 0;
    top: 50%;
    z-index: 120;
    display: flex;
    align-items: flex-start;
    transform: translate(0, -50%);
    transition: transform 0.25s ease;
    font-family: Calibri, Candara, Segoe, "Segoe UI", Arial, sans-serif;
}
/* Collapsed: slide the menu (210px) off the left edge, leaving only the toggle tab */
#admin_side_panel.collapsed {
    transform: translate(-210px, -50%);
}

#admin_picture_menu {
    order: 1;
    width: 210px;
    padding: 0;
    margin: 0;
    background: #602121;
    border-radius: 0 0 6px 0;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.25);
    list-style: none;
    overflow: hidden;
}
#admin_picture_menu li { list-style: none; }
#admin_picture_menu li.title {
    background: #4a1616;
    color: #dfc4c4;
    padding: 8px 14px;
    font-weight: bold;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #7a3333;
}
#admin_picture_menu a {
    display: block;
    padding: 8px 16px;
    color: #f2d6d6;
    text-decoration: none;
    font-size: 12px;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
#admin_picture_menu a:hover {
    background: #7a2e2e;
    color: #fff;
    text-decoration: none;
}

/* Toggle tab that stays visible when collapsed */
#admin_side_toggle {
    order: 2;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 34px;
    padding: 12px 0;
    border: none;
    cursor: pointer;
    background: #4a1616;
    color: #f2d6d6;
    border-radius: 0 6px 6px 0;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.25);
    font-family: inherit;
    transition: background 0.15s;
}
#admin_side_toggle:hover { background: #7a2e2e; color: #fff; }
#admin_side_toggle .admin-side-chevron { font-size: 16px; line-height: 1; }
#admin_side_toggle .admin-side-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---- Child pictures gallery (fluid, wraps instead of stacking) ---- */
.child-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
    margin: 8px 0 6px;
}
.child-gallery #child_bigpic {
    flex: 1 1 100%;
    margin: 0 0 4px;
}
.child-gallery #child_bigpic img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #ddd;
}
.child-gallery .child_280x {
    flex: 0 1 auto;
    margin: 0;
}
.child-gallery .child_280x img {
    display: block;
    width: 280px;
    max-width: 100%;
    height: auto;
    border: 1px solid #ccc;
    border-radius: 6px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.child-gallery .child_280x a { display: block; line-height: 0; }
.child-gallery .child_280x a:hover img {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

/* ---- About Me bio section ---- */
.aboutme {
    margin: 24px 0;
}
.aboutme-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.aboutme-head h3 {
    margin: 0;
}
.aboutme-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    font-size: 12px;
    font-family: inherit;
    border: 1px solid #602121;
    border-radius: 4px;
    background: #fff;
    color: #602121;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.aboutme-edit-btn:hover {
    background: #602121;
    color: #fff;
}
.aboutme-edit-btn.secondary {
    border-color: #b5ac9b;
    color: #6b6255;
}
.aboutme-edit-btn.secondary:hover {
    background: #6b6255;
    border-color: #6b6255;
    color: #fff;
}
.aboutme-view {
    font-size: 15px;
    line-height: 1.65;
    color: #333;
}
.aboutme-view p { margin: 0 0 12px; }
.aboutme-view.is-empty:before {
    content: 'No bio yet. Click "Add bio" to write one.';
    color: #9a9186;
    font-style: italic;
}
.aboutme-editor-wrap {
    margin-top: 12px;
}
.aboutme-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.aboutme-actions[hidden] { display: none; }
.aboutme-actions .aboutme-hint {
    font-size: 12px;
    color: #8a8175;
}
.aboutme-textarea {
    width: 100%;
    max-width: 620px;
    height: 300px;
    box-sizing: border-box;
}

/* ---- jHtmlArea editor polish ---- */
.aboutme-editor-wrap .jHtmlArea {
    border: 1px solid #b5ac9b;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    background: #fff;
    max-width: 620px;
}
.aboutme-editor-wrap .jHtmlArea .ToolBar {
    background: #f2ede8;
    border-bottom: 1px solid #d5cec5;
    padding: 5px 6px 3px;
}
/* "¶ Paragraphs" helper button */
.aboutme-editor-wrap .jHtmlArea .ToolBar ul li a.makeparagraphs {
    width: auto;
    height: auto;
    padding: 3px 10px;
    background: #3f5b7a;
    color: #fff;
    font-size: 12px;
    line-height: 16px;
    border-radius: 3px;
    text-decoration: none;
    white-space: nowrap;
}
.aboutme-editor-wrap .jHtmlArea .ToolBar ul li a.makeparagraphs:hover {
    background: #2f4a66;
}

/* Readable maroon "Save" button (jHtmlArea puts the class on the <a>) */
.aboutme-editor-wrap .jHtmlArea .ToolBar ul li a.save {
    width: auto;
    height: auto;
    padding: 3px 12px;
    background: #602121;
    color: #fff;
    font-weight: bold;
    font-size: 12px;
    line-height: 16px;
    border-radius: 3px;
    text-decoration: none;
}
.aboutme-editor-wrap .jHtmlArea .ToolBar ul li a.save:hover {
    background: #7a2e2e;
}
.aboutme-editor-wrap .jHtmlArea iframe {
    background: #fff;
}

/* ---- Admin section container ---- */
.profile-admin-section {
    background: #f7f5f3;
    border: 2px solid #602121;
    border-radius: 8px;
    margin: 30px 0;
    padding: 0;
    overflow: hidden;
}

.profile-admin-header {
    background: #602121;
    color: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.profile-admin-header h2 {
    margin: 0;
    font-size: 18px;
    font-family: Georgia, "Times New Roman", serif;
    color: #fff;
}
.profile-admin-badge {
    background: #be6f6f;
    color: #fff;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-admin-quicklinks {
    background: #5d1b1d;
    padding: 8px 20px;
    display: flex;
    gap: 0;
    flex-wrap: wrap;
    border-bottom: 3px solid #be6f6f;
}
.profile-admin-quicklinks a {
    color: #dfc4c4;
    text-decoration: none;
    font-size: 13px;
    padding: 6px 14px;
    transition: background 0.15s, color 0.15s;
    border-radius: 3px;
}
.profile-admin-quicklinks a:hover {
    background: #602121;
    color: #fff;
}

/* ---- Admin cards ---- */
.profile-admin-cards {
    padding: 20px;
}
.profile-admin-card {
    background: #fff;
    border: 1px solid #d5cec5;
    border-radius: 5px;
    margin-bottom: 20px;
    overflow: hidden;
}
.profile-admin-card-header {
    background: #602121;
    color: #fff;
    padding: 10px 16px;
    font-size: 15px;
    font-weight: bold;
}
.profile-admin-card-body {
    padding: 16px 20px;
}

/* ---- Admin forms ---- */
.profile-admin-form {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eae6e1;
}
.profile-admin-form:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.profile-admin-form-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.profile-admin-form-row label {
    font-weight: bold;
    color: #5d1b1d;
    font-size: 14px;
    min-width: 160px;
}
.profile-admin-form-row input[type="text"],
.profile-admin-form-row input[type="date"] {
    padding: 7px 10px;
    border: 1px solid #b5ac9b;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    min-width: 180px;
}
.profile-admin-form-row input:focus {
    border-color: #be6f6f;
    outline: none;
    box-shadow: 0 0 0 2px rgba(190,111,111,0.25);
}

/* ---- Admin buttons ---- */
.profile-admin-btn {
    display: inline-block;
    padding: 7px 18px;
    font-size: 13px;
    font-family: inherit;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    background: #602121;
    color: #fff;
    white-space: nowrap;
}
.profile-admin-btn:hover { background: #7a2e2e; }
.profile-admin-btn.btn-warning { background: #b57a1a; color: #fff; }
.profile-admin-btn.btn-warning:hover { background: #9a6715; }
.profile-admin-btn.btn-cancel { background: #999; color: #fff; }
.profile-admin-btn.btn-cancel:hover { background: #777; }
.profile-admin-btn.btn-confirm { background: #602121; color: #fff; }
.profile-admin-btn.btn-confirm:hover { background: #7a2e2e; }

/* ---- Admin messages ---- */
.profile-admin-msg {
    padding: 10px 14px;
    margin-top: 10px;
    border-radius: 4px;
    border-left: 4px solid;
    font-size: 13px;
}
.profile-admin-msg.error { background: #fce4ec; border-color: #c62828; color: #c62828; }
.profile-admin-msg.success { background: #e8f5e9; border-color: #2e7d32; color: #2e7d32; }

/* ---- Picture management styling ---- */
.profile-admin-card-body .actionbtns {
    margin: 6px 0 16px 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.profile-admin-card-body .actionbtns input[type="submit"] {
    padding: 5px 12px;
    font-size: 12px;
    font-family: inherit;
    background: #be6f6f;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s;
}
.profile-admin-card-body .actionbtns input[type="submit"]:hover {
    background: #a05a5a;
}
.profile-admin-card-body .actionbtns input[value^="Delete"] {
    background: #9e3030;
}
.profile-admin-card-body .actionbtns input[value^="Delete"]:hover {
    background: #7a2222;
}
.profile-admin-card-body input[type="file"] {
    margin: 8px 0;
}
.profile-admin-card-body input[type="submit"][value="Upload Picture"] {
    padding: 7px 18px;
    font-size: 13px;
    background: #602121;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 4px;
}
.profile-admin-card-body input[type="submit"][value="Upload Picture"]:hover {
    background: #7a2e2e;
}

/* ---- Picture manager (redesigned grid) ---- */
.pic-manager .pic-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 6px;
}
.pic-card {
    width: 150px;
    display: flex;
    flex-direction: column;
    border: 1px solid #d5cec5;
    border-radius: 6px;
    background: #fff;
    padding: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.pic-card.is-highres {
    border-color: #9db7d6;
    background: #f6f9fd;
}
.pic-thumb {
    display: block;
    text-align: center;
    background: #f2ede8;
    border-radius: 4px;
    overflow: hidden;
    min-height: 90px;
    line-height: 0;
}
.pic-thumb img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}
.pic-meta {
    margin: 8px 0;
    min-height: 40px;
}
.pic-size {
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    background: #8a7f72;
    padding: 1px 7px;
    border-radius: 8px;
}
.pic-card.is-highres .pic-size { background: #4a72a6; }
.pic-name {
    display: block;
    margin-top: 5px;
    font-size: 10px;
    line-height: 1.3;
    color: #9a9186;
    font-family: monospace;
    word-break: break-all;
}
.pic-card .actionbtns {
    margin-top: auto;
    display: flex;
    gap: 6px;
}
.pic-card .actionbtns .pic-btn {
    flex: 1;
    padding: 6px 4px;
    font-size: 12px;
    font-family: inherit;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    color: #fff;
}
.pic-card .actionbtns .pic-btn.make { background: #5a7a4a; }
.pic-card .actionbtns .pic-btn.make:hover { background: #486139; }
.pic-card .actionbtns .pic-btn.del { background: #9e3030; }
.pic-card .actionbtns .pic-btn.del:hover { background: #7a2222; }

.pic-upload {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #eae6e1;
}
.pic-upload-label {
    display: block;
    font-weight: bold;
    color: #5d1b1d;
    font-size: 14px;
    margin-bottom: 8px;
}
.pic-upload-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---- Confirm dialog ---- */
.profile-dialog-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 10000;
}
.profile-dialog-box {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    padding: 28px 32px 24px;
    z-index: 10001;
    min-width: 360px;
    max-width: 480px;
}
.profile-dialog-box h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #602121;
}
.profile-dialog-box p {
    margin: 0 0 20px 0;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}
.profile-dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ---- Toast notification ---- */
#profileAdminToast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10002;
    padding: 14px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    max-width: 400px;
}
#profileAdminToast.toast-success {
    background: #2e7d32;
    color: #fff;
}
#profileAdminToast.toast-error {
    background: #c62828;
    color: #fff;
}
