/* ============================================================
   shadcn/ui — Modulario theme
   CSS variables + component styles presne podľa shadcn/ui
   (https://ui.shadcn.com/docs/components)
   Pridané Tailwind utility triedy s Modulario brand farbami.
   ============================================================ */

@layer base {
    :root {
        /* shadcn defaults (Neutral theme) — upravené na Modulario */
        --background: 0 0% 100%;
        --foreground: 0 0% 17.6%;                  /* #2D2D2D */

        --card: 0 0% 100%;
        --card-foreground: 0 0% 17.6%;

        --popover: 0 0% 100%;
        --popover-foreground: 0 0% 17.6%;

        /* Primary = Modulario dark (nie yellow — yellow používame ako accent/CTA) */
        --primary: 0 0% 17.6%;                     /* #2D2D2D */
        --primary-foreground: 0 0% 100%;

        --secondary: 0 0% 95.7%;                   /* #F4F4F4 */
        --secondary-foreground: 0 0% 17.6%;

        --muted: 0 0% 95.7%;
        --muted-foreground: 0 0% 44.3%;            /* #707071 */

        --accent: 40 80% 54%;                      /* #E8B22D (Modulario yellow) */
        --accent-foreground: 0 0% 17.6%;

        --destructive: 5 85% 45%;                  /* #D43711 */
        --destructive-foreground: 0 0% 100%;

        --border: 0 0% 84.7%;                      /* #D8D8D8 */
        --input: 0 0% 84.7%;
        --ring: 0 0% 17.6%;

        --radius: 0.5rem;
    }

    .dark {
        --background: 0 0% 13.3%;                  /* #222226 */
        --foreground: 0 0% 95.7%;

        --card: 0 0% 17.3%;                        /* #32333D */
        --card-foreground: 0 0% 95.7%;

        --popover: 0 0% 13.3%;
        --popover-foreground: 0 0% 95.7%;

        --primary: 0 0% 95.7%;
        --primary-foreground: 0 0% 17.6%;

        --secondary: 0 0% 21%;
        --secondary-foreground: 0 0% 95.7%;

        --muted: 0 0% 21%;
        --muted-foreground: 0 0% 63.9%;

        --accent: 40 80% 54%;
        --accent-foreground: 0 0% 17.6%;

        --destructive: 5 85% 45%;
        --destructive-foreground: 0 0% 100%;

        --border: 0 0% 25%;
        --input: 0 0% 25%;
        --ring: 0 0% 83.1%;
    }

    * { border-color: hsl(var(--border)); }

    body {
        background: hsl(var(--background));
        color: hsl(var(--foreground));
        font-feature-settings: "rlig" 1, "calt" 1;
    }
}

/* ============================================================
   COMPONENTS — triedy nasledujú shadcn/ui React component API
   ============================================================ */

/* ---------- Button ---------- */
.sh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    transition: all 0.15s ease;
    cursor: pointer;
    border: 1px solid transparent;
    outline: none;
}
.sh-btn:focus-visible { box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring) / 0.6); }
.sh-btn:disabled { opacity: 0.5; pointer-events: none; }
.sh-btn svg { flex-shrink: 0; pointer-events: none; }

/* Sizes */
.sh-btn-default { height: 2.5rem; padding: 0 1rem; }
.sh-btn-sm      { height: 2.25rem; padding: 0 0.75rem; font-size: 0.8125rem; }
.sh-btn-lg      { height: 2.75rem; padding: 0 1.5rem; font-size: 0.9375rem; }
.sh-btn-icon    { height: 2.5rem; width: 2.5rem; padding: 0; }
.sh-btn-icon-sm { height: 2.25rem; width: 2.25rem; padding: 0; }

/* Variants */
.sh-btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.sh-btn-primary:hover { background: hsl(var(--primary) / 0.9); }

.sh-btn-accent { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); font-weight: 600; }
.sh-btn-accent:hover { background: hsl(var(--accent) / 0.9); }

.sh-btn-destructive { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); }
.sh-btn-destructive:hover { background: hsl(var(--destructive) / 0.9); }

.sh-btn-outline {
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    border-color: hsl(var(--border));
}
.sh-btn-outline:hover { background: hsl(var(--secondary)); }

.sh-btn-secondary { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); }
.sh-btn-secondary:hover { background: hsl(var(--secondary) / 0.8); }

.sh-btn-ghost { background: transparent; color: hsl(var(--foreground)); }
.sh-btn-ghost:hover { background: hsl(var(--secondary)); }

.sh-btn-link { background: transparent; color: hsl(var(--foreground)); text-decoration: underline; text-underline-offset: 4px; }
.sh-btn-link:hover { text-decoration-thickness: 2px; }

.sh-btn-block { width: 100%; }

/* ---------- Input ---------- */
.sh-input {
    display: flex;
    width: 100%;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid hsl(var(--input));
    background: hsl(var(--background));
    font-size: 0.875rem;
    color: hsl(var(--foreground));
    outline: none;
    transition: all 0.15s ease;
}
.sh-input::placeholder { color: hsl(var(--muted-foreground)); }
.sh-input:focus-visible { border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.1); }
.sh-input:disabled { opacity: 0.5; cursor: not-allowed; }

/* Error state */
.sh-input[aria-invalid="true"] {
    border-color: hsl(var(--destructive));
}
.sh-input[aria-invalid="true"]:focus-visible {
    border-color: hsl(var(--destructive));
    box-shadow: 0 0 0 3px hsl(var(--destructive) / 0.15);
}

/* ---------- Label ---------- */
.sh-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    line-height: 1;
    user-select: none;
}

