/* ========================================
   REFERRAL SCREEN STYLES
   Modern, clean design for mobile
   ======================================== */

.referral-screen-content {
    padding: 16px;
    padding-bottom: 100px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 500px;
    margin: 0 auto;
}

/* ========================================
   SECTION BASE STYLES
   ======================================== */

.referral-code-section,
.enter-code-section,
.battery-bonus-section,
.friends-section {
    background: linear-gradient(145deg, rgba(30, 30, 50, 0.9), rgba(20, 20, 40, 0.95));
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========================================
   REFERRAL CODE SECTION
   ======================================== */

.referral-code-section {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.3);
    text-align: center;
    padding: 24px 20px;
}

.referral-code-section .section-title {
    justify-content: center;
    font-size: 16px;
}

.referral-code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 16px 0;
}

.code-value {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(59, 130, 246, 0.2));
    padding: 12px 24px;
    border-radius: 12px;
    border: 2px solid rgba(139, 92, 246, 0.4);
    letter-spacing: 4px;
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
    animation: pulse-glow 3s ease-in-out infinite;
}

.copy-btn {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-btn.copied {
    background: linear-gradient(135deg, #22C55E, #16A34A);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
    animation: copy-success 0.3s ease;
}

.code-hint {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    margin: 0;
}

/* Share button */
.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 16px;
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: #fff;
    border: none;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.share-btn:active {
    transform: scale(0.98);
}

/* ========================================
   ENTER CODE SECTION
   ======================================== */

.enter-code-section {
    padding: 20px;
}

.enter-code-form {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.enter-code-form input {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 14px 16px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

.enter-code-form input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    text-transform: none;
    letter-spacing: normal;
}

.enter-code-form input:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.apply-btn {
    background: linear-gradient(135deg, #22C55E, #16A34A);
    color: #fff;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
    white-space: nowrap;
}

.apply-btn:active {
    transform: scale(0.95);
}

.apply-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Code already used message */
.code-used-message {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    padding: 14px 16px;
    color: #22C55E;
    font-size: 14px;
}

.code-used-message .check-icon {
    font-size: 18px;
}

/* ========================================
   BATTERY BONUS SECTION
   ======================================== */

.battery-bonus-section {
    background: linear-gradient(145deg, rgba(30, 30, 50, 0.9), rgba(20, 20, 40, 0.95));
}

.bonus-info {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 14px;
    overflow: hidden;
}

.bonus-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.2s ease;
}

.bonus-row:last-child {
    border-bottom: none;
}

.bonus-row span:first-child {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.bonus-value {
    font-weight: 700;
    font-size: 16px;
    color: #22C55E;
    background: rgba(34, 197, 94, 0.15);
    padding: 4px 12px;
    border-radius: 8px;
}

.bonus-hint {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin: 12px 0 0 0;
    text-align: center;
    line-height: 1.4;
}

/* ========================================
   FRIENDS STATS
   ======================================== */

.friends-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-item {
    background: linear-gradient(145deg, rgba(30, 30, 50, 0.9), rgba(20, 20, 40, 0.95));
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
    border: 1px solid rgba(139, 92, 246, 0.2);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    background: linear-gradient(135deg, #8B5CF6, #3B82F6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

/* ========================================
   FRIENDS SECTION
   ======================================== */

.friends-section {
    padding: 20px;
}

.friends-section .section-title {
    margin-bottom: 12px;
}

.friends-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.friend-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.friend-item:active {
    background: rgba(255, 255, 255, 0.08);
}

.friend-item.l2 {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}

.friend-item.l2 .friend-avatar {
    background: linear-gradient(135deg, #6B7280, #4B5563);
}

.friend-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
}

.friend-info {
    flex: 1;
    min-width: 0;
}

.friend-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-bonus {
    font-size: 13px;
    color: #22C55E;
    margin-top: 2px;
    font-weight: 500;
}

.friend-item.l2 .friend-bonus {
    color: rgba(34, 197, 94, 0.7);
}

/* Empty state */
.friends-empty {
    text-align: center;
    padding: 24px 16px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.friends-empty-icon {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* ========================================
   REFERRED BY SECTION
   ======================================== */

.referred-by-section {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(22, 163, 74, 0.05));
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.referred-by-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22C55E, #16A34A);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
}

.referred-by-info {
    flex: 1;
}

.referred-by-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.referred-by-name {
    font-size: 15px;
    font-weight: 600;
    color: #22C55E;
    margin-top: 2px;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
    }
}

@keyframes copy-success {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 360px) {
    .referral-screen-content {
        padding: 12px;
        gap: 12px;
    }
    
    .code-value {
        font-size: 22px;
        padding: 10px 16px;
        letter-spacing: 3px;
    }
    
    .copy-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .friend-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .referral-code-display {
        flex-direction: column;
        gap: 12px;
    }
    
    .copy-btn {
        width: 100%;
    }
}

@media (min-width: 400px) {
    .referral-screen-content {
        padding: 20px;
    }
    
    .referral-code-section,
    .enter-code-section,
    .battery-bonus-section,
    .friends-section {
        padding: 24px;
    }
}

/* Fix enter code form overflow */
.enter-code-section {
    overflow: visible;
}

.enter-code-form {
    display: flex;
    gap: 8px;
    align-items: stretch;
    width: 100%;
}

.enter-code-form input {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px 14px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.enter-code-form .apply-btn {
    flex-shrink: 0;
    padding: 12px 16px;
    font-size: 13px;
    white-space: nowrap;
}

/* Share button copied animation */
.share-btn.copied {
    background: linear-gradient(135deg, #22C55E, #16A34A) !important;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.5) !important;
    transform: scale(1.02);
    animation: copy-pulse 0.4s ease;
}

@keyframes copy-pulse {
    0% { transform: scale(1); }
    30% { transform: scale(1.05); }
    60% { transform: scale(0.98); }
    100% { transform: scale(1.02); }
}

.share-btn {
    transition: all 0.3s ease;
}
