/* ============================================================
   DoomsDay App - Custom Styles
   Tailwind handles most styling; this covers gaps.
   ============================================================ */

/* ---- Dark-themed scrollbars ---- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1f2937; /* gray-800 */
}

::-webkit-scrollbar-thumb {
    background: #4b5563; /* gray-600 */
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6b7280; /* gray-500 */
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #4b5563 #1f2937;
}

/* ---- Tab content transitions ---- */
.tab-content {
    animation: tabFadeIn 0.2s ease-out;
}

.tab-content.hidden {
    display: none !important;
    animation: none;
}

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- "I Am Alive" pulse/glow animation ---- */
@keyframes aliveGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(34, 197, 94, 0.3),
                    0 0 15px rgba(34, 197, 94, 0.1);
    }
    50% {
        box-shadow: 0 0 12px rgba(34, 197, 94, 0.5),
                    0 0 30px rgba(34, 197, 94, 0.2);
    }
}

#alive-btn:not(:disabled) {
    animation: aliveGlow 2.5s ease-in-out infinite;
}

#alive-btn:not(:disabled):hover {
    animation: none;
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.5),
                0 0 40px rgba(34, 197, 94, 0.25);
}

/* ---- File upload drop zone ---- */
.drop-zone {
    border: 2px dashed #4b5563;
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    transition: border-color 0.2s, background-color 0.2s;
}

.drop-zone.drag-over {
    border-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.06);
}

/* ---- Toast notification ---- */
.toast {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    min-width: 280px;
    max-width: 480px;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
}

.toast.toast-success {
    background-color: rgba(22, 101, 52, 0.92);
    border: 1px solid #22c55e;
    color: #bbf7d0;
}

.toast.toast-error {
    background-color: rgba(127, 29, 29, 0.92);
    border: 1px solid #ef4444;
    color: #fecaca;
}

/* ---- Dark theme input polish ---- */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 0.5;
}

select {
    appearance: auto;
}

textarea {
    min-height: 4rem;
}

input::placeholder,
textarea::placeholder {
    color: #6b7280;
}

/* Autofill override for dark theme */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: #ffffff;
    -webkit-box-shadow: 0 0 0px 1000px #374151 inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* ---- Loading spinner ---- */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Misc polish ---- */
.email-card + .email-card {
    margin-top: 1rem;
}

/* Today highlight row in alive history */
.alive-today {
    background-color: rgba(34, 197, 94, 0.08);
}

/* Badge styling for alive/missed status */
.badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25rem;
}

.badge-alive {
    background-color: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.badge-missed {
    background-color: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* Log event status badges */
.badge-cancelled {
    background-color: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.badge-active {
    background-color: rgba(239, 68, 68, 0.25);
    color: #f87171;
    animation: activePulse 2s ease-in-out infinite;
}

.badge-completed {
    background-color: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

.badge-averted {
    background-color: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

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