﻿/* Crew discovery tabs */

.crew-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    max-width: 360px;
    margin-bottom: 20px;
    padding: 5px;
    border: 1px solid #30415a;
    border-radius: 15px;
    background: #111c2c;
}

    .crew-tabs a {
        display: grid;
        place-items: center;
        min-height: 44px;
        padding: 8px 16px;
        border-radius: 10px;
        color: #a9b6c9;
        text-decoration: none;
        font-weight: 600;
    }

        .crew-tabs a:hover {
            color: #fff;
            background: #20314a;
        }

        .crew-tabs a.is-active {
            background: #345cff;
            color: #fff;
        }

/* Crew cards */

.crew-grid {
    align-items: stretch;
    gap: 20px;
}

.crew-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #354964;
    border-radius: 20px;
    background: #172232;
    box-shadow: 0 12px 28px rgb(0 0 0 / 15%);
}

.crew-card-cover {
    position: relative;
    flex-shrink: 0;
    min-height: 130px;
    aspect-ratio: 16 / 9;
    background: linear-gradient( 135deg, #365bc0, #223b69 45%, #142033 );
}

    .crew-card-cover > img {
        display: block;
        width: 100%;
        height: 100%;
        position: absolute;
        inset: 0;
        object-fit: cover;
    }

.crew-card-logo {
    position: absolute;
    bottom: -24px;
    left: 18px;
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    overflow: hidden;
    border: 3px solid #172232;
    border-radius: 18px;
    background: #101927;
    color: #c2d4ff;
    font-size: 1.8rem;
    font-weight: 800;
}

    .crew-card-logo img {
        display: block;
        width: 100%;
        height: 100%;
        min-width: 0;
        min-height: 0;
        object-fit: contain;
    }

.crew-card-content {
    flex: 1;
    padding: 40px 18px 12px;
}

    .crew-card-content h2 {
        margin: 0 0 8px;
        color: #edf2fb;
        font-size: 1.3rem;
        font-weight: 750;
        line-height: 1.3;
        letter-spacing: -0.025em;
    }

.crew-card-location {
    margin-bottom: 14px;
    color: #a7bdff;
    font-size: 0.85rem;
    line-height: 1.5;
}

.crew-card-description {
    display: -webkit-box;
    margin-bottom: 16px;
    overflow: hidden;
    color: #b9c6db;
    font-size: 0.9rem;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.crew-card-members {
    margin-bottom: 6px;
    color: #dce5f5;
    font-size: 0.85rem;
}

.crew-card-policy {
    margin: 0;
    color: #96a9c5;
    font-size: 0.8rem;
}

.crew-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 12px 8px 18px;
}

.crew-card-relationship {
    color: #a7bdff;
    font-size: 0.8rem;
    font-weight: 600;
}

.crew-card-edit {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #94a9c7;
}

    .crew-card-edit svg {
        width: 20px;
        height: 20px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.7;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .crew-card-edit:hover {
        color: #c3d5ff;
    }

        .crew-card-edit:hover svg {
            filter: drop-shadow(0 0 4px rgb(120 160 255 / 50%));
        }

.crews-page button:focus-visible,
.crews-page a:focus-visible {
    outline: 2px solid #a7bdff;
    outline-offset: 3px;
}

/* Crew modal */

#crewFormError {
    white-space: pre-line;
}

#crewFormModal .form-text {
    color: #a9b6c9;
}

#crewFormModal .modal-footer .btn {
    min-height: 44px;
    white-space: nowrap;
}

/* Mobile */

@media (max-width: 600px) {
    .crew-tabs {
        max-width: none;
    }

    .crew-grid {
        gap: 12px;
    }

    .crew-card {
        border-radius: 14px;
    }

    .crew-card-cover {
        min-height: 90px;
    }

    .crew-card-logo {
        bottom: -18px;
        left: 10px;
        width: 48px;
        height: 48px;
        border-radius: 13px;
        font-size: 1.25rem;
    }

    .crew-card-content {
        padding: 30px 10px 10px;
    }

        .crew-card-content h2 {
            font-size: 1rem;
        }

    .crew-card-location {
        margin-bottom: 10px;
        font-size: 0.75rem;
    }

    .crew-card-description {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
    }

    .crew-card-members,
    .crew-card-policy,
    .crew-card-relationship {
        font-size: 0.75rem;
    }

    .crew-card-footer {
        gap: 4px;
        padding-left: 10px;
        padding-right: 4px;
    }
}

