/* =============================================
   GENERAL STYLES 
   ============================================= */

/* Main wrapper for all frontend elements */
.cupm-frontend-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin: 2em 0;
}

/* Header section containing title and buttons */
.cupm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5em;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 1em;
}

.cupm-header h2 {
    margin: 0;
    font-size: 24px;
}

/* =============================================
   BUTTON STYLES 
   ============================================= */

/* Base button styles */
.cupm-button {
    display: inline-block;
    text-decoration: none;
    font-size: 13px;
    line-height: 2.15;
    min-height: 30px;
    margin: 0;
    padding: 0 12px;
    cursor: pointer;
    border-width: 1px;
    border-style: solid;
    border-radius: 3px;
    background: #f0f0f1;
    border-color: #8c8f94;
    color: #2c3338;
    vertical-align: top;
    text-align: center;
}

.cupm-button:hover {
    background: #f6f7f7;
    border-color: #0a4b78;
    color: #0a4b78;
}

/* Primary button variant */
.cupm-button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.cupm-button-primary:hover {
    background: #135e96;
    border-color: #135e96;
    color: #fff;
}

/* =============================================
   NOTICE STYLES 
   ============================================= */

/* Base notice styles */
.cupm-notice {
    padding: 1em 40px 1em 1.5em;
    margin-bottom: 1.5em;
    border-left-width: 4px;
    border-left-style: solid;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    position: relative;
}

/* Success notice variant */
.cupm-notice-success {
    background: #f0f8ff;
    border-left-color: #79c6e8;
}

/* Error notice variant */
.cupm-notice-error {
    background: #fff8f8;
    border-left-color: #d63638;
}

/* Notice dismiss button */
.cupm-notice-dismiss {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #555;
    opacity: 0.7;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.cupm-notice-dismiss:hover {
    opacity: 1;
}

/* =============================================
   FILTER AND SEARCH STYLES (Simplified)
   ============================================= 
   Changes from old version:
   - Removed color filter specific styles
   - Maintained core filter layout structure */

/* Main filter container */
.cupm-filters-wrap {
    display: block;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 1.5em;
}

/* Search filter section */
.cupm-search-filter {
    width: 100%;
    margin-bottom: 15px;
}

/* Dropdown filters container */
.cupm-dropdown-filters {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

/* Individual filter items */
.cupm-dropdown-filters .cupm-filter-item {
    flex: 1;
    min-width: 200px;
}

/* Input and select styles within filters */
.cupm-filters-wrap input[type="search"],
.cupm-filters-wrap select {
    width: 100%;
    padding: 8px;
    border: 1px solid #8c8f94;
    border-radius: 3px;
}

/* =============================================
   LOADING SPINNER STYLES
   ============================================= */

.cupm-loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: cupm-spin 1s linear infinite;
}

@keyframes cupm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =============================================
   TABLE STYLES 
   ============================================= */

/* Base table styles */
.cupm-frontend-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.cupm-frontend-table th,
.cupm-frontend-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.cupm-frontend-table th {
    background-color: #f9f9f9;
    font-size: 14px;
    font-weight: 600;
}

.cupm-frontend-table tr:hover {
    background-color: #f6f7f7;
}

/* Cell containing action buttons */
.cupm-frontend-table .cupm-actions-cell {
    display: flex;
    gap: 8px;
}

/* Sortable table headers */
.cupm-frontend-table.sortable th a {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
}

.cupm-frontend-table.sortable th a:hover {
    color: #2271b1;
}

.cupm-frontend-table.sortable .sorting-indicator {
    font-size: 10px;
    margin-left: 5px;
    color: #2271b1;
    line-height: 1;
}

/* Status indicators */
.cupm-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-active {
    background-color: #2271b1;
}

.status-inactive {
    background-color: #d63638;
}

.status-pending {
    background-color: #f0ad4e;
}

/* Color tag display (kept for table display) */
.cupm-color-tag-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cupm-color-box {
    width: 20px;
    height: 20px;
    border: 1px solid rgba(0,0,0,0.1);
    display: inline-block;
    border-radius: 4px;
    flex-shrink: 0;
}

/* =============================================
   FORM STYLES 
   ============================================= */

.cupm-frontend-form .cupm-form-field {
    margin-bottom: 1.5em;
}

.cupm-frontend-form label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.cupm-frontend-form input[type="text"],
.cupm-frontend-form select {
    width: 100%;
    /*max-width: 100%;*/
    padding: 8px;
    border: 1px solid #8c8f94;
    border-radius: 3px;
}

.cupm-frontend-form input[type="color"] {
    height: 40px;
    width: 100px;
}

/* =============================================
   RESPONSIVE STYLES 
   ============================================= */

@media screen and (max-width: 782px) {
    /* Mobile table styles */
    .cupm-frontend-table thead {
        display: none;
    }
    
    .cupm-frontend-table,
    .cupm-frontend-table tbody,
    .cupm-frontend-table tr,
    .cupm-frontend-table td {
        display: block;
        width: 100%;
    }
    
    .cupm-frontend-table tr {
        margin-bottom: 15px;
        border: 1px solid #e0e0e0;
    }
    
    .cupm-frontend-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
    }
    
    .cupm-frontend-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: calc(50% - 30px);
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 600;
    }
    
    .cupm-frontend-table .cupm-actions-cell {
        justify-content: flex-end;
    }

    /* Filter adjustments for mobile */
    .cupm-dropdown-filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .cupm-dropdown-filters .cupm-filter-item {
        width: 100%;
        min-width: 0;
    }
}