/* ═══════════════════════════════════════════════════════════════════════════════
   ArkComponents.css — Design system dos componentes reutilizáveis
   ARK Platform · NewDevArk4Life
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─── ArkToggle ─────────────────────────────────────────────────────────────── */

.ark-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.ark-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ark-toggle-track {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: var(--ark-cinza, #c7c9d0);
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.ark-toggle input:checked ~ .ark-toggle-track {
    background: var(--ark-primaria-4, #005682);
}

.ark-toggle input:disabled ~ .ark-toggle-track {
    opacity: 0.4;
    cursor: not-allowed;
}

.ark-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: transform 0.2s ease;
}

.ark-toggle input:checked ~ .ark-toggle-track .ark-toggle-thumb {
    transform: translateX(20px);
}

.ark-toggle-label {
    font-size: 14px;
    color: var(--text-color, #3D5268);
}

.ark-toggle:focus-within .ark-toggle-track {
    outline: 2px solid var(--ark-primaria-4, #005682);
    outline-offset: 2px;
}

/* ─── ExpandableSection ─────────────────────────────────────────────────────── */

.ark-expandable {
    border: 1px solid var(--border-color, #D4DDE5);
    border-radius: 10px;
    overflow: hidden;
    background: var(--card-bg, #fff);
}

.ark-expandable-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color, #3D5268);
    text-align: left;
    gap: 8px;
    transition: background 0.15s;
}

.ark-expandable-header:hover {
    background: var(--ark-fundo-claro, #f3f5f7);
}

.ark-expandable-title {
    flex: 1;
}

.ark-expandable-icon {
    font-size: 13px;
    color: var(--text-secondary, #6B7C8E);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.ark-expandable.open .ark-expandable-icon {
    transform: rotate(180deg);
}

.ark-expandable-body {
    padding: 4px 16px 16px;
    border-top: 1px solid var(--border-color, #D4DDE5);
}

/* ─── ArkSlider ─────────────────────────────────────────────────────────────── */

.ark-slider-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ark-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ark-slider-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color, #3D5268);
}

.ark-slider-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--ark-primaria-4, #005682);
    min-width: 42px;
    text-align: right;
}

.ark-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--ark-cinza-claro, #e7e9ed);
    outline: none;
    cursor: pointer;
}

.ark-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--ark-primaria-4, #005682);
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    cursor: pointer;
    transition: transform 0.15s;
}

.ark-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.ark-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: var(--ark-primaria-4, #005682);
    cursor: pointer;
}

.ark-slider-range {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary, #6B7C8E);
}

/* ─── MonetaryField ─────────────────────────────────────────────────────────── */

.ark-monetary-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ark-monetary-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary, #6B7C8E);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ark-monetary-input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color, #D4DDE5);
    border-radius: 8px;
    background: var(--card-bg, #fff);
    overflow: hidden;
    transition: border-color 0.15s;
}

.ark-monetary-input-wrap:focus-within {
    border-color: var(--ark-primaria-4, #005682);
    box-shadow: 0 0 0 3px rgba(0,86,130,.12);
}

.ark-monetary-currency {
    padding: 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary, #6B7C8E);
    background: var(--ark-fundo-claro, #f3f5f7);
    border-right: 1px solid var(--border-color, #D4DDE5);
    height: 40px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.ark-monetary-input {
    flex: 1;
    padding: 0 12px;
    height: 40px;
    border: none;
    outline: none;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color, #3D5268);
    background: transparent;
}

.ark-monetary-error {
    font-size: 12px;
    color: var(--ark-erro, #b91c1c);
}

/* ─── FileUpload ────────────────────────────────────────────────────────────── */

.ark-upload-wrap {
    border: 2px dashed var(--border-color, #D4DDE5);
    border-radius: 12px;
    background: var(--ark-fundo-claro, #f3f5f7);
    transition: border-color 0.2s, background 0.2s;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ark-upload-wrap.dragging {
    border-color: var(--ark-primaria-4, #005682);
    background: rgba(0,86,130,.06);
}

.ark-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px;
    cursor: pointer;
    width: 100%;
    text-align: center;
}

.ark-upload-icon {
    font-size: 32px;
    color: var(--ark-primaria-4, #005682);
}

.ark-upload-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color, #3D5268);
}

.ark-upload-hint {
    font-size: 12px;
    color: var(--text-secondary, #6B7C8E);
}

.ark-upload-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ark-upload-preview {
    position: relative;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
}

.ark-upload-img-preview {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    display: block;
}

.ark-upload-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
}

.ark-upload-file-icon {
    font-size: 24px;
    color: var(--ark-primaria-4, #005682);
}

.ark-upload-file-name {
    font-size: 14px;
    color: var(--text-color, #3D5268);
    word-break: break-all;
}

.ark-upload-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,.55);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: background 0.15s;
}

.ark-upload-remove:hover {
    background: rgba(0,0,0,.75);
}

/* ─── PhoneInput ────────────────────────────────────────────────────────────── */

.ark-phone-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ark-phone-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary, #6B7C8E);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ark-phone-row {
    display: flex;
    border: 1px solid var(--border-color, #D4DDE5);
    border-radius: 8px;
    overflow: visible;
    background: var(--card-bg, #fff);
    transition: border-color 0.15s;
    position: relative;
}

.ark-phone-row:focus-within {
    border-color: var(--ark-primaria-4, #005682);
    box-shadow: 0 0 0 3px rgba(0,86,130,.12);
}

.ark-phone-ddi {
    position: relative;
    flex-shrink: 0;
}

.ark-phone-ddi-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    height: 40px;
    border: none;
    border-right: 1px solid var(--border-color, #D4DDE5);
    background: var(--ark-fundo-claro, #f3f5f7);
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color, #3D5268);
    border-radius: 7px 0 0 7px;
    white-space: nowrap;
    transition: background 0.15s;
}

.ark-phone-ddi-btn:hover {
    background: var(--ark-cinza-claro, #e7e9ed);
}

.ark-phone-flag {
    font-size: 18px;
    line-height: 1;
}

.ark-phone-ddi-code {
    font-size: 13px;
    font-weight: 600;
}

.ark-phone-chevron {
    font-size: 10px;
    color: var(--text-secondary, #6B7C8E);
    transition: transform 0.2s;
}

.ark-phone-chevron.open {
    transform: rotate(180deg);
}

.ark-phone-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 200;
    width: 260px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #D4DDE5);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    overflow: hidden;
}

.ark-phone-dropdown-search {
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-bottom: 1px solid var(--border-color, #D4DDE5);
    outline: none;
    font-size: 14px;
    color: var(--text-color, #3D5268);
    background: var(--ark-fundo-claro, #f3f5f7);
}

.ark-phone-dropdown-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 220px;
    overflow-y: auto;
}

.ark-phone-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color, #3D5268);
    text-align: left;
    transition: background 0.1s;
}

.ark-phone-option:hover {
    background: var(--ark-fundo-claro, #f3f5f7);
}

.ark-phone-option.selected {
    background: rgba(0,86,130,.08);
    font-weight: 600;
}

.ark-phone-option-flag {
    font-size: 18px;
    flex-shrink: 0;
}

.ark-phone-option-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ark-phone-option-ddi {
    font-size: 12px;
    color: var(--text-secondary, #6B7C8E);
    flex-shrink: 0;
}

.ark-phone-input {
    flex: 1;
    padding: 0 12px;
    height: 40px;
    border: none;
    outline: none;
    font-size: 15px;
    color: var(--text-color, #3D5268);
    background: transparent;
}

/* ─── VideoPlayer ───────────────────────────────────────────────────────────── */

.ark-video-wrap {
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}

.ark-video-player {
    width: 100%;
    display: block;
    max-height: 360px;
}

.ark-video-placeholder {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    background: #0d1520;
    padding: 0;
    overflow: hidden;
}

.ark-video-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

.ark-video-thumb-empty {
    font-size: 48px;
    color: rgba(255,255,255,.2);
}

.ark-video-play-btn {
    position: relative;
    z-index: 1;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--ark-primaria, #001018);
    transition: transform 0.15s, background 0.15s;
    box-shadow: 0 2px 12px rgba(0,0,0,.35);
}

.ark-video-placeholder:hover .ark-video-play-btn {
    transform: scale(1.1);
    background: #fff;
}

.ark-video-duration {
    position: absolute;
    bottom: 10px;
    right: 12px;
    z-index: 1;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: rgba(0,0,0,.6);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ─── ArkTable ──────────────────────────────────────────────────────────────── */

.ark-table-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border-color, #D4DDE5);
    border-radius: 12px;
    overflow: hidden;
    background: var(--card-bg, #fff);
}

.ark-table-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color, #D4DDE5);
    background: var(--ark-fundo-claro, #f3f5f7);
}

.ark-table-search-wrap {
    position: relative;
    flex: 1;
    max-width: 320px;
}

.ark-table-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: var(--text-secondary, #6B7C8E);
    pointer-events: none;
}

.ark-table-search {
    width: 100%;
    padding: 7px 12px 7px 32px;
    border: 1px solid var(--border-color, #D4DDE5);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-color, #3D5268);
    background: var(--card-bg, #fff);
    outline: none;
    transition: border-color 0.15s;
}

.ark-table-search:focus {
    border-color: var(--ark-primaria-4, #005682);
    box-shadow: 0 0 0 3px rgba(0,86,130,.1);
}

.ark-table-toolbar-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.ark-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ark-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ark-table thead th,
.ark-table-th {
    padding: 11px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #6B7C8E);
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid var(--border-color, #D4DDE5);
    white-space: nowrap;
    background: var(--ark-fundo-claro, #f3f5f7);
}

.ark-table-th-actions {
    width: 44px;
}

.ark-table-row td,
.ark-table-td {
    padding: 12px 16px;
    color: var(--text-color, #3D5268);
    border-bottom: 1px solid var(--border-color, #D4DDE5);
    vertical-align: middle;
}

.ark-table-row:last-child td {
    border-bottom: none;
}

.ark-table-row:hover td {
    background: var(--ark-fundo-claro, #f3f5f7);
}

.ark-table-empty {
    padding: 40px 16px;
    text-align: center;
    color: var(--text-secondary, #6B7C8E);
}

.ark-table-empty i {
    display: block;
    font-size: 28px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.ark-table-td-actions {
    width: 44px;
    padding: 0 8px;
}

.ark-table-ctx-wrap {
    position: relative;
    display: flex;
    justify-content: center;
}

.ark-table-ctx-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--text-secondary, #6B7C8E);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: background 0.15s, color 0.15s;
}

.ark-table-ctx-btn:hover {
    background: var(--ark-cinza-claro, #e7e9ed);
    color: var(--text-color, #3D5268);
}

.ark-table-ctx-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 100;
    min-width: 160px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #D4DDE5);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    overflow: hidden;
    padding: 4px 0;
}

.ark-table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid var(--border-color, #D4DDE5);
    background: var(--ark-fundo-claro, #f3f5f7);
    gap: 12px;
}

.ark-table-pag-info {
    font-size: 13px;
    color: var(--text-secondary, #6B7C8E);
}

.ark-table-pag-btns {
    display: flex;
    gap: 4px;
    align-items: center;
}

.ark-table-pag-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border: 1px solid var(--border-color, #D4DDE5);
    border-radius: 6px;
    background: var(--card-bg, #fff);
    color: var(--text-color, #3D5268);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.ark-table-pag-btn:hover:not(:disabled) {
    background: var(--ark-cinza-claro, #e7e9ed);
}

.ark-table-pag-btn.active {
    background: var(--ark-primaria-4, #005682);
    border-color: var(--ark-primaria-4, #005682);
    color: #fff;
    font-weight: 600;
}

.ark-table-pag-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ─── Dark mode ─────────────────────────────────────────────────────────────── */

[data-theme="dark"] .ark-toggle-track {
    background: var(--border-color, #353d48);
}

[data-theme="dark"] .ark-expandable,
[data-theme="dark"] .ark-monetary-input-wrap,
[data-theme="dark"] .ark-phone-row,
[data-theme="dark"] .ark-table-wrap {
    border-color: var(--border-color, #353d48);
}

[data-theme="dark"] .ark-upload-wrap {
    border-color: var(--border-color, #353d48);
    background: var(--ark-fundo-claro, #1a2030);
}

[data-theme="dark"] .ark-phone-dropdown,
[data-theme="dark"] .ark-table-ctx-menu {
    border-color: var(--border-color, #353d48);
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