/* Crew profile */

.crew-profile-hero {
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid #354964;
    border-radius: 22px;
    background: #172232;
}

.crew-profile-cover {
    position: relative;
    height: clamp(150px, 24vw, 300px);
    background: radial-gradient(circle at 15% 20%, #426de0, transparent 55%), linear-gradient(135deg, #263f70, #101927);
}

    .crew-profile-cover > img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.crew-profile-identity {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 0 28px 20px;
}

.crew-profile-logo {
    position: relative;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    margin-top: -35px;
    overflow: hidden;
    border: 5px solid #172232;
    border-radius: 24px;
    background: #101927;
    color: #b9cdff;
    font-size: 2.5rem;
    font-weight: 800;
}

    .crew-profile-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.crew-profile-heading {
    flex: 1;
    min-width: 0;
    padding-top: 20px;
}

    .crew-profile-heading h1 {
        margin: 8px 0;
        color: #edf2fb;
        font-size: clamp(1.6rem, 3vw, 2.6rem);
        font-weight: 800;
        line-height: 1.15;
        overflow-wrap: anywhere;
    }

.crew-profile-handle {
    margin-bottom: 8px;
    color: #a7bdff;
    overflow-wrap: anywhere;
}

.crew-profile-location {
    margin: 0;
    color: #b9c6db;
}

.crew-profile-identity > .crew-card-edit {
    margin-top: 16px;
}

.crew-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin: 0 28px;
    padding: 18px 0;
    border-top: 1px solid #30415a;
    color: #b9c6db;
    font-size: 0.85rem;
}

.crew-profile-section {
    margin-top: 24px;
    padding: 24px;
    border: 1px solid #30415a;
    border-radius: 20px;
    background: #142030;
}

    .crew-profile-section h2 {
        margin: 8px 0 20px;
        color: #edf2fb;
        font-size: 1.4rem;
        font-weight: 750;
    }

.crew-profile-description {
    margin: 0;
    color: #c4d0e2;
    line-height: 1.8;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.crew-member-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.crew-member {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 14px;
    border-radius: 14px;
    background: #101927;
}

.crew-member-avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    overflow: hidden;
    border: 1px solid #6e91ff;
    border-radius: 50%;
    background: #2948a8;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 750;
}

    .crew-member-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.crew-member-details {
    min-width: 0;
    overflow-wrap: anywhere;
}

    .crew-member-details > a,
    .crew-member-details > span {
        color: #edf2fb;
        text-decoration: none;
        font-weight: 650;
    }

        .crew-member-details > a:hover {
            color: #a7bdff;
        }

    .crew-member-details small {
        display: block;
        margin-top: 4px;
        color: #9eb2ce;
        font-size: 0.75rem;
    }

.crew-profile-empty {
    margin: 0;
    color: #b9c6db;
    line-height: 1.7;
}

.crew-profile-page .community-card-details h3 {
    margin: 0 0 8px;
    color: #edf2fb;
    font-size: 1.2rem;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.crew-card-name {
    color: inherit;
    text-decoration: none;
}

    .crew-card-name:hover {
        color: #a7bdff;
    }

@media (max-width: 900px) {
    .crew-member-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .crew-profile-identity {
        flex-wrap: wrap;
        gap: 12px;
        padding: 0 16px 18px;
    }

    .crew-profile-logo {
        width: 76px;
        height: 76px;
        margin-top: -28px;
        border-width: 4px;
        border-radius: 20px;
        font-size: 2rem;
    }

    .crew-profile-identity > .crew-card-edit {
        margin-top: 6px;
        margin-left: auto;
    }

    .crew-profile-heading {
        order: 3;
        flex-basis: 100%;
        padding-top: 0;
    }

    .crew-profile-meta {
        gap: 10px 18px;
        margin: 0 16px;
        font-size: 0.8rem;
    }

    .crew-profile-section {
        padding: 16px;
        border-radius: 16px;
    }

    .crew-member-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .crew-profile-page .community-card-details h3 {
        font-size: 0.95rem;
    }
}

.crew-join-actions {
    margin: 0 0 24px;
}

    .crew-join-actions .btn {
        min-height: 44px;
        padding: 12px 20px;
    }

#crewJoinError {
    white-space: pre-line;
}

