/**
 * HIB RunPace Calc - Admin Dashboard Styling
 */

.hib-runpace-admin-wrap {
    max-width: 1300px;
    margin: 20px auto;
}

/* Header */
.hib-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.hib-header-title h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hib-header-desc {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

.hib-badge-ver {
    background: #ff5500;
    color: #ffffff;
    font-weight: 700;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 9999px;
}

/* Layout Grid */
.hib-admin-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 1080px) {
    .hib-admin-grid {
        grid-template-columns: 1fr;
    }
}

/* Kort */
.hib-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.hib-card-title {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.hib-field-hint {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 16px 0;
}

.hib-divider {
    border: none;
    border-top: 1px solid #f1f5f9;
    margin: 20px 0;
}

/* Preset Picker */
.hib-preset-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

@media (max-width: 700px) {
    .hib-preset-picker {
        grid-template-columns: repeat(2, 1fr);
    }
}

.hib-preset-opt input {
    display: none;
}

.hib-preset-card {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.hib-preset-opt input:checked + .hib-preset-card {
    border-color: #ff5500;
    background: #fff7ed;
    box-shadow: 0 0 0 2px rgba(255, 85, 0, 0.2);
}

.preset-swatch {
    width: 100%;
    height: 36px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.swatch-light {
    background: #ffffff;
}

.swatch-dark {
    background: #0f172a;
}

.swatch-transparent {
    background: repeating-conic-gradient(#e2e8f0 0% 25%, #ffffff 0% 50%) 50% / 12px 12px;
}

.swatch-custom {
    background: linear-gradient(135deg, #ff5500 0%, #2563eb 100%);
}

.preset-label {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
}

/* Skjemafelter */
.hib-form-group {
    margin-bottom: 16px;
}

.hib-form-group label {
    display: block;
    font-size: 13px;
    color: #1e293b;
    margin-bottom: 6px;
}

.hib-form-row {
    display: flex;
    gap: 16px;
}

.hib-half {
    flex: 1;
}

.hib-third {
    flex: 1;
}

.hib-select {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #0f172a;
    background: #ffffff;
}

/* Radius Range & Number Input */
.hib-range-num-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hib-radius-slider {
    flex: 1;
    accent-color: #ff5500;
    cursor: pointer;
}

.hib-num-unit-wrap {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    padding: 2px 8px;
    width: 70px;
}

.hib-num-input {
    width: 40px !important;
    border: none !important;
    background: transparent !important;
    padding: 4px 0 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    text-align: right !important;
    box-shadow: none !important;
}

.hib-num-input:focus {
    outline: none !important;
}

.hib-num-unit {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-left: 2px;
}

/* Fargevelger Grid */
.hib-color-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.hib-color-item label {
    display: block;
    font-size: 12px;
    color: #334155;
    margin-bottom: 6px;
}

/* Toggles Grid */
.hib-toggles-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hib-toggle-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 10px 14px;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.hib-toggle-item:hover {
    background: #f1f5f9;
}

.hib-toggle-item input[type="checkbox"] {
    margin-top: 3px;
    accent-color: #ff5500;
}

.hib-toggle-text {
    display: flex;
    flex-direction: column;
}

.hib-toggle-text strong {
    font-size: 13px;
    color: #0f172a;
}

.hib-toggle-text small {
    font-size: 12px;
    color: #64748b;
}

/* Live Preview Card */
.hib-preview-card {
    position: sticky;
    top: 32px;
}

.hib-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.hib-preview-header h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
}

.hib-preview-badge {
    background: #e0f2fe;
    color: #0284c7;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 9999px;
}

.hib-preview-wrapper {
    background: #f1f5f9;
    padding: 16px;
    border-radius: 10px;
    border: 1px dashed #cbd5e1;
}

/* Shortcode Hjelper */
.hib-code-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    padding: 10px 14px;
    border-radius: 8px;
    margin: 10px 0;
}

.hib-code-copy code {
    font-size: 14px;
    font-weight: 700;
    color: #ff5500;
}

.hib-param-list {
    margin: 8px 0;
    padding-left: 20px;
    font-size: 13px;
    color: #475569;
}

.hib-param-list code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    color: #0f172a;
}

/* Adminfaner */
.hib-admin-tabs {
    display: flex;
    gap: 8px;
    margin: -8px 0 24px;
    padding: 5px;
    width: fit-content;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.03);
}

.hib-admin-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 15px;
    border-radius: 7px;
    color: #475569;
    font-weight: 700;
    text-decoration: none;
}

