/**
 * MBK Base Skin
 * Component classes powered by design token CSS custom properties.
 * Customize via Design Tokens tab (colors, fonts, radius) or override in Global CSS.
 *
 * Available variables (set per-site in Design tab):
 *   --mbk-primary, --mbk-secondary, --mbk-accent
 *   --mbk-text, --mbk-bg
 *   --mbk-radius
 *   --mbk-font-heading, --mbk-font-body
 */

/* ============================================
   Typography
   ============================================ */

.mbk-heading {
    font-family: var(--mbk-font-heading, inherit);
    font-weight: 700;
    line-height: 1.2;
    color: var(--mbk-text);
}

.mbk-h1 { font-size: 2.5rem; }
.mbk-h2 { font-size: 2rem; }
.mbk-h3 { font-size: 1.5rem; }
.mbk-h4 { font-size: 1.25rem; }

.mbk-body {
    font-family: var(--mbk-font-body, inherit);
    color: var(--mbk-text);
    line-height: 1.6;
}

.mbk-small {
    font-size: 0.875rem;
    line-height: 1.5;
}

.mbk-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--mbk-text);
    display: block;
    margin-bottom: 0.25rem;
}

/* ============================================
   Buttons
   ============================================ */

.mbk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    border-radius: var(--mbk-radius);
    font-weight: 500;
    font-size: 0.9375rem;
    line-height: 1.4;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
    border: none;
    text-decoration: none;
}

.mbk-btn:hover {
    opacity: 0.9;
}

.mbk-btn:active {
    transform: scale(0.98);
}

.mbk-btn-primary {
    background: var(--mbk-primary);
    color: #fff;
}

.mbk-btn-secondary {
    background: var(--mbk-secondary);
    color: #fff;
}

.mbk-btn-accent {
    background: var(--mbk-accent);
    color: #fff;
}

.mbk-btn-outline {
    background: transparent;
    border: 2px solid var(--mbk-primary);
    color: var(--mbk-primary);
}

.mbk-btn-outline:hover {
    background: var(--mbk-primary);
    color: #fff;
    opacity: 1;
}

.mbk-btn-ghost {
    background: transparent;
    color: var(--mbk-primary);
    padding: 0.5rem 1rem;
}

.mbk-btn-ghost:hover {
    background: rgba(0, 0, 0, 0.05);
    opacity: 1;
}

.mbk-btn-sm {
    padding: 0.375rem 1rem;
    font-size: 0.8125rem;
}

.mbk-btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1.0625rem;
}

/* ============================================
   Cards
   ============================================ */

.mbk-card {
    background: #fff;
    border-radius: var(--mbk-radius);
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
}

.mbk-card-hover {
    transition: box-shadow 0.2s, transform 0.2s;
}

.mbk-card-hover:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.mbk-card-elevated {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: none;
}

.mbk-card-bordered {
    border: 2px solid var(--mbk-primary);
}

/* ============================================
   Form Inputs
   ============================================ */

.mbk-input {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: var(--mbk-radius);
    font-size: 0.9375rem;
    font-family: var(--mbk-font-body, inherit);
    color: var(--mbk-text);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.mbk-input:focus {
    border-color: var(--mbk-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.mbk-input::placeholder {
    color: rgba(0, 0, 0, 0.35);
}

.mbk-textarea {
    min-height: 6rem;
    resize: vertical;
}

.mbk-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* ============================================
   Dropdown (autocomplete, menus)
   ============================================ */

.mbk-dropdown {
    position: absolute;
    z-index: 50;
    width: 100%;
    margin-top: 0.25rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--mbk-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    max-height: 12rem;
    overflow-y: auto;
}

.mbk-dropdown-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--mbk-text);
    transition: background 0.1s;
}

.mbk-dropdown-item:hover,
.mbk-dropdown-item.is-active {
    background: rgba(0, 0, 0, 0.04);
}

.mbk-dropdown-item.is-selected {
    background: var(--mbk-primary);
    color: #fff;
}

/* ============================================
   Badges & Tags
   ============================================ */

.mbk-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    line-height: 1.5;
}

.mbk-badge-primary {
    background: var(--mbk-primary);
    color: #fff;
}

.mbk-badge-secondary {
    background: var(--mbk-secondary);
    color: #fff;
}

.mbk-badge-accent {
    background: var(--mbk-accent);
    color: #fff;
}

.mbk-badge-outline {
    background: transparent;
    border: 1px solid var(--mbk-primary);
    color: var(--mbk-primary);
}

.mbk-badge-muted {
    background: rgba(0, 0, 0, 0.06);
    color: var(--mbk-text);
}

/* ============================================
   Sections & Layout
   ============================================ */

.mbk-section {
    padding: 4rem 1rem;
}

.mbk-section-sm {
    padding: 2rem 1rem;
}

.mbk-section-lg {
    padding: 6rem 1rem;
}

.mbk-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.mbk-container-narrow {
    max-width: 800px;
}

.mbk-container-wide {
    max-width: 1400px;
}

.mbk-divider {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin: 2rem 0;
}

/* ============================================
   Links
   ============================================ */

.mbk-link {
    color: var(--mbk-primary);
    text-decoration: none;
    transition: opacity 0.15s;
}

.mbk-link:hover {
    opacity: 0.75;
}

.mbk-link-underline {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ============================================
   Lists
   ============================================ */

.mbk-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mbk-list > li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mbk-list > li:last-child {
    border-bottom: none;
}

.mbk-list-check > li {
    padding-left: 1.75rem;
    position: relative;
}

.mbk-list-check > li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--mbk-accent);
    font-weight: 700;
}

/* ============================================
   Alerts / Notices
   ============================================ */

.mbk-alert {
    padding: 1rem 1.25rem;
    border-radius: var(--mbk-radius);
    font-size: 0.9375rem;
    line-height: 1.5;
    border-left: 4px solid;
}

.mbk-alert-info {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

.mbk-alert-success {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #166534;
}

.mbk-alert-warning {
    background: #fefce8;
    border-color: #eab308;
    color: #854d0e;
}

.mbk-alert-error {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

/* ============================================
   Overlay / Modal
   ============================================ */

.mbk-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.mbk-modal {
    background: #fff;
    border-radius: var(--mbk-radius);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
    max-width: 32rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
}

.mbk-modal-lg {
    max-width: 48rem;
}

/* ============================================
   Table
   ============================================ */

.mbk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.mbk-table th {
    text-align: left;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    color: var(--mbk-text);
}

.mbk-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mbk-table tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

/* ============================================
   Utility: Responsive visibility
   ============================================ */

@media (max-width: 767px) {
    .mbk-hide-mobile { display: none !important; }
    .mbk-section { padding: 2.5rem 1rem; }
    .mbk-section-lg { padding: 3.5rem 1rem; }
    .mbk-h1 { font-size: 1.875rem; }
    .mbk-h2 { font-size: 1.5rem; }
    .mbk-h3 { font-size: 1.25rem; }
    .mbk-modal { margin: 0.5rem; }
}

@media (min-width: 768px) {
    .mbk-hide-desktop { display: none !important; }
}
