@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom Base Styles for FocusUL */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ambient Background Animation */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 1.5s ease;
}

.ambient-bg::before,
.ambient-bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.12;
    transition: all 4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ambient-bg::before {
    width: 80vw;
    height: 80vw;
    background: radial-gradient(circle, #00f0ff 0%, transparent 60%);
    top: -30vh;
    left: -20vw;
    animation: float1 25s infinite alternate ease-in-out;
}

.ambient-bg::after {
    width: 70vw;
    height: 70vw;
    background: radial-gradient(circle, #7c3aed 0%, transparent 60%);
    bottom: -20vh;
    right: -20vw;
    animation: float2 30s infinite alternate ease-in-out, pulse-glow 10s infinite alternate;
}

/* State: Deep Focus */
body.state-focus .ambient-bg::before {
    background: radial-gradient(circle, #00f0ff 0%, transparent 60%);
    opacity: 0.05;
    filter: blur(150px);
    animation-duration: 40s;
}

body.state-focus .ambient-bg::after {
    opacity: 0;
}

/* State: Break */
body.state-break .ambient-bg::before {
    background: radial-gradient(circle, #10b981 0%, transparent 60%);
    opacity: 0.15;
}

body.state-break .ambient-bg::after {
    background: radial-gradient(circle, #3b82f6 0%, transparent 60%);
    opacity: 0.15;
}

@keyframes float1 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(15vw, 10vh) scale(1.1);
    }
}

@keyframes float2 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(-15vw, -10vh) scale(1.2);
    }
}

@keyframes pulse-glow {
    0% {
        opacity: 0.08;
    }

    100% {
        opacity: 0.18;
    }
}

@layer utilities {
    .animate-pulse-slow {
        animation: pulse 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    }
}

/* Custom Checkbox for Tasks */
.task-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    position: relative;
    background: transparent;
}

.task-checkbox:hover {
    border-color: rgba(0, 240, 255, 0.5);
    background: rgba(0, 240, 255, 0.05);
}

.task-checkbox:checked {
    background-color: #00f0ff;
    border-color: #00f0ff;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.task-checkbox:checked::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 8px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    top: 2px;
}

/* Deep focus transition overrides */
body.state-focus main #app-container {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

body.state-focus #deep-focus-view {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Task Item Active Focus Glow */
.task-item.active-focus {
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.05) 0%, transparent 100%);
    border-left: 2px solid #00f0ff;
}

.task-item.active-focus .task-text {
    color: #00f0ff;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.task-item.completed .task-text {
    text-decoration: line-through;
    opacity: 0.4;
}

/* Input Focus Glow */
input:focus {
    box-shadow: inset 0 -1px 0 0 rgba(0, 240, 255, 0.5);
}

/* Base Scrollbar Styling (Webkit) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}