/* Union Member Management - Base Styles - Comprehensive Icon Alignment v2.0
 *
 * ICON ALIGNMENT SYSTEM:
 * This file contains comprehensive icon alignment rules that ensure consistent
 * visual presentation across all buttons and components in the plugin.
 *
 * STANDARDIZED VALUES:
 * - Standard button icons: 6px margin-right, 16px font-size
 * - Table action icons: 4px margin-right, 14px font-size (compact)
 * - Large header icons: 6px margin-right, 18px font-size (prominent)
 * - All icons use: display: inline-flex, align-items: center, line-height: 1
 *
 * COVERAGE:
 * - WordPress .button elements
 * - Custom .umm-btn elements
 * - Navigation tabs (.nav-tab)
 * - Modal buttons (.umm-modal-btn)
 * - Form buttons and inputs
 * - Header icons (.hndle .dashicons)
 * - Info boxes and warning boxes
 * - Table action buttons
 * - Dashboard components
 */

/* Utility Classes */
.umm-hidden {
    display: none !important;
}

/* A fieldset is as wide as its widest line by default (min-inline-size:
   min-content), so one long input, table or unbroken label pushed it past the
   panel it sits in and the panel scrolled sideways on a phone. */
fieldset {
    min-width: 0;
}

/* An unstyled file input is as wide as its button and its "no file chosen"
   text — 340px in Chrome, more than a phone panel has inside its padding. */
input[type="file"] {
    max-width: 100%;
}

/* Global Icon Alignment Fixes - Comprehensive icon alignment for all buttons and components */
.dashicons {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Universal Button Icon Rules - Standardized 6px spacing for all button types */
.button .dashicons,
.umm-btn .dashicons,
.nav-tab .dashicons,
.umm-pagination-btn .dashicons,
.umm-chart-menu-item .dashicons,
.umm-modal-btn .dashicons,
.umm-restore-btn .dashicons,
.umm-tab-button .dashicons,
.umm-file-input-label .dashicons,
.submit .button .dashicons,
button .dashicons,
input[type="button"] .dashicons,
input[type="submit"] .dashicons,
a.button .dashicons {
    margin-right: 6px;
    margin-left: 0;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    flex-shrink: 0;
}

/* No right margin for top bar icons */
.top-bar-notification-btn .dashicons {
    margin-right: 0;
}

/* Button Container Alignment - Ensure buttons use flexbox for proper icon alignment */
.button,
.umm-btn,
.nav-tab,
.umm-modal-btn,
.umm-restore-btn,
.umm-tab-button,
.umm-file-input-label,
.submit .button,
button,
input[type="button"],
input[type="submit"],
a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    white-space: nowrap;
    box-sizing: border-box;
}

/*
 * A button drawn as a card or a list row (a title and a line under it).
 * The rule above makes every <button> one centred line that never wraps —
 * right for a button, wrong for a card: on a phone a long title is centred,
 * does not wrap, and is cut on both sides. Put this class on such a button:
 * its text wraps and starts at the left and at the top, like a block's.
 * (MASS: its goal and campaign cards, its report rows, its number chips —
 * analysis 2026-11-23, F3.) A component may still set its own layout.
 */
.umm-card-button {
    white-space: normal;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
}

/* Special Cases - Headers, Info Boxes, and Other Components */
.postbox .hndle .dashicons,
.umm-info-box .dashicons,
.umm-warning-box .dashicons,
.umm-tool-section h5 .dashicons,
.umm-backup-header h4 .dashicons,
.umm-form-section-header .dashicons {
    margin-right: 6px;
    margin-left: 0;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Table Action Buttons - Smaller icons for compact space */
.umm-table .actions .dashicons,
.actions a .dashicons,
.row-actions a .dashicons {
    margin-right: 4px;
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Large Icons - Dashboard stats and prominent sections */
.umm-stat-icon .dashicons,
.umm-dashboard-summary h2 .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin-right: 6px;
}

/* Modal Header Icons - Slightly larger for visual hierarchy */
.umm-modal-header .dashicons,
.umm-edit-modal-header .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin-right: 6px;
}

/* Pagination Button Specific Alignment */
.umm-pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.umm-pagination-btn .dashicons {
    margin-right: 0;
    /* Using gap instead */
}

/* Pagination button icon alignment */
.umm-pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.umm-pagination-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* General Layout */
.umm-dashboard,
.umm-pdf-generator,
.umm-manage-section {
    max-width: none;
    /* Full width - no constraints */
    margin: 20px 20px;
    /* Full width with side margins */
    padding: 0;
    box-sizing: border-box;
}

