*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: var(--ws-font-size);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    font-family: var(--ws-font-family);
    font-size: var(--ws-font-size);
    line-height: var(--ws-line-height);
    color: var(--ws-text);
    background: var(--ws-bg);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

body.ws-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--ws-bg);
}

.ws-main {
    flex: 1 0 auto;
    max-width: var(--ws-content-max);
    width: 100%;
    margin: 0 auto;
    padding: 22px var(--ws-spacing) 12px;
}

/* ─── Notification stack (3D toasts) ─── */
.ws-notify-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(400px, calc(100vw - 32px));
    pointer-events: none;
    perspective: 1200px;
}

.ws-notify {
    position: relative;
    pointer-events: auto;
    border-radius: 18px;
    overflow: hidden;
    opacity: 0;
    transform: perspective(900px) rotateY(16deg) translateX(36px) scale(0.92);
    transform-origin: right center;
    transition:
        opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow:
        0 24px 48px rgba(15, 23, 42, 0.18),
        0 10px 20px rgba(15, 23, 42, 0.1),
        0 2px 0 rgba(255, 255, 255, 0.92) inset,
        0 -2px 0 rgba(15, 23, 42, 0.05) inset;
}

.ws-notify.is-visible {
    opacity: 1;
    transform: perspective(900px) rotateY(0deg) translateX(0) scale(1);
}

.ws-notify.is-leaving {
    opacity: 0;
    transform: perspective(900px) rotateY(-10deg) translateX(28px) scale(0.94);
}

.ws-notify-glow {
    position: absolute;
    inset: 0;
    opacity: 0.42;
    pointer-events: none;
}

.ws-notify-success .ws-notify-glow {
    background: radial-gradient(circle at 18% 28%, rgba(34, 197, 94, 0.42) 0%, transparent 58%);
}

.ws-notify-warning .ws-notify-glow {
    background: radial-gradient(circle at 18% 28%, rgba(245, 158, 11, 0.45) 0%, transparent 58%);
}

.ws-notify-danger .ws-notify-glow,
.ws-notify-error .ws-notify-glow {
    background: radial-gradient(circle at 18% 28%, rgba(239, 68, 68, 0.42) 0%, transparent 58%);
}

.ws-notify-accent {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 5px;
    z-index: 2;
    pointer-events: none;
}

.ws-notify-success .ws-notify-accent {
    background: linear-gradient(180deg, #4ade80, #16a34a);
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.45);
}

.ws-notify-warning .ws-notify-accent {
    background: linear-gradient(180deg, #fbbf24, #d97706);
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.45);
}

.ws-notify-danger .ws-notify-accent,
.ws-notify-error .ws-notify-accent {
    background: linear-gradient(180deg, #f87171, #dc2626);
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.45);
}

.ws-notify-body {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 16px 16px 20px;
    background: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(255, 255, 255, 0.95);
}

.ws-notify-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    box-shadow:
        0 12px 22px rgba(15, 23, 42, 0.2),
        0 3px 0 rgba(255, 255, 255, 0.35) inset,
        0 -4px 8px rgba(0, 0, 0, 0.14) inset;
    transform: translateZ(10px);
}

.ws-notify-success .ws-notify-icon {
    background: linear-gradient(145deg, #4ade80 0%, #16a34a 55%, #15803d 100%);
}

.ws-notify-warning .ws-notify-icon {
    background: linear-gradient(145deg, #fbbf24 0%, #f59e0b 55%, #d97706 100%);
}

.ws-notify-danger .ws-notify-icon,
.ws-notify-error .ws-notify-icon {
    background: linear-gradient(145deg, #f87171 0%, #ef4444 55%, #dc2626 100%);
}

.ws-notify-content {
    flex: 1;
    min-width: 0;
}

.ws-notify-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.ws-notify-success .ws-notify-label { color: #15803d; }
.ws-notify-warning .ws-notify-label { color: #b45309; }
.ws-notify-danger .ws-notify-label,
.ws-notify-error .ws-notify-label { color: #b91c1c; }

.ws-notify-message {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ws-slate-900);
    line-height: 1.45;
}

.ws-notify-close {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 11px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--ws-slate-500);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.ws-notify-close:hover {
    background: rgba(15, 23, 42, 0.1);
    color: var(--ws-slate-900);
    transform: scale(1.06);
}

.ws-notify-progress {
    height: 4px;
    background: rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.ws-notify-progress span {
    display: block;
    height: 100%;
    width: 100%;
    transform-origin: left center;
    transform: scaleX(1);
    animation: wsNotifyProgress linear forwards;
}

.ws-notify-success .ws-notify-progress span {
    background: linear-gradient(90deg, #4ade80, #16a34a);
}

.ws-notify-warning .ws-notify-progress span {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.ws-notify-danger .ws-notify-progress span,
.ws-notify-error .ws-notify-progress span {
    background: linear-gradient(90deg, #f87171, #ef4444);
}

@keyframes wsNotifyProgress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

@media (max-width: 480px) {
    .ws-notify-stack {
        top: 14px;
        right: 14px;
        left: 14px;
        width: auto;
    }

    .ws-notify {
        transform: perspective(900px) rotateX(-14deg) translateY(-20px) scale(0.92);
        transform-origin: top center;
    }

    .ws-notify.is-visible {
        transform: perspective(900px) rotateX(0deg) translateY(0) scale(1);
    }

    .ws-notify.is-leaving {
        transform: perspective(900px) rotateX(10deg) translateY(-14px) scale(0.94);
    }
}

/* Scrollbar styling */
.ws-boardbar-scroll::-webkit-scrollbar {
    height: 4px;
}

.ws-boardbar-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.ws-boardbar-scroll::-webkit-scrollbar-thumb {
    background: var(--ws-slate-300);
    border-radius: var(--ws-radius-full);
}
