
/* Live Goals Floating Widget */
.live-goals-floating {
    width: 100%;
    z-index: 1060;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Toggle Button */
#live-goals-widget{
    top: 105px;
    margin-top: 10px;
}
@media screen and (max-width: 768px) {
    #live-goals-widget{
    top: 105px;
    margin-top: 10px;
    }
}
.goals-toggle-btn {
    background: linear-gradient(to bottom right, rgba(212, 190, 254, 1), rgba(110, 33, 244, 1));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.goals-toggle-btn:hover {
  transform: scale(1.12) rotate(5deg); /* Hover transform from character-create-icon */
  box-shadow: 0 15px 30px rgba(110, 32, 244, 0.15); /* Hover shadow similar to character-create-card */
}

.goals-toggle-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.6s;
    opacity: 0;
}

.goals-toggle-btn:hover::before {
    animation: shine 1.5s infinite;
}

.goals-toggle-btn:hover {
    box-shadow: 0 6px 25px rgba(0, 123, 255, 0.4);
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); opacity: 0; }
}

.goals-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
}

.goals-trophy-icon {
    font-size: 16px;
    margin-bottom: 2px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.goals-quick-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.goals-total-progress {
    font-size: 10px;
    font-weight: 700;
    opacity: 0.9;
}

.goals-next-reward {
    font-size: 8px;
    font-weight: 600;
    background: rgba(255, 193, 7, 0.9);
    color: #000;
    padding: 1px 4px;
    border-radius: 6px;
    margin-top: 1px;
}

/* Expanded Panel */
.goals-expanded-panel {
    position: absolute;
    left: 110px;
    top: 150%;
    transform: translateY(-50%);
    width: 280px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%) translateX(20px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.goals-expanded-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(-18%) translateX(-14%) scale(1);
}

.goals-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.goals-panel-title {
    font-size: 14px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.goals-close-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: #6c757d;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.goals-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #495057;
}

/* Goals Grid */
.goals-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.goal-item-compact {
    display: flex;
    align-items: center;
    padding: 12px;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.goal-item-compact:hover {
    background: rgba(240, 242, 245, 0.9);
    transform: translateX(4px);
}

.goal-item-compact.completed {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.15), rgba(40, 167, 69, 0.05));
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.goal-item-compact.near-completion {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(255, 193, 7, 0.05));
    border: 1px solid rgba(255, 193, 7, 0.3);
}

/* Progress Ring */
.goal-progress-ring {
    position: relative;
    margin-right: 12px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-progress {
    transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.goal-icon-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.goal-icon-ring i {
    font-size: 12px;
    font-weight: 600;
}

#goal-messages .goal-icon-ring i {
    color: #007bff;
}

#goal-images .goal-icon-ring i {
    color: #28a745;
}

#goal-videos .goal-icon-ring i {
    color: #dc3545;
}

/* Goal Details */
.goal-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.goal-count {
    font-size: 14px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

.goal-label {
    font-size: 11px;
    font-weight: 500;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.goal-reward {
    font-size: 10px;
    font-weight: 600;
    color: #f39c12;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 193, 7, 0.1));
    padding: 2px 6px;
    border-radius: 8px;
    border: 1px solid rgba(255, 193, 7, 0.3);
    align-self: flex-start;
    margin-top: 2px;
}

.goal-item-compact.completed .goal-reward {
    color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.2), rgba(40, 167, 69, 0.1));
    border-color: rgba(40, 167, 69, 0.3);
}

.goal-item-compact.completed .goal-count {
    color: #28a745;
}

/* Achievement Notification */
.achievement-notification {
    position: absolute;
    top: -60px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #28a745, #20c997);
    border-radius: 12px;
    padding: 12px;
    color: white;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.3);
}

.achievement-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.achievement-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.achievement-icon {
    font-size: 20px;
    animation: trophy-bounce 0.6s ease-in-out;
}

@keyframes trophy-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

.achievement-text {
    flex: 1;
}