/* ---------- Form message (error) ---------- */
.sh-form-message {
    font-size: 0.8125rem;
    font-weight: 500;
    color: hsl(var(--destructive));
    margin-top: 0.375rem;
    display: block;
}
.sh-form-message:empty { display: none; }

/* ---------- Form item (wrapper) ---------- */
.sh-form-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ---------- Card ---------- */
.sh-card {
    background: hsl(var(--card));
    color: hsl(var(--card-foreground));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.sh-card-header { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.375rem; }
.sh-card-title { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.025em; line-height: 1; }
.sh-card-description { font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.sh-card-content { padding: 1.5rem; padding-top: 0; }
.sh-card-footer { padding: 1.5rem; padding-top: 0; display: flex; align-items: center; }

/* ---------- Separator ---------- */
.sh-separator { background: hsl(var(--border)); flex-shrink: 0; }
.sh-separator-horizontal { height: 1px; width: 100%; }
.sh-separator-vertical { width: 1px; height: 100%; }

/* ---------- Divider with label ---------- */
.sh-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: hsl(var(--muted-foreground));
    font-size: 0.8125rem;
}
.sh-divider::before, .sh-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: hsl(var(--border));
}

/* ---------- Checkbox ---------- */
.sh-checkbox {
    appearance: none;
    width: 1rem;
    height: 1rem;
    border: 1px solid hsl(var(--border));
    border-radius: 0.25rem;
    background: hsl(var(--background));
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.sh-checkbox:hover { border-color: hsl(var(--primary) / 0.5); }
.sh-checkbox:checked {
    background: hsl(var(--primary));
    border-color: hsl(var(--primary));
}
.sh-checkbox:checked::after {
    content: '';
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'%3E%3Cpath d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}
.sh-checkbox:focus-visible { box-shadow: 0 0 0 3px hsl(var(--ring) / 0.15); }

/* ---------- Radio ---------- */
.sh-radio {
    appearance: none;
    width: 1rem;
    height: 1rem;
    border: 1px solid hsl(var(--border));
    border-radius: 50%;
    background: hsl(var(--background));
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}
.sh-radio:checked {
    border-color: hsl(var(--primary));
}
.sh-radio:checked::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: hsl(var(--primary));
}

/* ---------- Badge ---------- */
.sh-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    border: 1px solid transparent;
}
.sh-badge-default { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.sh-badge-secondary { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); }
.sh-badge-destructive { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); }
.sh-badge-outline { border-color: hsl(var(--border)); color: hsl(var(--foreground)); background: transparent; }

/* ---------- Alert ---------- */
.sh-alert {
    position: relative;
    padding: 1rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid hsl(var(--border));
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    font-size: 0.875rem;
}
.sh-alert-default { background: hsl(var(--background)); color: hsl(var(--foreground)); }
.sh-alert-destructive {
    border-color: hsl(var(--destructive) / 0.5);
    background: hsl(var(--destructive) / 0.05);
    color: hsl(var(--destructive));
}
.sh-alert-success {
    border-color: #2AB67D;
    background: #D4F0E5;
    color: #1F8A5E;
}
.sh-alert-title { font-weight: 600; line-height: 1.2; margin: 0 0 0.25rem 0; }
.sh-alert-description { line-height: 1.4; margin: 0; opacity: 0.9; }

/* ---------- Avatar ---------- */
.sh-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    font-weight: 500;
    font-size: 0.875rem;
    flex-shrink: 0;
    overflow: hidden;
    user-select: none;
}
.sh-avatar-sm { width: 1.5rem; height: 1.5rem; font-size: 0.75rem; }
.sh-avatar-md { width: 2rem; height: 2rem; font-size: 0.8125rem; }
.sh-avatar-lg { width: 2.5rem; height: 2.5rem; }
.sh-avatar-xl { width: 3rem; height: 3rem; font-size: 1rem; }

/* ---------- Dropdown menu (static style) ---------- */
.sh-dropdown-content {
    background: hsl(var(--popover));
    color: hsl(var(--popover-foreground));
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) - 2px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    padding: 0.25rem;
    min-width: 10rem;
}
.sh-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    border-radius: calc(var(--radius) - 4px);
    cursor: pointer;
    user-select: none;
}
.sh-dropdown-item:hover { background: hsl(var(--secondary)); }
.sh-dropdown-separator { height: 1px; margin: 0.25rem -0.25rem; background: hsl(var(--border)); }

/* ---------- Tabs ---------- */
.sh-tabs-list {
    display: inline-flex;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    background: hsl(var(--secondary));
    padding: 0.25rem;
    border-radius: calc(var(--radius) - 2px);
    gap: 0.125rem;
}
.sh-tabs-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 0.375rem 0.75rem;
    border-radius: calc(var(--radius) - 4px);
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}
.sh-tabs-trigger[data-state="active"] {
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

/* ---------- Table ---------- */
.sh-table { width: 100%; caption-side: bottom; font-size: 0.875rem; border-collapse: collapse; }
.sh-table thead { border-bottom: 1px solid hsl(var(--border)); }
.sh-table th {
    height: 3rem;
    padding: 0 1rem;
    text-align: left;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    vertical-align: middle;
}
.sh-table tbody tr { border-bottom: 1px solid hsl(var(--border)); transition: background 0.15s ease; }
.sh-table tbody tr:hover { background: hsl(var(--secondary) / 0.5); }
.sh-table td { padding: 0.75rem 1rem; vertical-align: middle; }

/* ---------- Tooltip (static) ---------- */
.sh-tooltip {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    padding: 0.375rem 0.625rem;
    border-radius: calc(var(--radius) - 4px);
    font-size: 0.8125rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
