/* doYourSideProject - Custom Styles */

/* Theme CSS Variables */
:root {
    /* Dark theme (default) */
    --bg: #0f0f0f;
    --card: #1a1a1a;
    --border: #2a2a2a;
    --text: #e5e5e5;
    --muted: #888888;
    --input-bg: #0f0f0f;
}

/* Light theme */
body:not(.dark) {
    --bg: #f5f5f5;
    --card: #ffffff;
    --border: #e0e0e0;
    --text: #1a1a1a;
    --muted: #666666;
    --input-bg: #ffffff;
}

/* Base styles */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme utility classes */
.bg-theme { background-color: var(--bg); }
.bg-theme-card { background-color: var(--card); }
.border-theme { border-color: var(--border); }
.text-theme { color: var(--text); }
.text-theme-muted { color: var(--muted); }
.footer-bg { background-color: var(--card); }

/* Override Tailwind dark colors in light mode */
body:not(.dark) .bg-dark-bg { background-color: var(--bg); }
body:not(.dark) .bg-dark-card { background-color: var(--card); }
body:not(.dark) .border-dark-border { border-color: var(--border); }
body:not(.dark) .text-dark-text { color: var(--text); }
body:not(.dark) .text-dark-muted { color: var(--muted); }
body:not(.dark) .hover\:text-white:hover { color: var(--text); }
body:not(.dark) .bg-dark-border { background-color: #e0e0e0; }

/* Input fields in light mode */
body:not(.dark) input,
body:not(.dark) select {
    background-color: var(--input-bg);
    border-color: var(--border);
    color: var(--text);
}

body:not(.dark) input::placeholder {
    color: var(--muted);
}

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

.dark ::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.dark ::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

body:not(.dark) ::-webkit-scrollbar-track {
    background: #f0f0f0;
}

body:not(.dark) ::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 4px;
}

body:not(.dark) ::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* Probability cards */
.probability-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.probability-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.probability-red {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    border-color: #dc2626;
}

.probability-yellow {
    background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
    border-color: #f59e0b;
}

.probability-green {
    background: linear-gradient(135deg, #14532d 0%, #166534 100%);
    border-color: #22c55e;
}

/* Streak badge animation */
.streak-badge {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(251, 191, 36, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
    }
}

/* Check-in buttons */
.checkin-btn {
    transition: all 0.2s ease;
}

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

.checkin-btn-yes {
    background: linear-gradient(135deg, #166534 0%, #15803d 100%);
}

.checkin-btn-yes:hover {
    background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
}

.checkin-btn-no {
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
}

.checkin-btn-no:hover {
    background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%);
}

.checkin-btn-selected {
    ring: 2px;
    ring-offset: 2px;
}

/* Hour slider */
.hour-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: #2a2a2a;
    border-radius: 4px;
    outline: none;
}

.hour-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
}

.hour-slider::-webkit-slider-thumb:hover {
    background: #2563eb;
}

.hour-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Milestone category headers */
.milestone-category {
    cursor: pointer;
    transition: background 0.2s ease;
}

.milestone-category:hover {
    background: rgba(255, 255, 255, 0.05);
}

.milestone-category-progress {
    transition: width 0.5s ease;
}

/* Milestone checkboxes */
.milestone-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #4b5563;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.milestone-checkbox:checked {
    background: #22c55e;
    border-color: #22c55e;
}

.milestone-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.milestone-checkbox:hover {
    border-color: #6b7280;
}

/* Session timer */
.timer-display {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', monospace;
    font-size: 2rem;
    letter-spacing: 0.05em;
}

.timer-running {
    animation: timer-pulse 1s ease-in-out infinite;
}

@keyframes timer-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Session list */
.session-item {
    transition: background 0.2s ease;
}

.session-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Fake ad styling */
.fake-ad {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border: 1px dashed #6366f1;
    position: relative;
    overflow: hidden;
}

.fake-ad::before {
    content: 'AD';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

.fake-ad-btn {
    transition: all 0.2s ease;
}

.fake-ad-btn:hover {
    transform: scale(1.02);
}

/* Heatmap cell */
.heatmap-cell {
    transition: transform 0.1s ease;
}

.heatmap-cell:hover {
    transform: scale(1.2);
    z-index: 10;
}

/* Modal animations */
.modal-enter {
    animation: modal-fade-in 0.3s ease;
}

@keyframes modal-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Confetti (for future celebration mode) */
.confetti {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    padding: 12px 20px;
    border-radius: 8px;
    animation: toast-slide-in 0.3s ease;
    z-index: 100;
}

@keyframes toast-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Chart.js custom styling */
.chart-container {
    position: relative;
    height: 200px;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .probability-card {
        padding: 1rem;
    }

    .timer-display {
        font-size: 1.5rem;
    }

    .milestone-checkbox {
        width: 24px;
        height: 24px;
    }
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Focus states for accessibility */
button:focus-visible,
input:focus-visible,
.milestone-checkbox:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Collapsible sections */
.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.collapsible-content.expanded {
    max-height: 1000px;
}

/* Chevron rotation for collapsible */
.chevron {
    transition: transform 0.3s ease;
}

.chevron.rotated {
    transform: rotate(180deg);
}

/* Mascot - centered at bottom of page */
#mascot {
    width: 80px;
    height: 80px;
    pointer-events: auto;
    cursor: pointer;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

#mascot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

/* Subtle peek up when mouse is close */
#mascot.mascot-visible {
    transform: translateY(-8px);
}

/* Default resting state */
#mascot.mascot-hiding {
    transform: translateY(0);
}

/* Mascot mood states - different glow colors */
#mascot.mascot-ecstatic img {
    filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.6));
}

#mascot.mascot-happy img {
    filter: drop-shadow(0 0 6px rgba(132, 204, 22, 0.5));
}

#mascot.mascot-content img {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

#mascot.mascot-hungry img {
    filter: drop-shadow(0 0 6px rgba(249, 115, 22, 0.4));
}

#mascot.mascot-starving img {
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.5));
    animation: mascot-sad 2s ease-in-out infinite;
}

@keyframes mascot-sad {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

/* Mascot fed animation */
#mascot.mascot-fed {
    animation: mascot-happy-bounce 0.5s ease-out;
}

@keyframes mascot-happy-bounce {
    0% { transform: scale(1) translateY(0); }
    30% { transform: scale(1.1) translateY(-5px); }
    50% { transform: scale(1) translateY(0) rotate(3deg); }
    70% { transform: scale(1) translateY(0) rotate(-3deg); }
    100% { transform: scale(1) translateY(0) rotate(0); }
}

/* Status panel styling for light mode */
body:not(.dark) #mascot-status-panel {
    background-color: var(--card);
    border-color: var(--border);
}

body:not(.dark) #mascot-status-panel .bg-dark-bg {
    background-color: var(--bg);
}

body:not(.dark) #mascot-status-panel .bg-dark-border {
    background-color: var(--border);
}

body:not(.dark) #mascot-status-panel .text-dark-muted {
    color: var(--muted);
}

body:not(.dark) #mascot-status-panel .border-dark-border {
    border-color: var(--border);
}
