/**
 * AdvanceQuiz Profile CSS
 * Extends home.css with profile-specific styles
 */

/* Profile Main */
.profile-main {
    min-height: calc(100vh - var(--app-bar-height));
    padding-bottom: 32px;
}

/* App Bar Left (back + title) */
.app-bar-left {
    display: flex;
    align-items: center;
    gap: 4px;
}

.app-bar-title-text {
    font-size: 18px;
    font-weight: 700;
}

/* Profile Hero / Header */
.profile-hero {
    position: relative;
    padding-bottom: 24px;
    overflow: hidden;
}

.profile-hero-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 140px;
    background: linear-gradient(135deg, var(--md-sys-color-primary) 0%, #9333EA 100%);
}

.profile-avatar-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 60px;
    gap: 10px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--md-sys-color-surface);
    border: 4px solid var(--md-sys-color-surface);
    box-shadow: var(--md-sys-elevation-2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.profile-avatar.uploading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(28, 27, 31, 0.28);
}

.avatar-edit-badge {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 17px;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--md-sys-elevation-1);
    cursor: pointer;
}

.avatar-edit-badge svg {
    width: 18px;
    height: 18px;
}

.avatar-placeholder {
    width: 56px;
    height: 56px;
    color: var(--md-sys-color-outline);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    text-align: center;
    padding: 0 16px;
    word-break: break-word;
}

.profile-email {
    font-size: 14px;
    color: var(--md-sys-color-on-surface-variant);
    text-align: center;
}

/* Stats Card */
.profile-stats-card {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 16px 16px;
    padding: 16px;
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 16px;
}

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

.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--md-sys-color-primary);
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-divider {
    width: 1px;
    height: 36px;
    background: var(--md-sys-color-outline-variant);
}

/* Section Card */
.profile-section-card {
    margin: 0 16px 16px;
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 16px;
    overflow: hidden;
}

.section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--md-sys-color-primary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 16px 16px 8px;
}

/* Info Tiles */
.info-tile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.info-tile:last-child {
    border-bottom: none;
}

.info-tile:hover {
    background: var(--md-sys-color-surface-variant);
}

.info-tile button {
    font: inherit;
}

.info-tile-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--md-sys-color-primary-container);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-tile-icon svg {
    width: 20px;
    height: 20px;
    color: var(--md-sys-color-primary);
}

.info-tile-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.info-tile-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.info-tile-value {
    font-size: 15px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.info-tile-action {
    width: 20px;
    height: 20px;
    color: var(--md-sys-color-on-surface-variant);
    flex-shrink: 0;
}

.info-tile-chevron {
    width: 20px;
    height: 20px;
    color: var(--md-sys-color-on-surface-variant);
    flex-shrink: 0;
}

/* Plan Badge */
.plan-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    background: var(--md-sys-color-success-container);
    color: var(--md-sys-color-on-success-container);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-badge.pro {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: #FFFFFF;
}

.plan-icon svg {
    color: var(--md-sys-color-success);
}

/* Danger Section */
.danger-section {
    border-color: var(--md-sys-color-error-container);
}

.danger-tile:hover {
    background: var(--md-sys-color-error-container);
}

.danger-icon {
    background: var(--md-sys-color-error-container);
}

.danger-icon svg {
    color: var(--md-sys-color-error);
}

.danger-text {
    color: var(--md-sys-color-error) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    text-transform: none !important;
}

/* Input Field */
.input-field input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-size: 15px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    background: var(--md-sys-color-surface-variant);
    border: 2px solid transparent;
    border-radius: 12px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.input-field input:focus {
    border-color: var(--md-sys-color-primary);
    background: var(--md-sys-color-surface);
}

/* Refresh spin animation */
.refreshing svg {
    animation: spin 0.8s linear infinite;
}
