/* profile.css — StudEco Profile Page Styles
   Uses the same color values as assets/css/app.css:
   Primary:    #0aa6d7
   Black:      #2a322d
   Dark Gray:  #7a8582
   Light Gray: #f4f5f5
   White:      #fefcfb
   Shadow:     2px 1px 5px 0px rgba(2,69,122,0.04)…
   Font:       Inter, sans-serif
   Border-radius cards: 20px (matching .profile-card patterns in project)
*/

/* =========================================================
   PROFILE HERO SECTION
   ========================================================= */
.profile-hero {
    background: linear-gradient(135deg, #f4f5f5 0%, #e8f7fc 100%);
    padding: 60px 0 40px;
    border-bottom: 1px solid #e2e8e6;
}

.profile-hero__inner {
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

/* Avatar */
.profile-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #0aa6d7;
    display: block;
}

.profile-avatar-upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #0aa6d7;
    color: #fefcfb;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    padding: 0;
}

.profile-avatar-upload-btn:hover {
    background: #088cb5;
}

#avatar-file-input {
    display: none;
}

/* Hero Info */
.profile-hero__info {
    flex: 1;
    min-width: 200px;
}

.profile-hero__name {
    font-size: 28px;
    font-weight: 600;
    color: #2a322d;
    margin-bottom: 4px;
}

.profile-hero__email {
    color: #7a8582;
    font-size: 14px;
    margin-bottom: 10px;
}