/* Container Layout System */
.umm-container {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.umm-container-fluid {
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Grid System */
.umm-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.umm-col {
    flex: 1;
    padding: 0 10px;
    box-sizing: border-box;
}

.umm-col-half {
    flex: 0 0 50%;
    padding: 0 10px;
    box-sizing: border-box;
}

.umm-col-third {
    flex: 0 0 33.333%;
    padding: 0 10px;
    box-sizing: border-box;
}

.umm-col-quarter {
    flex: 0 0 25%;
    padding: 0 10px;
    box-sizing: border-box;
}

/* Spacing Utilities */
.umm-space-y-4>*+* {
    margin-top: 1rem;
}

.umm-space-y-6>*+* {
    margin-top: 1.5rem;
}

.umm-space-y-8>*+* {
    margin-top: 2rem;
}

/* Responsive Layout Adjustments */
@media (max-width: 1200px) {

    .umm-dashboard,
    .umm-pdf-generator,
    .umm-manage-section {
        margin: 20px 15px;
    }

    .umm-container,
    .umm-container-fluid {
        padding: 0 15px;
    }
}

@media (max-width: 768px) {

    .umm-dashboard,
    .umm-pdf-generator,
    .umm-manage-section {
        margin: 15px 10px;
    }

    .umm-container,
    .umm-container-fluid {
        padding: 0 10px;
    }

    .umm-row {
        margin: 0 -5px;
    }

    .umm-col,
    .umm-col-half,
    .umm-col-third,
    .umm-col-quarter {
        flex: 0 0 100%;
        padding: 0 5px;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {

    .umm-dashboard,
    .umm-pdf-generator,
    .umm-manage-section {
        margin: 10px 5px;
    }

    .umm-container,
    .umm-container-fluid {
        padding: 0 5px;
    }
}

/* Loading States */
.umm-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.umm-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: umm-spin 1s linear infinite;
}

@keyframes umm-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Message Boxes */
.umm-info-box {
    background: #e7f3ff;
    border: 1px solid #b8daff;
    border-left: 3px solid #0073aa;
    border-radius: 4px;
    padding: 12px 16px;
    margin: 12px 0;
    display: flex;
    align-items: flex-start;
}

.umm-info-box .dashicons {
    color: #0073aa;
    font-size: 16px;
    vertical-align: top;
    line-height: 1.3;
}

.umm-info-box h4 {
    margin: 0 0 10px 0;
    color: #0073aa;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.umm-info-box h4 .dashicons {
    margin-right: 6px;
    font-size: 16px;
    line-height: 1;
}

.umm-info-box h5 {
    margin: 12px 0 8px 0;
    color: #23282d;
    font-size: 16px;
    font-weight: 600;
}

.umm-info-box ul {
    margin: 8px 0 8px 16px;
    padding: 0;
}

.umm-info-box li {
    margin-bottom: 6px;
    line-height: 1.3;
}

.umm-warning-box {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-left: 3px solid #f39c12;
    border-radius: 4px;
    padding: 12px 16px;
    margin: 12px 0;
    display: flex;
    align-items: flex-start;
}

.umm-warning-box .dashicons {
    color: #f39c12;
    font-size: 16px;
    vertical-align: top;
    line-height: 1.3;
}

.umm-warning-box strong {
    color: #856404;
}

/* Search Box */
.umm-search-box {
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.umm-search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.umm-search-input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Content Layout */
.umm-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #c3c4c7;
}

.umm-content-header h1,
.umm-content-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #1d2327;
}

.umm-content-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Section Layout */
.umm-section {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    margin-bottom: 20px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}

.umm-section-header {
    background: #f6f7f7;
    border-bottom: 1px solid #c3c4c7;
    padding: 15px 20px;
    border-radius: 4px 4px 0 0;
}

.umm-section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    display: flex;
    align-items: center;
    gap: 8px;
}

.umm-section-content {
    padding: 20px;
}

.umm-section-footer {
    background: #f6f7f7;
    border-top: 1px solid #c3c4c7;
    padding: 15px 20px;
    border-radius: 0 0 4px 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Pagination */
.umm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 25px 0;
    gap: 5px;
    flex-wrap: wrap;
}

.umm-pagination-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 15px;
    margin: 0;
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    text-decoration: none;
    color: #646970;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    min-height: 40px;
    box-sizing: border-box;
}

.umm-pagination-btn:hover {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.2);
}

.umm-pagination-btn.current {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
    font-weight: 600;
}