.hib-admin-tab:hover,
.hib-admin-tab:focus {
    color: #0f172a;
}

.hib-admin-tab.is-active {
    color: #ffffff;
    background: #ff5500;
}

/* Hjelpeside */
.hib-help-page {
    color: #334155;
}

.hib-help-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 34px;
    margin-bottom: 20px;
    color: #ffffff;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.hib-help-kicker {
    display: inline-block;
    margin-bottom: 8px;
    color: #fdba74;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.13em;
}

.hib-help-hero h2 {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.15;
}

.hib-help-hero p {
    max-width: 760px;
    margin: 0;
    color: #cbd5e1;
    font-size: 15px;
    line-height: 1.65;
}

.hib-help-version {
    flex: 0 0 auto;
    padding: 7px 12px;
    color: #0f172a;
    background: #ffffff;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.hib-help-section {
    padding: 28px;
    margin-bottom: 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.03);
}

.hib-help-section > h3 {
    margin: 0 0 18px;
    color: #0f172a;
    font-size: 20px;
}

.hib-help-section h4 {
    margin: 0 0 7px;
    color: #0f172a;
    font-size: 15px;
}

.hib-help-section p {
    line-height: 1.65;
}

.hib-help-steps,
.hib-help-mode-grid,
.hib-help-definition-grid {
    display: grid;
    gap: 14px;
}

.hib-help-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hib-help-mode-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hib-help-definition-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hib-help-steps article,
.hib-help-mode-grid article,
.hib-help-definition-grid article,
.hib-help-columns article {
    padding: 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.hib-help-steps article > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-bottom: 12px;
    color: #ffffff;
    background: #ff5500;
    border-radius: 50%;
    font-weight: 800;
}

.hib-help-steps p,
.hib-help-mode-grid p,
.hib-help-definition-grid p,
.hib-help-columns p {
    margin: 0;
}

.hib-help-icon {
    margin-bottom: 10px;
    font-size: 24px;
}

.hib-help-example {
    padding-top: 12px;
    margin-top: 14px;
    color: #475569;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 700;
}

.hib-help-code-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    margin-top: 18px;
    background: #0f172a;
    border-radius: 9px;
}

.hib-help-code-row code {
    color: #fdba74;
    font-size: 14px;
    font-weight: 700;
}

.hib-help-notice {
    padding: 15px 18px;
    margin-top: 16px;
    color: #78350f;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    line-height: 1.6;
}

.hib-help-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.hib-help-list {
    padding-left: 22px;
    margin: 0;
}

.hib-help-list li {
    padding: 4px 0;
    line-height: 1.55;
}

.hib-help-muted {
    margin: 14px 0 0;
    color: #64748b;
    font-size: 13px;
}

.hib-help-snippets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.hib-help-snippets > div {
    min-width: 0;
    padding: 15px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
}

.hib-help-snippets p {
    margin: 0 0 8px;
}

.hib-help-snippets code {
    display: block;
    overflow-x: auto;
    padding: 10px;
    color: #c2410c;
    background: #fff7ed;
    border-radius: 6px;
    white-space: nowrap;
}

.hib-help-table-wrap {
    overflow-x: auto;
}

.hib-help-table th {
    color: #0f172a;
}

.hib-help-table td {
    vertical-align: top;
}

.hib-help-faq {
    display: grid;
    gap: 9px;
}

.hib-help-faq details {
    padding: 0 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
}

.hib-help-faq summary {
    padding: 14px 0;
    color: #0f172a;
    font-weight: 700;
    cursor: pointer;
}

.hib-help-faq details p {
    margin: 0;
    padding: 0 0 16px;
    color: #475569;
}

.hib-help-footer-card {
    color: #e2e8f0;
    background: #0f172a;
    border-color: #0f172a;
}

.hib-help-footer-card > h3 {
    color: #ffffff;
}

.hib-help-footer-card p {
    margin: 0;
}

@media (max-width: 900px) {
    .hib-help-steps,
    .hib-help-definition-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hib-help-mode-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .hib-admin-tabs {
        width: auto;
    }

    .hib-admin-tab {
        flex: 1;
        justify-content: center;
    }

    .hib-help-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 24px;
    }

    .hib-help-section {
        padding: 20px;
    }

    .hib-help-steps,
    .hib-help-definition-grid,
    .hib-help-columns,
    .hib-help-snippets {
        grid-template-columns: 1fr;
    }

    .hib-help-code-row {
        align-items: stretch;
        flex-direction: column;
    }
}
