/* ProcessFlow — Gradient Cards 2025 */
/* MOKADI Market Budowlany */

:root {
    --bg: #494949;
    --bg-deep: #3b3b3b;
    --t1: #f1f5f9;
    --t2: rgba(241, 245, 249, 0.65);
    --t3: rgba(241, 245, 249, 0.38);
    --radius: 18px;
    --tr: 0.25s ease;
}

/* ── THEME TOGGLE BUTTON ── */
.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all var(--tr);
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1) rotate(20deg);
}

/* ── LIGHT THEME ── */
body.light-theme {
    --bg: #f0f4f8;
    --bg-deep: #e2e8f0;
    --t1: #0f172a;
    --t2: rgba(15, 23, 42, 0.7);
    --t3: rgba(15, 23, 42, 0.45);
}

body.light-theme .gradient-background {
    background:
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 110%, rgba(20, 184, 166, 0.06) 0%, transparent 55%),
        linear-gradient(180deg, #e2e8f0 0%, #f0f4f8 100%);
}

body.light-theme .main-header {
    background: rgba(240, 244, 248, 0.92);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .back-button,
body.light-theme .bell-button,
body.light-theme .theme-toggle,
body.light-theme .logout-button {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(15, 23, 42, 0.6);
}

body.light-theme .back-button:hover,
body.light-theme .bell-button:hover,
body.light-theme .theme-toggle:hover,
body.light-theme .logout-button:hover {
    background: rgba(0, 0, 0, 0.09);
    border-color: rgba(0, 0, 0, 0.18);
    color: #0f172a;
}

body.light-theme .header-user {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .user-name {
    color: #0f172a;
}

body.light-theme .brand-title {
    background: linear-gradient(135deg, #1e293b 30%, #64748b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0;
}

body.light-theme .page-title {
    background: linear-gradient(135deg, #1e293b 0%, #6366f1 60%, #14b8a6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.light-theme .level-title {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.light-theme .page-description {
    color: rgba(15, 23, 42, 0.5);
}

body.light-theme .search-input,
body.light-theme .filter-select {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.12);
    color: #0f172a;
}

body.light-theme .search-input::placeholder {
    color: rgba(15, 23, 42, 0.4);
}

body.light-theme .filter-select option {
    background: #fff;
}

body.light-theme .procedure-tile {
    filter: brightness(1.08) saturate(0.8);
}

body.light-theme .procedure-tile:hover {
    filter: brightness(1.14) saturate(1);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar {
    display: none;
    width: 0;
}

body {
    font-family: 'Segoe UI', 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--t1);
    line-height: 1.6;
    min-height: 100vh;
}

/* ── BACKGROUND — subtle deep gradient ── */
.gradient-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: #013004;
}

/* ──────────── PREMIUM HEADER ──────────── */
.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 72px;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(29, 43, 30, 0.96);
    /* #1D2B1E with 0.96 opacity */
    backdrop-filter: blur(24px) saturate(180%);
    border: none;
    /* no border-bottom — replaced by accent line */
}

/* Rainbow accent line below header */
.header-accent-line {
    position: sticky;
    top: 72px;
    z-index: 99;
    height: 2px;
    background: linear-gradient(90deg,
            #6366f1 0%,
            #14b8a6 25%,
            #f59e0b 50%,
            #e11d48 75%,
            #6366f1 100%);
    background-size: 200% 100%;
    animation: accentShift 6s linear infinite;
    opacity: 0.8;
}

@keyframes accentShift {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 200% 0%;
    }
}

/* ── ZONE LEFT ── */
.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.mokadi-logo-link {
    display: flex;
    align-items: center;
    opacity: 0.9;
    transition: opacity var(--tr), filter var(--tr);
}

.mokadi-logo-link:hover {
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

.mokadi-logo {
    height: 30px;
    width: auto;
    object-fit: contain;
}

.header-left-sep {
    width: 1px;
    height: 28px;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    flex-shrink: 0;
}

/* ── ZONE CENTER ── */
.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.processflow-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    filter: brightness(0.95);
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #f1f5f9 20%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.72rem;
    color: var(--t3);
    letter-spacing: 0.3px;
}

/* ── BACK BUTTON ── */
.back-button {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 9px;
    color: var(--t2);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.04);
    transition: all var(--tr);
    white-space: nowrap;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--t1);
    transform: translateX(-2px);
}

/* User info section */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-divider {
    width: 1px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 4px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    padding: 6px 10px 6px 6px;
    transition: all var(--tr);
}

.header-user:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #14b8a6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--t1);
    max-width: 200px;
    white-space: nowrap;
    line-height: 1.2;
}

.user-status {
    font-size: 0.7rem;
    color: #34d399;
    font-weight: 500;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 5px #34d399;
    flex-shrink: 0;
}

.logout-button {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--t3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--tr);
    flex-shrink: 0;
    margin-left: 2px;
}

.logout-button:hover {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.35);
    color: #f87171;
    transform: scale(1.05);
}

/* ── BELL BUTTON ── */
.bell-button {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: var(--t3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--tr);
    flex-shrink: 0;
}

.bell-button:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--t1);
}

/* Active state — when there are pending items */
.bell-button.bell-active {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.25);
    animation: bellShake 3s ease-in-out 1s infinite;
}

.bell-button.bell-active:hover {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.4);
    box-shadow: 0 0 14px rgba(251, 191, 36, 0.2);
}

