/* ===== Battery System Styles ===== */

/* Battery Widget in Profile */
.battery-widget {
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    padding: 20px;
    margin: 16px 0;
    position: relative;
    overflow: hidden;
}

.battery-widget::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    animation: batteryGlow 4s ease-in-out infinite;
}

@keyframes batteryGlow {
    0%, 100% { transform: translate(0, 0); opacity: 0.5; }
    50% { transform: translate(10%, 10%); opacity: 1; }
}

.battery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.battery-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.battery-icon {
    font-size: 24px;
}

.battery-percentage {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Battery Container */
.battery-container {
    position: relative;
    z-index: 1;
}

.battery-body {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    height: 40px;
    padding: 4px;
    position: relative;
    overflow: hidden;
}

.battery-fill {
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, #8B5CF6, #A78BFA, #EC4899);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-width: 0;
}

.battery-fill.full {
    animation: batteryPulse 1.5s ease-in-out infinite;
}

@keyframes batteryPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(139, 92, 246, 0.5); }
    50% { box-shadow: 0 0 25px rgba(139, 92, 246, 0.8), 0 0 40px rgba(236, 72, 153, 0.4); }
}

.battery-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: batteryShine 2s ease-in-out infinite;
}

@keyframes batteryShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Battery Tip */
.battery-tip {
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 20px;
    background: rgba(139, 92, 246, 0.5);
    border-radius: 0 4px 4px 0;
}

/* Battery Info */
.battery-info {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    position: relative;
    z-index: 1;
}

.battery-charge-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Open Case Button */
.battery-open-btn {
    width: 100%;
    margin-top: 16px;
    padding: 16px;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.battery-open-btn.ready {
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    color: #fff;
    animation: btnPulse 2s ease-in-out infinite;
}

.battery-open-btn.ready:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

@keyframes btnPulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
    50% { box-shadow: 0 6px 25px rgba(139, 92, 246, 0.5); }
}

.battery-open-btn.disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
}

/* Active Discount Badge */
.active-discount-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 12px;
    position: relative;
    z-index: 1;
}

.discount-icon {
    font-size: 20px;
}

.discount-info {
    flex: 1;
}

.discount-percent {
    font-size: 16px;
    font-weight: 700;
    color: #22C55E;
}

.discount-expires {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

/* ===== Case Modal ===== */
.case-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.case-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.case-modal {
    background: linear-gradient(180deg, #1a1a3a 0%, #0A0A1B 100%);
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    padding: 32px 24px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: 1px solid rgba(139, 92, 246, 0.3);
    position: relative;
}

.case-modal-overlay.active .case-modal {
    transform: scale(1);
}

.case-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.case-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.case-modal-title {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
}

.case-modal-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 24px;
}

/* ===== Slot Machine ===== */
.slot-machine-container {
    margin: 24px 0;
    position: relative;
}

.slot-machine {
    background: linear-gradient(180deg, #1a1a3a 0%, #0A0A1B 100%);
    border: 3px solid rgba(139, 92, 246, 0.5);
    border-radius: 16px;
    padding: 4px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.3), inset 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
}

.slot-viewport {
    height: 100px;
    overflow: hidden;
    position: relative;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
}

.slot-viewport::before,
.slot-viewport::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 25px;
    z-index: 2;
    pointer-events: none;
}

.slot-viewport::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(10, 10, 27, 0.95), transparent);
}

.slot-viewport::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(10, 10, 27, 0.95), transparent);
}

.slot-strip {
    display: flex;
    flex-direction: column;
}

.slot-item {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 20px;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), transparent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.slot-item:nth-child(odd) {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.05), transparent);
}

