/**
 * Checkout Toolkit for WooCommerce - Admin Styles
 *
 * @package CheckoutToolkitForWoo
 */

/* Settings Page */
.marwchto-settings-wrap {
    max-width: 900px;
}

.marwchto-settings-wrap h1 {
    margin-bottom: 20px;
}

.marwchto-nav-tabs {
    margin-bottom: 20px;
}

.marwchto-settings-table th {
    width: 200px;
    padding: 20px 10px 20px 0;
}

.marwchto-settings-table td {
    padding: 15px 10px;
}

.marwchto-settings-table .description {
    color: #666;
    font-style: italic;
    margin-top: 5px;
}

/* Blocked Dates Manager */
.marwchto-blocked-dates-manager {
    max-width: 400px;
}

.marwchto-add-date-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.marwchto-add-date-row input {
    flex: 1;
}

.marwchto-blocked-dates-list {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.marwchto-blocked-date-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 3px;
    margin-bottom: 5px;
}

.marwchto-blocked-date-item:last-child {
    margin-bottom: 0;
}

.marwchto-date-display {
    font-weight: 500;
}

.marwchto-remove-date {
    color: #a00 !important;
    text-decoration: none;
}

.marwchto-remove-date:hover {
    color: #dc3232 !important;
}

.marwchto-no-dates {
    color: #666;
    font-style: italic;
    margin: 0;
    padding: 5px;
}

/* Flatpickr in admin */
.marwchto-datepicker-admin {
    width: 200px;
}

/* Order Meta Box */
#wct_order_details .inside p {
    margin: 10px 0;
}

#wct_order_details .inside p:first-child {
    margin-top: 0;
}

#wct_order_details .inside p:last-child {
    margin-bottom: 0;
}

#wct_order_details strong {
    display: block;
    margin-bottom: 3px;
    color: #23282d;
}

/* Select/Dropdown Options (Custom Fields) */
.marwchto-select-options-wrapper {
    border: 1px solid #c3c4c7;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-top: 10px;
}
.marwchto-select-option-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}
.marwchto-select-option-row input {
    flex: 1;
}
.marwchto-select-option-row .button-link-delete {
    color: #b32d2e;
    text-decoration: none;
}
.marwchto-select-option-row .button-link-delete:hover {
    color: #a00;
}

/* Conditional Fields */
.marwchto-conditional-field {
    display: none;
}
.marwchto-conditional-field.active {
    display: table-row;
}

/* Disabled State */
.marwchto-field-options-disabled {
    opacity: 0.5;
    pointer-events: none;
}
.marwchto-field-options-disabled input,
.marwchto-field-options-disabled select,
.marwchto-field-options-disabled textarea,
.marwchto-field-options-disabled button,
.marwchto-field-options-disabled a {
    pointer-events: none;
}

/* Visibility Settings */
.marwchto-visibility-options {
    border: 1px solid #c3c4c7;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-top: 10px;
}
.marwchto-visibility-products,
.marwchto-visibility-categories {
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}
.marwchto-visibility-products.active,
.marwchto-visibility-categories.active {
    display: block;
}
.marwchto-visibility-mode {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}
.marwchto-category-checkboxes {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 10px;
    background: #fff;
}
.marwchto-category-checkboxes label {
    display: block;
    margin-bottom: 5px;
}
.marwchto-visibility-products .select2-container {
    min-width: 400px;
}

/* Store Locations Settings */
.marwchto-locations-wrapper {
    border: 1px solid #c3c4c7;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-top: 10px;
}
.marwchto-location-row {
    background: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    position: relative;
}
.marwchto-location-row:last-child {
    margin-bottom: 0;
}
.marwchto-location-row .marwchto-location-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.marwchto-location-row .marwchto-location-header h4 {
    margin: 0;
    font-size: 14px;
}
.marwchto-location-row .marwchto-location-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.marwchto-location-row .marwchto-location-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.marwchto-location-row .marwchto-location-field.full-width {
    grid-column: 1 / -1;
}
.marwchto-location-row .marwchto-location-field label {
    font-weight: 500;
    font-size: 13px;
}
.marwchto-location-row .marwchto-location-field input,
.marwchto-location-row .marwchto-location-field textarea {
    width: 100%;
}
.marwchto-location-row .button-link-delete {
    color: #b32d2e;
    text-decoration: none;
}
.marwchto-location-row .button-link-delete:hover {
    color: #a00;
}

/* Preset Options (Delivery Instructions) */
.marwchto-preset-options-wrapper {
    border: 1px solid #c3c4c7;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-top: 10px;
}
.marwchto-preset-option-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}
.marwchto-preset-option-row input {
    flex: 1;
}
.marwchto-preset-option-row .button-link-delete {
    color: #b32d2e;
    text-decoration: none;
}
.marwchto-preset-option-row .button-link-delete:hover {
    color: #a00;
}

/* Dashboard Widget */
.marwchto-widget-content {
    padding: 10px 0;
}
.marwchto-widget-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}
.marwchto-widget-stat {
    flex: 1;
    text-align: center;
    padding: 10px;
    background: #f6f7f7;
    border-radius: 4px;
}
.marwchto-widget-stat .stat-number {
    display: block;
    font-size: 28px;
    font-weight: 600;
    color: #1d2327;
}
.marwchto-widget-stat .stat-label {
    display: block;
    font-size: 12px;
    color: #646970;
}
.marwchto-widget-breakdown h4 {
    margin: 0 0 10px;
    font-size: 13px;
}
.marwchto-status-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.marwchto-status-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f1;
}
.marwchto-status-list li:last-child {
    border-bottom: none;
}
.marwchto-widget-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}
.marwchto-widget-actions .button {
    flex: 1;
    text-align: center;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .marwchto-settings-table th {
        width: 100%;
        display: block;
        padding-bottom: 5px;
    }

    .marwchto-settings-table td {
        display: block;
        padding-top: 5px;
    }

    .marwchto-add-date-row {
        flex-direction: column;
    }

    .marwchto-add-date-row input {
        width: 100%;
    }

    .marwchto-location-row .marwchto-location-fields {
        grid-template-columns: 1fr;
    }
}
