/* ==========================================
   CAST MEMBERS PORTAL
   PROFILE
========================================== */


/* ==========================================
   PROFILE PAGE
========================================== */

.cast-profile-modern {
    width: 100%;
    max-width: 1000px;
    margin: 30px auto;
}


/* ==========================================
   PROFILE CARD
========================================== */

.cast-profile-card {
    overflow: hidden;

    background: #ffffff;

    border: 1px solid var(--cast-border);
    border-radius: 20px;

    box-shadow: var(--cast-shadow);
}


/* ==========================================
   PROFILE COVER
========================================== */

.cast-profile-cover {
    position: relative;

    height: 155px;

    background:
        linear-gradient(
            135deg,
            var(--cast-primary),
            var(--cast-primary-dark)
        );
}


/* Decorative circle */

.cast-profile-cover::before {
    content: "";

    position: absolute;

    width: 220px;
    height: 220px;

    right: -70px;
    top: -100px;

    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.06);
}


.cast-profile-cover::after {
    content: "";

    position: absolute;

    width: 130px;
    height: 130px;

    right: 110px;
    bottom: -70px;

    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.04);
}


/* ==========================================
   PROFILE MAIN AREA
========================================== */

.cast-profile-main {
    display: flex;
    align-items: flex-end;

    gap: 20px;

    padding: 0 30px 20px;
}


/* ==========================================
   PROFILE PHOTO
========================================== */

.cast-profile-avatar {
    position: relative;

    width: 130px;
    height: 130px;

    flex: 0 0 130px;
}


.cast-profile-main
.cast-profile-avatar {
    margin-top: -65px;
}


.cast-profile-avatar-image,
.cast-profile-avatar-placeholder {
    width: 130px !important;
    height: 130px !important;

    box-sizing: border-box;

    object-fit: cover;

    border-radius: 50%;

    border: 5px solid #ffffff;

    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.14);
}


.cast-profile-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;

    background:
        var(--cast-primary);

    color: #ffffff;

    font-size: 42px;
    font-weight: 800;

    text-transform: uppercase;
}


/* ==========================================
   PROFILE NAME / HEADING
========================================== */

.cast-profile-heading {
    flex: 1;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    min-width: 0;
}


.cast-profile-heading h2 {
    margin: 0;

    color:
        var(--cast-text);

    font-size: 28px;
    font-weight: 800;

    line-height: 1.2;
}


.cast-profile-member-number {
    margin: 5px 0 0;

    color:
        var(--cast-muted);

    font-size: 13px;
}


/* ==========================================
   EDIT PROFILE BUTTON
========================================== */

.cast-profile-edit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 11px 18px;

    border-radius: 10px;

    background:
        var(--cast-primary);

    color: #ffffff !important;

    text-decoration: none !important;

    font-size: 14px;
    font-weight: 700;

    white-space: nowrap;

    transition: 0.2s ease;
}


.cast-profile-edit-button:hover {
    background:
        var(--cast-primary-dark);

    color: #ffffff !important;

    transform: translateY(-1px);
}


/* ==========================================
   STATUS BADGES
========================================== */

.cast-profile-badges {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;

    padding: 0 30px 22px;
}


.cast-profile-badge {
    display: inline-flex;
    align-items: center;

    padding: 6px 11px;

    border-radius: 999px;

    font-size: 12px;
    font-weight: 700;
}


.cast-profile-badge-active {
    background: var(--cast-success-bg);

    color:
        var(--cast-success);
}


.cast-profile-badge-approved {
    background:
        var(--cast-primary-light);

    color:
        var(--cast-primary);
}


/* ==========================================
   MEMBER INFORMATION
========================================== */

.cast-profile-details {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    border-top:
        1px solid var(--cast-border);
}


.cast-profile-detail {
    min-width: 0;

    padding: 22px 30px;

    border-bottom:
        1px solid var(--cast-border);
}


.cast-profile-detail:nth-child(odd) {
    border-right:
        1px solid var(--cast-border);
}


.cast-profile-detail-label {
    display: block;

    margin-bottom: 6px;

    color:
        var(--cast-muted);

    font-size: 12px;
    font-weight: 600;

    text-transform: uppercase;

    letter-spacing: 0.4px;
}


.cast-profile-detail strong {
    display: block;

    overflow-wrap: anywhere;

    color:
        var(--cast-text);

    font-size: 15px;
    font-weight: 700;
}


/* Remove bottom borders from final row */

.cast-profile-detail:nth-last-child(-n + 2) {
    border-bottom: 0;
}


/* ==========================================
   EDIT PROFILE CARD
========================================== */

.cast-profile-edit-card {
    padding: 30px;

    background: #ffffff;

    border:
        1px solid var(--cast-border);

    border-radius: 20px;

    box-shadow:
        var(--cast-shadow);
}


/* ==========================================
   EDIT HEADER
========================================== */

.cast-profile-edit-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    padding-bottom: 22px;

    margin-bottom: 25px;

    border-bottom:
        1px solid var(--cast-border);
}


.cast-profile-edit-header h2 {
    margin: 0 0 5px;

    color:
        var(--cast-text);

    font-size: 25px;
    font-weight: 800;
}


.cast-profile-edit-header p {
    margin: 0;

    color:
        var(--cast-muted);

    font-size: 13px;
}


/* ==========================================
   CANCEL BUTTON
========================================== */

.cast-profile-cancel-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 9px 15px;

    background: #f3f4f6;

    border:
        1px solid var(--cast-border);

    border-radius: 9px;

    color:
        var(--cast-text) !important;

    text-decoration: none !important;

    font-size: 13px;
    font-weight: 700;
}