.crew-request-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.crew-request {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px;
    border-radius: 14px;
    background: #101927;
}

.crew-request-person {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 200px;
}

.crew-review-form {
    display: flex;
    gap: 8px;
}

    .crew-review-form .btn {
        min-height: 44px;
        white-space: nowrap;
    }

#crewReviewError {
    white-space: pre-line;
}

@media (max-width: 600px) {
    .crew-review-form {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }
}

@media (max-width: 600px) {
    .crew-profile-cover {
        background: #0e1623;
    }

        .crew-profile-cover > img {
            object-fit: contain;
        }
}

.crew-discovery-heading {
    margin-bottom: 24px;
}

.crew-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 6px;
}

    .crew-heading-row h1 {
        margin: 0;
        color: #edf2fb;
        font-size: clamp(1.6rem, 3vw, 2.4rem);
        font-weight: 800;
    }

.crew-discovery-heading > p {
    margin: 10px 0 0;
    color: #b9c6db;
}

.crew-create-button {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #354964;
    border-radius: 12px;
    background: #172232;
    color: #a7bdff;
    text-decoration: none;
    transition: color 150ms, background 150ms;
}

    .crew-create-button svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
    }

    .crew-create-button:hover {
        background: #24385b;
        color: #fff;
    }

.crew-member-details {
    flex: 1;
}

#crewMemberModal .form-text {
    color: #a9b6c9;
}

#crewMemberModal .modal-footer .btn {
    min-height: 44px;
    white-space: nowrap;
}

#crewMemberError {
    white-space: pre-line;
}

#crewRemoveConfirmation,
#crewTransferConfirmation {
    background: #251c28;
    border: 1px solid #805063;
    border-radius: 12px;
    color: #eadce3;
}

#crewRemoveCancel,
#crewTransferCancel {
    background: transparent;
    border-color: #63758e;
    color: #dce5f5;
}

    #crewRemoveCancel:hover,
    #crewTransferCancel:hover {
        background: #26364c;
        border-color: #9eb4d2;
        color: #fff;
    }

.crew-profile-actions {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
    margin-left: auto;
}

@media (max-width: 600px) {
    .crew-profile-actions {
        margin-top: 6px;
    }
}

.crew-profile-leave {
    color: #f07878;
    border: 1px solid #f07878;
}

    .crew-profile-leave svg {
        stroke-width: 2.8;
    }

    .crew-profile-leave:hover {
        background: #38212b;
        color: #ffaaaa;
    }

.crew-grid .crew-card {
    position: relative;
}

.crew-grid .crew-card-name::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.crew-grid .crew-card:hover,
.crew-grid .crew-card:focus-within {
    border-color: #8caaff;
}

.crew-grid .crew-card-name:focus-visible {
    outline: none;
}

    .crew-grid .crew-card-name:focus-visible::after {
        outline: 2px solid #a7bdff;
        outline-offset: -3px;
        border-radius: inherit;
    }

.crew-grid .crew-card-edit {
    position: relative;
    z-index: 2;
}

.crew-profile-page .crew-member-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 600px) {
    .crew-profile-page .crew-member {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 44px;
        align-items: center;
        gap: 8px 6px;
        padding: 10px 8px;
    }

    .crew-profile-page .crew-member-avatar {
        grid-column: 1;
        grid-row: 1;
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }

    .crew-profile-page .crew-member-details {
        grid-column: 1 / -1;
        grid-row: 2;
        min-width: 0;
    }

        .crew-profile-page .crew-member-details > a,
        .crew-profile-page .crew-member-details > span {
            display: block;
            font-size: 0.85rem;
            line-height: 1.4;
        }

        .crew-profile-page .crew-member-details small {
            margin-top: 3px;
            font-size: 0.7rem;
        }

    .crew-profile-page .crew-member > .crew-card-edit {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }
}