/* Gamification Elements */

.gamification-panel {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
    border: 1px solid #0f3460;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.score-display {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.score-item i {
    font-size: 20px;
    margin-bottom: 4px;
    color: var(--accent-color);
}

.score-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.score-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.achievement-badge {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #1a1a2e;
    padding: 8px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    animation: achievementPop 0.5s ease-out;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.achievement-badge i {
    color: #1a1a2e;
}

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

.mission-status {
    background: linear-gradient(135deg, #0f3460 0%, #1a1a2e 100%);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid #0f3460;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.status-indicator i {
    color: #4ade80;
    animation: pulse 2s infinite;
}

.status-indicator.mission-ready i {
    color: #4ade80;
}

.status-indicator.mission-active i {
    color: #f59e0b;
}

.status-indicator.mission-success i {
    color: #10b981;
}

.status-indicator.mission-failed i {
    color: #ef4444;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.defense-readiness {
    margin-top: 12px;
}

.readiness-bar {
    background: var(--bg-tertiary);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.readiness-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #10b981 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.readiness-text {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Button groups organization */
.button-group {
    margin-bottom: 20px;
}

.button-group button {
    display: block;
    width: 100%;
    margin-bottom: 8px;
}

.button-group button:last-child {
    margin-bottom: 0;
}

/* Ensure buttons stack vertically within each group */
.button-group > * {
    display: block;
}

.button-group h4 {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.button-group h4 i {
    color: var(--accent-color);
    font-size: 12px;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.button-group {
    display: flex;
    flex-direction: column;
}

/* Defense Strategy button full width */
.control-section button {
    width: 100%;
    margin-top: 12px;
}

/* Mission Actions and Controls buttons - one below the other */
.action-buttons .button-group {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
}

.action-buttons .button-group button {
    width: 100%;
    margin-bottom: 8px;
    display: block;
    box-sizing: border-box;
}

.action-buttons .button-group button:last-child {
    margin-bottom: 0;
}

/* Ensure all buttons in action-buttons are stacked vertically */
.action-buttons .button-group > * {
    display: block;
    width: 100%;
}

/* Enhanced button styles for gamification */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    width: 100%;
    display: block;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
    width: 100%;
    display: block;
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(107, 114, 128, 0.4);
}

.btn-secondary:disabled,
.btn-secondary.disabled {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

.btn-secondary:disabled:hover,
.btn-secondary.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Defense strategy button enhancements */
.defense-strategy-btn {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
    margin-bottom: 8px;
}

.defense-strategy-btn:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.defense-strategy-btn.active {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.defense-strategy-btn i {
    font-size: 24px;
    color: var(--accent-color);
    margin-right: 12px;
}

.strategy-name {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.strategy-desc {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Enhanced stat cards */
.stat-card {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-color);
}

.stat-icon {
    background: linear-gradient(135deg, var(--accent-color) 0%, #1e40af 100%);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.stat-icon i {
    color: white;
    font-size: 18px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.stat-description {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Loading animation for mission status */
.loading-mission {
    animation: missionLoading 2s ease-in-out infinite;
}

@keyframes missionLoading {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Success animation */
.mission-success-animation {
    animation: missionSuccess 1s ease-out;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .score-display {
        flex-direction: column;
        gap: 12px;
    }
    
    .score-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .gamification-panel {
        padding: 12px;
    }
}