/* ── goldSpin keyframe (also defined globally in app.css for nav/Q&A) ── */
@keyframes goldSpin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ── Premium gold spinning ring — profile page ── */
.premium-avatar-wrap::before {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: conic-gradient(#d4aa00, #f5d060, #d4aa00, #a07800, #d4aa00);
    z-index: -1;
    animation: goldSpin 3s linear infinite;
}
.premium-avatar-wrap .profile-avatar { border-color: #d4aa00; }

/* ── Plan Badge ── */
.profile-plan-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 50px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.profile-plan-badge--premium {
    background: linear-gradient(90deg, #d4aa00, #f5d060);
    color: #5a3e00;
    box-shadow: 0 2px 8px rgba(212,170,0,0.35);
}
.profile-plan-badge--free {
    background: #f4f5f5;
    color: #7a8582;
}

.profile-hero__college-tag {
    display: inline-block;
    background: rgba(10, 166, 215, 0.1);
    color: #0aa6d7;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 50px;
    margin-bottom: 6px;
}

/* Joined date */
.profile-hero__joined {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #7a8582;
    margin-bottom: 10px;
}
.profile-hero__joined i { color: #0aa6d7; }

/* College row (view mode) */
.profile-college-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

/* Edit pencil button */
.profile-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 8px;
    color: #7a8582;
    font-size: 13px;
    transition: color 0.2s, background 0.2s;
    line-height: 1;
}
.profile-edit-btn:hover { color: #0aa6d7; background: rgba(10,166,215,0.08); }

/* College edit mode */
.profile-college-edit {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.profile-college-input {
    flex: 1;
    min-width: 180px;
    height: 36px;
    padding: 4px 14px;
    border: 1.5px solid #0aa6d7;
    border-radius: 50px;
    font-family: "Inter", sans-serif;
    font-size: 13px;
    color: #2a322d;
    outline: none;
    background: #fff;
}
.profile-college-input:focus { border-color: #088cb5; box-shadow: 0 0 0 3px rgba(10,166,215,0.12); }

.profile-save-btn {
    height: 36px;
    padding: 0 16px;
    background: #0aa6d7;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    font-family: "Inter", sans-serif;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.profile-save-btn:hover { background: #088cb5; }
.profile-save-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.profile-cancel-btn {
    height: 36px;
    width: 36px;
    background: #f4f5f5;
    color: #7a8582;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-cancel-btn:hover { background: #e2e8e6; color: #2a322d; }


.profile-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 50px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-left: 8px;
    vertical-align: middle;
}

.profile-badge--bronze {
    background-color: #f5e6da;
    color: #8c5a3a;
}

.profile-badge--silver {
    background-color: #e8ecec;
    color: #5a6360;
}

.profile-badge--gold {
    background-color: #fdf3d0;
    color: #8a6d00;
}

/* Score Ring */
.profile-score-ring-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: auto;
    gap: 8px;
}

.profile-score-ring-wrap svg {
    width: 110px;
    height: 110px;
}

.score-ring-bg {
    fill: none;
    stroke: #e2e8e6;
    stroke-width: 8;
}

.score-ring-fill {
    fill: none;
    stroke: #0aa6d7;
    stroke-width: 8;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 0.05s linear;
}

.score-ring-text {
    font-size: 18px;
    font-weight: 700;
    fill: #2a322d;
    text-anchor: middle;
    dominant-baseline: central;
}

.score-ring-label {
    font-size: 11px;
    fill: #7a8582;
    text-anchor: middle;
    dominant-baseline: central;
}

.profile-score-ring-caption {
    font-size: 13px;
    color: #7a8582;
    font-weight: 500;
}

/* =========================================================
   STATS BAR
   ========================================================= */
.profile-stats-bar {
    background: #fefcfb;
    border-radius: 16px;
    box-shadow: 2px 1px 5px 0px rgba(2, 69, 122, 0.04),
                9px 4px 10px 0px rgba(2, 69, 122, 0.03);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: 28px 0;
    overflow: hidden;
}

.profile-stat-item {
    padding: 24px 16px;
    text-align: center;
    border-right: 1px solid #e2e8e6;
}

.profile-stat-item:last-child {
    border-right: none;
}

.profile-stat-number {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #0aa6d7;
    line-height: 1.1;
}

.profile-stat-label {
    font-size: 13px;
    color: #7a8582;
    margin-top: 4px;
    display: block;
    font-weight: 500;
}

/* =========================================================
   TABS
   ========================================================= */
.profile-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.profile-tab-btn {
    padding: 9px 22px;
    border-radius: 50px;
    border: 2px solid #e2e8e6;
    background: transparent;
    color: #7a8582;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: "Inter", sans-serif;
    transition: all 0.25s ease;
}

.profile-tab-btn:hover {
    border-color: #0aa6d7;
    color: #0aa6d7;
}

.profile-tab-btn.active {
    background: #0aa6d7;
    border-color: #0aa6d7;
    color: #fefcfb;
}

.profile-tab-panel {
    display: none;
}

.profile-tab-panel.active {
    display: block;
}

/* =========================================================
   CARD GRID (Purchases & Reviews)
   ========================================================= */
.profile-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.profile-item-card {
    background: #fefcfb;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 2px 1px 5px 0px rgba(2, 69, 122, 0.04),
                9px 4px 10px 0px rgba(2, 69, 122, 0.03),
                19px 10px 13px 0px rgba(2, 69, 122, 0.02);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}

.profile-item-card:hover {
    transform: translateY(-4px);
    box-shadow: 2px 1px 5px 0px rgba(2, 69, 122, 0.07),
                9px 4px 15px 0px rgba(2, 69, 122, 0.06),
                19px 10px 20px 0px rgba(2, 69, 122, 0.04);
}

.profile-item-card__img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 14px;
    background: #f4f5f5;
}

.profile-item-card__type-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 50px;
    background: rgba(10, 166, 215, 0.12);
    color: #0aa6d7;
    margin-bottom: 8px;
}

.profile-item-card__title {
    font-size: 15px;
    font-weight: 600;
    color: #2a322d;
    margin-bottom: 6px;
    line-height: 1.4;
}

.profile-item-card__price {
    font-size: 18px;
    font-weight: 700;
    color: #0aa6d7;
    margin-bottom: 6px;
}

.profile-item-card__date {
    font-size: 12px;
    color: #7a8582;
}

/* Star Rating */
.profile-star-rating {
    color: #f59e0b;
    font-size: 14px;
    margin-bottom: 8px;
}

.profile-star-rating .empty {
    color: #c9cfce;
}

.profile-review-text {
    font-size: 13px;
    color: #7a8582;
    line-height: 1.6;
    margin-bottom: 8px;
}

/* =========================================================
   Q&A LIST
   ========================================================= */
.profile-qa-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.profile-qa-item {
    background: #fefcfb;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 2px 1px 5px 0px rgba(2, 69, 122, 0.04),
                9px 4px 10px 0px rgba(2, 69, 122, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    transition: transform 0.25s ease;
}

.profile-qa-item:hover {
    transform: translateY(-2px);
}

.profile-qa-item__question {
    font-size: 15px;
    font-weight: 500;
    color: #2a322d;
    line-height: 1.5;
}

.profile-qa-item__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.profile-qa-item__answers-count {
    background: rgba(10, 166, 215, 0.1);
    color: #0aa6d7;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 50px;
    white-space: nowrap;
}

.profile-qa-item__date {
    font-size: 11px;
    color: #7a8582;
}

/* =========================================================
   EMPTY STATE
   ========================================================= */
.profile-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #7a8582;
}

.profile-empty-state i {
    font-size: 48px;
    color: #c9cfce;
    margin-bottom: 16px;
    display: block;
}

.profile-empty-state p {
    font-size: 15px;
    color: #7a8582;
}

/* =========================================================
   RESPONSIVE — single column below 600px
   ========================================================= */
@media (max-width: 600px) {
    .profile-hero__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    .profile-score-ring-wrap {
        margin-left: 0;
        align-self: center;
        width: 100%;
    }

    .profile-stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-stat-item:nth-child(2) {
        border-right: none;
    }

    .profile-stat-item:nth-child(1),
    .profile-stat-item:nth-child(2) {
        border-bottom: 1px solid #e2e8e6;
    }

    .profile-card-grid {
        grid-template-columns: 1fr;
    }

    .profile-tabs {
        gap: 8px;
    }

    .profile-tab-btn {
        font-size: 13px;
        padding: 8px 16px;
    }

    .profile-hero__name {
        font-size: 22px;
    }

    .profile-qa-item {
        flex-direction: column;
    }

    .profile-qa-item__meta {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* Profile Logout Button */
.profile-logout-btn {
    background: transparent;
    border: 1.5px solid #ff4d4d;
    color: #ff4d4d;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
}

.profile-logout-btn:hover {
    background: #ff4d4d10;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 77, 77, 0.15);
}

.profile-logout-btn i {
    font-size: 16px;
}

.mt-20 { margin-top: 20px; }


/* Loyalty Info Box */
.profile-loyalty-info {
    background: #fff;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px dashed #0aa6d7;
    margin-top: 15px;
    box-shadow: 0 4px 10px rgba(10, 166, 215, 0.05);
    max-width: 220px;
    text-align: left;
}

.profile-loyalty-info__icon {
    font-size: 20px;
}

.profile-loyalty-info__text {
    font-size: 11.5px;
    color: #7a8582;
    line-height: 1.5;
}

.profile-loyalty-info__text strong {
    color: #2a322d;
    font-size: 13px;
}

.mt-15 { margin-top: 15px; }