.achievement-title {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.achievement-subtitle {
    font-size: 10px;
    opacity: 0.9;
    line-height: 1.2;
}

/* Updating Animation */
.goal-item-compact.updating {
    animation: goal-update-pulse 0.6s ease;
}

@keyframes goal-update-pulse {
    0% { transform: translateX(0) scale(1); }
    50% { transform: translateX(4px) scale(1.02); background: rgba(0, 123, 255, 0.1); }
    100% { transform: translateX(0) scale(1); }
}

/* Toggle Button Pulse */
.goals-toggle-btn.pulse {
    animation: button-pulse 0.6s ease;
}

@keyframes button-pulse {
    0% { transform: translateY(-50%) scale(1); box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3); }
    50% { transform: translateY(-50%) scale(1.1); box-shadow: 0 6px 30px rgba(0, 123, 255, 0.5); }
    100% { transform: translateY(-50%) scale(1); box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    
    .goals-trophy-icon {
        font-size: 14px;
    }
    
    .goals-total-progress {
        font-size: 9px;
    }
    
    .goals-next-reward {
        font-size: 7px;
    }
    
    .goals-expanded-panel {
        width: 250px;
        right: 60px;
        padding: 12px;
    }
    
    .goal-item-compact {
        padding: 10px;
    }
    
    .goal-progress-ring {
        margin-right: 10px;
    }
    
    .progress-ring {
        width: 50px;
        height: 50px;
    }
    
    .progress-ring circle {
        r: 16;
        cx: 20;
        cy: 20;
    }
    
    .goal-icon-ring {
        width: 20px;
        height: 20px;
    }
    
    .goal-icon-ring i {
        font-size: 10px;
    }
    
    .goal-count {
        font-size: 12px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .goals-expanded-panel {
        background: rgba(33, 37, 41, 0.98);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .goals-panel-title {
        color: #f8f9fa;
    }
    
    .goal-item-compact {
        background: rgba(255, 255, 255, 0.05);
    }
    
    .goal-item-compact:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .goal-count {
        color: #f8f9fa;
    }
    
    .goal-label {
        color: #adb5bd;
    }
    
    .goal-icon-ring {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Milestone Goals Styling */
.milestone-goals-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .milestone-goals-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

.milestone-goal-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.95));
    border: 2px solid rgba(13, 110, 253, 0.15) !important;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.milestone-goal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: rgba(13, 110, 253, 0.3) !important;
}

.milestone-goal-card .progress {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.milestone-goal-card .progress-bar {
    transition: width 0.6s ease;
    border-radius: 10px;
}

.milestone-goal-card h6 {
    font-weight: 600;
    color: #2c3e50;
}

/* Completed Milestones Styling */
.milestone-card.completed {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 255, 255, 0.9));
    border-left: 4px solid #ffc107 !important;
    transition: all 0.2s ease;
}

.milestone-card.completed:hover {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 255, 255, 1));
    transform: translateX(3px);
}

/* Goals Section Headers */
.milestone-goals-section h5,
.completed-milestones-section h5 {
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.95rem;
}

/* Badge Styling */
.milestone-goal-card .badge {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.4em 0.8em;
}

/* Icon Styling */
.milestone-goal-card i[class*="bi-"] {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Responsive Design */
@media (max-width: 767px) {
    .milestone-goals-grid {
        grid-template-columns: 1fr;
    }
    
    .milestone-goal-card {
        margin-bottom: 0.75rem;
    }
}

/* Animation for completed milestones */
.milestone-card.completed {
    animation: slideInFromLeft 0.5s ease-out;
}

@keyframes slideInFromLeft {
    0% {
        transform: translateX(-20px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading animation for progress bars */
.progress-bar {
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 2s infinite;
}

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

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .milestone-goal-card {
        background: linear-gradient(135deg, rgba(33, 37, 41, 0.95), rgba(52, 58, 64, 0.95));
        border-color: rgba(108, 117, 125, 0.3) !important;
    }
    
    .milestone-goal-card h6 {
        color: #f8f9fa;
    }
    
    .milestone-card.completed {
        background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(33, 37, 41, 0.95));
    }
}