.cast-profile-cancel-button:hover {
    border-color:
        var(--cast-primary);

    color:
        var(--cast-primary) !important;
}


/* ==========================================
   PHOTO EDITOR
========================================== */

.cast-profile-photo-editor {
    display: flex;
    align-items: center;

    gap: 25px;

    padding: 22px;

    margin-bottom: 28px;

    background:
        var(--cast-bg);

    border:
        1px solid var(--cast-border);

    border-radius: 15px;
}


.cast-profile-photo-editor
.cast-profile-avatar {
    margin: 0;
}


.cast-profile-photo-editor label {
    display: block;

    margin-bottom: 8px;

    color:
        var(--cast-text);

    font-size: 14px;
    font-weight: 700;
}


.cast-profile-photo-editor
input[type="file"] {
    max-width: 100%;
}


.cast-profile-photo-editor small {
    display: block;

    margin-top: 7px;

    color:
        var(--cast-muted);

    font-size: 12px;
}


/* ==========================================
   EDIT FORM GRID
========================================== */

.cast-profile-edit-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 20px;
}


.cast-profile-field {
    min-width: 0;
}


.cast-profile-field label {
    display: block;

    margin-bottom: 7px;

    color:
        var(--cast-text);

    font-size: 13px;
    font-weight: 700;
}


.cast-profile-field input {
    width: 100%;

    box-sizing: border-box;

    padding: 12px 14px;

    background: #ffffff;

    border:
        1px solid var(--cast-border);

    border-radius: 10px;

    color:
        var(--cast-text);

    font: inherit;

    transition: 0.2s ease;
}


.cast-profile-field input:focus {
    outline: none;

    border-color:
        var(--cast-primary);

    box-shadow:
        0 0 0 3px
        rgba(11, 77, 184, 0.10);
}


.cast-profile-field input:disabled {
    background: #f3f4f6;

    color:
        var(--cast-muted);

    cursor: not-allowed;
}


.cast-profile-field small {
    display: block;

    margin-top: 6px;

    color:
        var(--cast-muted);

    font-size: 11px;
}


/* ==========================================
   SAVE ACTIONS
========================================== */

.cast-profile-form-actions {
    display: flex;
    align-items: center;

    gap: 15px;

    margin-top: 30px;

    padding-top: 22px;

    border-top:
        1px solid var(--cast-border);
}


.cast-profile-form-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 12px 22px;

    border: 0;

    border-radius: 10px;

    background:
        var(--cast-primary);

    color: #ffffff;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition: 0.2s ease;
}


.cast-profile-form-actions button:hover {
    background:
        var(--cast-primary-dark);

    transform: translateY(-1px);
}


.cast-profile-form-actions a {
    color:
        var(--cast-muted);

    text-decoration: none;

    font-size: 13px;
    font-weight: 600;
}


.cast-profile-form-actions a:hover {
    color:
        var(--cast-primary);
}


/* ==========================================
   TABLET
========================================== */

@media (max-width: 768px) {

    .cast-profile-modern {
        margin: 15px auto;
    }


    .cast-profile-cover {
        height: 125px;
    }


    .cast-profile-main {
        padding:
            0 20px 18px;
    }


    .cast-profile-badges {
        padding:
            0 20px 20px;
    }


    .cast-profile-detail {
        padding:
            18px 20px;
    }

}


/* ==========================================
   MOBILE
========================================== */

@media (max-width: 600px) {

    .cast-profile-card {
        border-radius: 16px;
    }


    .cast-profile-cover {
        height: 105px;
    }


    .cast-profile-main {
        display: block;

        padding:
            0 18px 18px;
    }


    .cast-profile-avatar {
        width: 100px;
        height: 100px;

        flex-basis: 100px;
    }


    .cast-profile-main
    .cast-profile-avatar {
        margin-top: -50px;
        margin-bottom: 12px;
    }


    .cast-profile-avatar-image,
    .cast-profile-avatar-placeholder {
        width: 100px !important;
        height: 100px !important;

        border-width: 4px;
    }


    .cast-profile-avatar-placeholder {
        font-size: 32px;
    }


    .cast-profile-heading {
        align-items: center;

        gap: 10px;
    }


    .cast-profile-heading h2 {
        font-size: 21px;
    }


    .cast-profile-member-number {
        font-size: 12px;
    }


    .cast-profile-edit-button {
        padding: 8px 12px;

        font-size: 11px;
    }


    .cast-profile-badges {
        padding:
            0 18px 18px;
    }


    .cast-profile-details {
        grid-template-columns: 1fr;
    }


    .cast-profile-detail {
        padding:
            16px 18px;

        border-right: 0 !important;
        border-bottom:
            1px solid var(--cast-border) !important;
    }


    .cast-profile-detail:last-child {
        border-bottom: 0 !important;
    }


    /* EDIT MODE */

    .cast-profile-edit-card {
        padding: 20px;

        border-radius: 16px;
    }


    .cast-profile-edit-header {
        align-items: center;

        gap: 10px;
    }


    .cast-profile-edit-header h2 {
        font-size: 21px;
    }


    .cast-profile-edit-header p {
        font-size: 12px;
    }


    .cast-profile-cancel-button {
        padding: 7px 10px;

        font-size: 11px;

        white-space: nowrap;
    }


    .cast-profile-photo-editor {
        display: block;

        padding: 18px;
    }


    .cast-profile-photo-editor
    .cast-profile-avatar {
        margin-bottom: 18px;
    }


    .cast-profile-edit-grid {
        grid-template-columns: 1fr;
    }


    .cast-profile-form-actions {
        align-items: center;
    }

}