/* Admin UI Styles v1.5 */
.affloc-admin-wrap {
    width: 98%;
    margin-top: 20px;
}

.affloc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.affloc-header h1 {
    margin: 0;
}

#affloc-search {
    width: 300px;
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid #ccd0d4;
}

.affloc-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.affloc-card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e5e5;
}

.affloc-card h2 {
    margin-top: 0;
    font-size: 1.25rem;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 20px;
}

.affloc-field {
    margin-bottom: 15px;
}

.affloc-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.affloc-field input {
    width: 100%;
}

/* Country Selector */
.affloc-select-custom {
    position: relative;
}

.affloc-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccd0d4;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.affloc-dropdown.is-open {
    display: block;
}

.affloc-dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f9f9f9;
}

.affloc-dropdown-item:hover {
    background: #f0f5fa;
}

/* Table */
.affloc-table-card {
    padding: 0;
    overflow: hidden;
}

.affloc-table-card h2 {
    padding: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.affloc-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
}

#affloc-table {
    border: none;
    box-shadow: none;
}

.group-header {
    background: #f0f6fb !important;
}

.group-header td {
    padding: 12px 15px !important;
    border-top: 1px solid #dcdcde !important;
    border-bottom: 1px solid #dcdcde !important;
}

.affloc-row td {
    vertical-align: middle;
    background: #fff;
}

/* Manual Zebra Striping for Groups */
.affloc-row.alternate td {
    background: #f6f7f7;
}

.truncated-text {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Custom File Input Styling */
.affloc-file-input-wrapper {
    position: relative;
    border: 1px dashed #c3c4c7;
    border-radius: 4px;
    background: #f6f7f7;
    transition: all 0.2s;
    text-align: center;
    padding: 12px;
    cursor: pointer;
}

.affloc-file-input-wrapper:hover {
    border-color: #2271b1;
    background: #f0f0f1;
}

.affloc-file-input-wrapper input[type="file"] {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.affloc-file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #50575e;
    font-size: 13px;
    cursor: pointer;
}

.affloc-file-label i {
    font-size: 20px;
    color: #2271b1;
}

.affloc-file-name {
    font-weight: 600;
    color: #2271b1;
    margin-top: 5px;
}

/* Group Toggle Styling */
.group-header {
    background: #f0f6fb !important;
    cursor: pointer;
    user-select: none;
}

.affloc-toggle {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    margin-right: 8px;
    transition: transform 0.2s ease;
    font-size: 10px;
}

.group-header.collapsed .affloc-toggle {
    transform: rotate(-90deg);
}

.group-header td {
    padding: 12px 15px !important;
}

.copy-shortcode-box {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.copy-shortcode-box code {
    background: #f0f0f0;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: block;
    word-break: break-all;
    box-sizing: border-box;
}

.copy-shortcode-box .copy-btn {
    width: 100%;
}

.affloc-help-card {
    background: #f0f6fb;
    border-left: 4px solid #2271b1;
}

.affloc-help-card code {
    display: block;
    background: #fff;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
}

.country-flag-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.affloc-flag-icon {
    width: 20px;
    height: auto;
    border: 1px solid #f0f0f0;
    border-radius: 2px;
    vertical-align: middle;
}

.affloc-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f9f9f9;
}

/* Sorting & Actions */
.cursor-pointer {
    cursor: pointer;
}

.affloc-sort-icons {
    display: inline-flex;
    flex-direction: column;
    font-size: 8px;
    line-height: 1;
    margin-left: 5px;
    vertical-align: middle;
}

.highlight-form {
    box-shadow: 0 0 0 2px #2271b1, 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.row-actions.visible {
    visibility: visible;
    display: block;
    margin-top: 4px;
    font-size: 13px;
    position: static;
}