.umm-pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.umm-pagination-btn.disabled:hover {
    background: #f6f7f7;
    color: #646970;
    border-color: #c3c4c7;
    transform: none;
    box-shadow: none;
}

/* Pagination responsive */
@media (max-width: 768px) {
    .umm-pagination {
        margin: 20px 0;
        gap: 3px;
    }

    .umm-pagination-btn {
        padding: 8px 12px;
        font-size: 13px;
        min-height: 36px;
    }
}

@media (max-width: 480px) {
    .umm-pagination {
        flex-direction: column;
        gap: 8px;
    }

    .umm-pagination-btn {
        width: 100%;
        justify-content: center;
        max-width: 200px;
    }
}

/* Member Details styles moved to modules/union-members-manage/assets/css/ */

/* Button Styling - Consistent with DataTables and WordPress */
.umm-actions-section {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.umm-actions-section button,
.umm-btn {
    display: inline-block;
    padding: 6px 12px;
    margin: 0;
    font-size: 13px;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    background-color: #f3f3f3;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    box-shadow: 0 1px 0 rgba(120, 200, 230, 0.6);
    transition: all 0.2s ease;
    font-weight: normal;
}

.umm-actions-section button:hover,
.umm-btn:hover {
    background-color: #ebebeb;
    border-color: #adadad;
    color: #000;
    box-shadow: 0 1px 0 rgba(120, 200, 230, 0.6);
}

.umm-actions-section button:active,
.umm-btn:active {
    background-color: #e6e6e6;
    border-color: #adadad;
    box-shadow: inset 0 2px 0 #adadad;
    outline: 0;
}

.umm-actions-section button:focus,
.umm-btn:focus {
    border-color: #5b9dd9;
    box-shadow: 0 0 2px rgba(30, 140, 190, 0.8);
    outline: 1px solid transparent;
}

/* Primary button variant */
.umm-actions-section button.button-primary,
.umm-btn.button-primary {
    background-color: #0073aa;
    border-color: #0073aa;
    color: #fff;
    box-shadow: 0 1px 0 rgba(120, 200, 230, 0.5);
}

.umm-actions-section button.button-primary:hover,
.umm-btn.button-primary:hover {
    background-color: #005a87;
    border-color: #005a87;
    color: #fff;
}

.umm-actions-section button.button-primary:active,
.umm-btn.button-primary:active {
    background-color: #004568;
    border-color: #004568;
    box-shadow: inset 0 2px 0 #004568;
}

/* Small button variant */
.umm-actions-section button.button-small,
.umm-btn.button-small {
    padding: 4px 8px;
    font-size: 12px;
    min-height: 26px;
}

/* Button with icons - Consolidated alignment rules */
.umm-actions-section button .dashicons,
.umm-btn .dashicons {
    margin-right: 6px;
    margin-left: 0;
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Responsive button adjustments */
@media (max-width: 768px) {
    .umm-actions-section {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    /* Not in a slide panel's header, where a button is as wide as its label.
       :where keeps this at one class, so a module's own width still wins. */
    .umm-actions-section button,
    .umm-btn:not(:where(.umm-panel-header-actions > *)) {
        width: 100%;
        text-align: center;
    }
}

/* WordPress Admin Compatibility - Production rules for theme override protection */
/* These rules provide additional specificity to override any conflicting theme styles */

/* Force consistent button icon alignment across all WordPress admin contexts */
/* .button-primary / .button-secondary used WITHOUT .button, and bare <button>:
   WordPress core has `.wp-core-ui .button-primary .dashicons { vertical-align:
   top }`, which out-ranks the plain rules above, so the icon of such a button
   (a check mark before "Salvează…", most often) sat at the top of the line
   instead of beside the text. Bare <button> is deliberately not listed: the
   6px margin below would push every icon-only button off centre. */
.wp-admin .button-primary .dashicons,
.wp-admin .button-secondary .dashicons,
.wp-admin .button .dashicons,
.wp-admin .umm-btn .dashicons,
.wp-admin .nav-tab .dashicons,
.wp-admin input[type="button"] .dashicons,
.wp-admin input[type="submit"] .dashicons,
.wp-admin a.button .dashicons,
body.wp-admin .button .dashicons,
body.wp-admin .umm-btn .dashicons {
    margin-right: 6px !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
}

/* Ensure all button containers support proper icon alignment */
.wp-admin .button-primary,
.wp-admin .button-secondary,
.wp-admin .button,
.wp-admin .umm-btn,
.wp-admin input[type="button"],
.wp-admin input[type="submit"],
.wp-admin a.button,
body.wp-admin .button,
body.wp-admin .umm-btn {
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
}

/*
 * …and that rule must not make a button impossible to hide.
 *
 * A button hidden from code — jQuery's .hide() and .toggle(false) write an
 * inline display:none; templates and scripts use the hidden attribute — lost
 * to the !important above and stayed on screen. Measured on the 63 back-office
 * pages: 27 buttons hidden by their own code, 25 of them drawn anyway, 9 on
 * screen at rest, delete buttons among them (Biblioteca Digitală offered
 * "Publică", "Arhivează" and "Șterge" with nothing selected; Control Acces
 * offered "Schimbă" beside a person who cannot be changed).
 */
body.wp-admin .button[hidden],
body.wp-admin .umm-btn[hidden],
body.wp-admin input[type="button"][hidden],
body.wp-admin input[type="submit"][hidden],
body.wp-admin .button[style*="display: none"],
body.wp-admin .umm-btn[style*="display: none"],
body.wp-admin input[type="button"][style*="display: none"],
body.wp-admin input[type="submit"][style*="display: none"],
body.wp-admin .button[style*="display:none"],
body.wp-admin .umm-btn[style*="display:none"],
body.wp-admin input[type="button"][style*="display:none"],
body.wp-admin input[type="submit"][style*="display:none"] {
    display: none !important;
}

/* Disabled state for all UMM action buttons */
.umm-btn:disabled,
.umm-btn[disabled],
body.wp-admin .umm-btn:disabled,
body.wp-admin .umm-btn[disabled] {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Special handling for WordPress admin context to override theme conflicts */
body.wp-admin.wp-core-ui .button .dashicons,
html body.wp-admin .wrap .button .dashicons {
    margin-right: 6px !important;
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
}

/* Exception: toolbar action buttons should have no right margin (icons sit within buttons) */
body.wp-admin .umm-toolbar-action-btn .dashicons,
.wp-admin .umm-toolbar-action-btn .dashicons {
    margin-right: 0 !important;
}

/* ─── Sidebar nav items ──────────────────────────────────────────────
 * Moved to assets/css/umm-page-shell.css, which owns the whole page shell
 * (header band, nav items, collapse button) for every module. The rules that
 * used to live here reset `background: none !important` unconditionally, which
 * silently beat every module's own `.active { background: … }` — the reason
 * only the payments module showed a tinted active row.
 * ─────────────────────────────────────────────────────────────────── */

/* ── Password show/hide toggle — shared utility ─────────────────────────── */

/* Suppress Edge / IE native reveal + clear buttons — we use our own toggle */
.umm-input-with-toggle input[type="password"]::-ms-reveal,
.umm-input-with-toggle input[type="password"]::-ms-clear,
.umm-input-with-toggle input[type="text"]::-ms-clear {
    display: none !important;
}

.umm-input-with-toggle {
    position: relative;
    display: flex;
    align-items: stretch;
}

.umm-input-with-toggle input {
    flex: 1;
    padding-right: 40px !important;
}

.umm-toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #6b7280;
    line-height: 1;
    display: flex;
    align-items: center;
}

.umm-toggle-password:hover {
    color: #0073aa;
}

/*
 * Icon-only buttons: the icon sits in the middle.
 * ────────────────────────────────────────────────────────────────────────────
 * Every rule above gives a button's .dashicons `margin-right: 6px` to space it
 * from its label — some with !important, the strongest at (0,4,2). A button
 * whose only content is the icon still carries that margin, and flex centring
 * centres icon + margin: the glyph sat 3px left of centre in 147 icon-only
 * buttons across the plugin (round close, reset and toolbar buttons among
 * them). Module after module zeroed it for its own buttons.
 *
 * CSS cannot tell an icon-only button from one whose label is a bare text node
 * (":only-child" matches both, and removing the margin there changed the
 * spacing of 137 labelled buttons). assets/js/umm-icon-only.js marks the
 * buttons that show nothing but one icon — a hidden label, a screen-reader
 * label or an absolutely positioned badge do not count as content — with
 * .umm-icon-only, and keeps the mark current as buttons are added, relabelled
 * or resized. Only those lose the margin; every labelled button is untouched.
 *
 * (0,5,2): above base.css's own (0,4,2) !important rule.
 */
html body.wp-admin .umm-icon-only.umm-icon-only .dashicons.dashicons {
    margin-left: 0 !important;
    margin-right: 0 !important;
}