/* Badge dot */
.bell-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #f59e0b;
    color: #000;
    font-size: 0.65rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid rgba(9, 11, 16, 0.9);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.7), 0 0 20px rgba(245, 158, 11, 0.3);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(245, 158, 11, 0.7), 0 0 16px rgba(245, 158, 11, 0.3);
    }

    50% {
        box-shadow: 0 0 14px rgba(245, 158, 11, 0.9), 0 0 28px rgba(245, 158, 11, 0.5);
    }
}

@keyframes bellShake {

    0%,
    85%,
    100% {
        transform: rotate(0deg);
    }

    87% {
        transform: rotate(-12deg);
    }

    89% {
        transform: rotate(12deg);
    }

    91% {
        transform: rotate(-8deg);
    }

    93% {
        transform: rotate(8deg);
    }

    95% {
        transform: rotate(-4deg);
    }

    97% {
        transform: rotate(4deg);
    }

    99% {
        transform: rotate(0deg);
    }
}

/* ── CONTAINER ── */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
}

/* ── PAGE HEADER ── */
.page-header {
    text-align: center;
    margin-bottom: 2.5rem;
    animation: fadeDown 0.4s ease;
}

.page-title {
    font-size: 2.6rem;
    font-weight: 300;
    letter-spacing: -1px;
    /* vivid gradient text title */
    background: linear-gradient(135deg, #e2e8f0 0%, #6366f1 60%, #14b8a6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.4rem;
}

.page-description {
    font-size: 0.98rem;
    color: var(--t3);
}

/* ── CONTROLS ── */
.controls-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    animation: fadeUp 0.4s ease 0.06s backwards;
}

.search-input,
.filter-select {
    padding: 11px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--t1);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: all var(--tr);
}

.search-input {
    flex: 1;
    min-width: 260px;
}

.search-input::placeholder {
    color: var(--t3);
}

.filter-select {
    min-width: 165px;
    cursor: pointer;
}

.filter-select option {
    background: #1a1d27;
}

.search-input:focus,
.filter-select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ── GRID ── */
.tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 20px;
    animation: fadeUp 0.4s ease 0.12s backwards;
}

/* ── TILE — THE STAR ── */
.procedure-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 195px;
    padding: 22px 22px 18px;
    /* gradient bg set per-category via inline style */
    background: var(--tile-bg, linear-gradient(145deg, #1e2030, #161825));
    /* Hairline border in tile's category color */
    border: 1px solid var(--tile-border-color, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    color: var(--t1);
    transition: transform var(--tr), box-shadow var(--tr), filter var(--tr), border-color var(--tr);
    overflow: hidden;
    /* colored glow shadow matching the card */
    box-shadow: 0 4px 24px var(--tile-shadow, rgba(0, 0, 0, 0.4)),
        0 1px 0 rgba(255, 255, 255, 0.04) inset;
    filter: brightness(0.9);
}

/* Sheen — top edge highlight */
.procedure-tile::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    background: linear-gradient(160deg,
            rgba(255, 255, 255, 0.08) 0%,
            rgba(255, 255, 255, 0.02) 30%,
            transparent 60%);
    pointer-events: none;
}

/* Bottom-right subtle glow blob */
.procedure-tile::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -20%;
    width: 60%;
    height: 60%;
    border-radius: 50%;
    background: var(--tile-glow, rgba(0, 0, 0, 0.2));
    filter: blur(40px);
    pointer-events: none;
}

.procedure-tile:hover {
    transform: translateY(-6px) scale(1.01);
    border-color: var(--tile-border-hover, rgba(255, 255, 255, 0.2));
    box-shadow: 0 20px 50px var(--tile-shadow, rgba(0, 0, 0, 0.5)),
        0 1px 0 rgba(255, 255, 255, 0.08) inset;
    filter: brightness(1.0);
}

/* ── TILE HEADER ── */
.tile-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
}

/* icon box — frosted on colored bg */
.tile-icon {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--tr), border-color var(--tr);
    backdrop-filter: blur(8px);
}

.procedure-tile:hover .tile-icon {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.25);
}

.tile-icon svg {
    width: 22px;
    height: 22px;
    fill: #fff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.tile-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
    letter-spacing: -0.2px;
}

.tile-description {
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.55;
    flex: 1;
}

/* ── TILE FOOTER ── */
.tile-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: #fff;
    backdrop-filter: blur(8px);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--status-color, rgba(255, 255, 255, 0.3));
    box-shadow: 0 0 6px var(--status-color, rgba(255, 255, 255, 0.3));
}

/* ── EMPTY STATE ── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--t2);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1.2rem;
    opacity: 0.2;
}

.empty-state h3 {
    font-size: 1.3rem;
    font-weight: 400;
    margin-bottom: 0.4rem;
}

.empty-state p {
    font-size: 0.9rem;
    color: var(--t3);
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .main-header {
        padding: 0 1.25rem;
        height: 62px;
    }

    .brand-subtitle {
        display: none;
    }

    .page-title {
        font-size: 2rem;
    }

    .controls-bar {
        flex-direction: column;
    }

    .search-input,
    .filter-select {
        width: 100%;
        min-width: unset;
    }

    .tiles-grid {
        gap: 14px;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .container {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 600px) {
    .tiles-grid {
        grid-template-columns: 1fr 1fr;
    }

    .procedure-tile {
        min-height: 170px;
        padding: 16px 16px 13px;
    }

    .tile-title {
        font-size: 0.92rem;
    }

    .tile-description {
        font-size: 0.79rem;
    }
}