.slot-item-icon {
    font-size: 44px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.slot-item-info {
    text-align: left;
    flex: 1;
}

.slot-item-label {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.slot-item-value {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
}

.slot-pointer {
    position: absolute;
    left: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 14px solid transparent;
    border-bottom: 14px solid transparent;
    border-left: 18px solid #FFD700;
    filter: drop-shadow(2px 0 6px rgba(255, 215, 0, 0.5));
    z-index: 5;
}

.slot-pointer-right {
    left: auto;
    right: -14px;
    border-left: none;
    border-right: 18px solid #FFD700;
    filter: drop-shadow(-2px 0 6px rgba(255, 215, 0, 0.5));
}

.slot-highlight {
    position: absolute;
    top: 50%;
    left: 4px;
    right: 4px;
    height: 100px;
    transform: translateY(-50%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 12px;
    pointer-events: none;
    z-index: 1;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.15), inset 0 0 30px rgba(255, 215, 0, 0.05);
}

/* Spin Button */
.spin-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    border: none;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 16px;
}

.spin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.spin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spin-btn.spinning {
    background: rgba(139, 92, 246, 0.3);
}

/* Prize Result */
.prize-result {
    display: none;
    text-align: center;
    padding: 20px 0;
}

.prize-result.show {
    display: block;
    animation: prizeReveal 0.5s ease;
}

@keyframes prizeReveal {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

.prize-icon-large {
    font-size: 72px;
    margin-bottom: 16px;
    animation: prizeBounce 0.6s ease;
}

@keyframes prizeBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.prize-label-large {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
}

.prize-description {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 24px;
}

.close-prize-btn {
    padding: 16px 48px;
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-prize-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

/* Compact Battery Widget */
.battery-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    padding: 8px 14px;
    cursor: pointer;
    position: relative;
}

.battery-compact-icon {
    font-size: 16px;
}

.battery-compact-bar {
    width: 50px;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.battery-compact-fill {
    height: 100%;
    background: linear-gradient(90deg, #8B5CF6, #EC4899);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.battery-compact-fill.full {
    animation: compactPulse 1.5s ease-in-out infinite;
}

@keyframes compactPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.battery-compact-text {
    font-size: 12px;
    font-weight: 600;
    color: #A78BFA;
    min-width: 32px;
}

.battery-compact-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 14px;
    animation: badgeBounce 1s ease-in-out infinite;
}

@keyframes badgeBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Confetti Animation */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #8B5CF6;
    animation: confettiFall 3s ease-out forwards;
    z-index: 10001;
    pointer-events: none;
    border-radius: 2px;
}

@keyframes confettiFall {
    0% { opacity: 1; transform: translateY(0) rotate(0deg); }
    100% { opacity: 0; transform: translateY(100vh) rotate(720deg); }
}

/* Referral Profile Card */
.referral-profile-card {
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    padding: 16px;
    margin: 16px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.referral-profile-card:active {
    transform: scale(0.98);
}

.referral-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.referral-tier-badge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.referral-tier-badge .tier-icon {
    font-size: 32px;
}

.referral-tier-badge .tier-info .tier-name {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.referral-tier-badge .tier-info .tier-friends {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.referral-card-header .arrow-icon {
    width: 20px;
    height: 20px;
    fill: rgba(255, 255, 255, 0.4);
}

.referral-card-stats {
    display: flex;
    gap: 16px;
}

.referral-card-stats .stat {
    flex: 1;
    text-align: center;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.referral-card-stats .stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #A78BFA;
}

.referral-card-stats .stat-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

/* Battery Info Button */
.battery-info-btn-small {
    background: rgba(139, 92, 246, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.5);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    color: #A78BFA;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-left: 4px;
}

.battery-info-btn-small:hover {
    background: rgba(139, 92, 246, 0.5);
    color: #fff;
}

/* Battery Info Modal */
.battery-info-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.battery-info-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.battery-info-modal {
    background: linear-gradient(145deg, #1a1a3e, #0f0f23);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 24px;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.battery-info-modal-overlay.active .battery-info-modal {
    transform: scale(1);
}

.battery-info-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
}

.battery-info-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.battery-info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.battery-info-icon {
    font-size: 40px;
}

.battery-info-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.battery-info-section {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
}

.battery-info-section h3 {
    font-size: 15px;
    font-weight: 700;
    color: #A78BFA;
    margin: 0 0 8px 0;
}

.battery-info-section p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.battery-info-section ul {
    margin: 0;
    padding-left: 18px;
}

.battery-info-section li {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
    line-height: 1.4;
}

.battery-info-section li strong {
    color: #EC4899;
}

.battery-info-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.battery-info-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}
