/* Custom styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* Smooth transitions */
.transition-all {
    transition: all 0.2s ease-in-out;
}

/* Navigation active state */
.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    border-left: 4px solid white;
}

.nav-link {
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Custom checkbox - larger for better touch */
input[type="checkbox"] {
    cursor: pointer;
    transition: all 0.2s ease;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    flex-shrink: 0;
    appearance: auto;
    -webkit-appearance: checkbox;
}

/* Ensure checkbox + text alignment in flex containers */
.flex.items-center input[type="checkbox"] + span,
.flex.items-center input[type="checkbox"] ~ span {
    margin-left: 0.5rem;
}

input[type="checkbox"]:checked {
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M5.707 7.293a1 1 0 0 0-1.414 1.414l2 2a1 1 0 0 0 1.414 0l4-4a1 1 0 0 0-1.414-1.414L7 8.586 5.707 7.293z'/%3e%3c/svg%3e");
    border-color: transparent;
    background-color: currentColor;
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

/* Animation for task completion */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateY(-20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

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

.task-item {
    animation: fadeIn 0.3s ease-out forwards;
}

.view-container {
    animation: slideIn 0.3s ease-out;
}

/* Achievement toast animation */
@keyframes bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

#achievement-toast.scale-100 {
    animation: bounce 0.5s ease-in-out;
}

/* Hover effects */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Button styles */
button {
    transition: all 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

/* Responsive design */
@media (max-width: 768px) {
    .ml-64 {
        margin-left: 0 !important;
    }
}

/* Drag and Drop Styles */
.draggable-item {
    cursor: move;
    transition: all 0.2s ease;
}

.draggable-item:hover {
    transform: scale(1.02);
}

.draggable-item.dragging {
    opacity: 0.4;
    cursor: grabbing;
}

.draggable-item.drag-over {
    border: 3px dashed #fbbf24 !important;
    background: rgba(251, 191, 36, 0.1);
    transform: scale(1.05);
}

.calendar-day.drag-over {
    background: rgba(251, 191, 36, 0.3) !important;
    border: 3px dashed #fbbf24 !important;
    transform: scale(1.1);
}

/* Drag handle icon */
.drag-handle {
    cursor: grab;
    opacity: 0.3;
    transition: opacity 0.2s;
}

.draggable-item:hover .drag-handle {
    opacity: 0.7;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Habit Heat Map Styles */
.habit-heatmap {
    background: rgba(255, 255, 255, 0.3);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.heatmap-cell {
    flex: 1;
    aspect-ratio: 1;
    border-radius: 3px;
    border: 1px solid rgba(217, 119, 6, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
    max-height: 28px;
}

.heatmap-cell:hover {
    transform: scale(1.3);
    border-color: rgba(217, 119, 6, 0.8);
    z-index: 10;
}

/* Heat map levels - amber/orange gradient */
.heatmap-cell.level-0 {
    background-color: rgba(254, 243, 199, 0.3);
}

.heatmap-cell.level-1 {
    background-color: rgba(252, 211, 77, 0.5);
}

.heatmap-cell.level-2 {
    background-color: rgba(251, 191, 36, 0.7);
}

.heatmap-cell.level-3 {
    background-color: rgba(245, 158, 11, 0.9);
}

/* Goal Tab Styles (Quest Planner) */
.goal-tab {
    color: rgba(217, 186, 130, 0.7);
    background: transparent;
}

.goal-tab:hover {
    color: rgba(252, 211, 77, 1);
    background: rgba(255, 255, 255, 0.08);
}

.goal-tab.active-goal-tab {
    color: #fef3c7;
    background: rgba(217, 119, 6, 0.35);
    border: 1px solid rgba(217, 119, 6, 0.5);
    box-shadow: 0 0 12px rgba(217, 119, 6, 0.15);
}

.goal-tab-content {
    animation: fadeIn 0.2s ease-out;
}

/* Daily Tab Styles (Daily Quests) */
.daily-tab {
    color: rgba(217, 186, 130, 0.7);
    background: transparent;
}

.daily-tab:hover {
    color: rgba(252, 211, 77, 1);
    background: rgba(255, 255, 255, 0.08);
}

.daily-tab.active-daily-tab {
    color: #fef3c7;
    background: rgba(234, 88, 12, 0.35);
    border: 1px solid rgba(234, 88, 12, 0.5);
    box-shadow: 0 0 12px rgba(234, 88, 12, 0.15);
}

.daily-tab-content {
    animation: fadeIn 0.2s ease-out;
}

/* Arcane Tab Styles (Arcane Powers) */
.arcane-tab {
    color: rgba(200, 170, 230, 0.7);
    background: transparent;
}

.arcane-tab:hover {
    color: rgba(216, 180, 254, 1);
    background: rgba(255, 255, 255, 0.08);
}

.arcane-tab.active-arcane-tab {
    color: #e9d5ff;
    background: rgba(147, 51, 234, 0.35);
    border: 1px solid rgba(147, 51, 234, 0.5);
    box-shadow: 0 0 12px rgba(147, 51, 234, 0.15);
}

.arcane-tab-content {
    animation: fadeIn 0.2s ease-out;
}

/* Floating XP Toast Bar */
.xp-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    z-index: 9999;
    width: min(360px, calc(100vw - 32px));
    background: linear-gradient(135deg, rgba(30, 20, 50, 0.95), rgba(45, 25, 70, 0.95));
    border: 1px solid rgba(147, 51, 234, 0.5);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(147, 51, 234, 0.2);
    backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.xp-toast.xp-toast-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.xp-toast.xp-toast-hiding {
    transform: translateX(-50%) translateY(120px);
    opacity: 0;
}

.xp-toast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.xp-toast-amount {
    font-size: 15px;
    font-weight: 700;
    color: #a78bfa;
    text-shadow: 0 0 8px rgba(167, 139, 250, 0.4);
}

.xp-toast-level {
    font-size: 12px;
    font-weight: 600;
    color: #d4d4d8;
}

.xp-toast-bar-bg {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.xp-toast-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed, #a78bfa, #c084fc);
    border-radius: 5px;
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    box-shadow: 0 0 8px rgba(167, 139, 250, 0.5);
}

.xp-toast-bar-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: xpShimmer 1.5s ease-in-out;
}

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

.xp-toast-xp-text {
    font-size: 11px;
    color: #a1a1aa;
    margin-top: 6px;
    text-align: right;
}

.xp-toast-levelup {
    animation: xpLevelUpPulse 0.6s ease-out;
    border-color: rgba(250, 204, 21, 0.7) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 30px rgba(250, 204, 21, 0.3) !important;
}

.xp-toast-levelup .xp-toast-bar-fill {
    background: linear-gradient(90deg, #eab308, #facc15, #fde047) !important;
    box-shadow: 0 0 12px rgba(250, 204, 21, 0.6) !important;
}

.xp-toast-levelup .xp-toast-amount {
    color: #facc15 !important;
    text-shadow: 0 0 10px rgba(250, 204, 21, 0.5) !important;
}

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

/* Player Panel */
#player-panel-toggle {
    transition: opacity 0.3s ease-in-out;
}

#player-panel-sheet {
    scrollbar-width: thin;
    scrollbar-color: rgba(147, 51, 234, 0.3) transparent;
}

#player-panel-sheet::-webkit-scrollbar {
    width: 6px;
}

#player-panel-sheet::-webkit-scrollbar-thumb {
    background: rgba(147, 51, 234, 0.3);
    border-radius: 3px;
}
