/**
 * UI/UX Overhaul for Autocomplete Google Address Admin
 */

/* Main Layout & Cards */
.aga-form-config-wrapper,
#aga-settings-page {
    margin-top: 20px;
    padding-bottom: 150px;
}

.aga-box {
    background: #fff;
    border: 1px solid #e2e4e7;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
    border-radius: 4px;
    margin-bottom: 25px;
}

.aga-box-header {
    border-bottom: 1px solid #e2e4e7;
    padding: 12px 20px;
    background: #fcfcfc;
    display: flex;
    align-items: center;
    gap: 10px;
}

.aga-box-header h2 {
    margin: 0;
    font-size: 16px;
    padding: 0;
    font-weight: 600;
}

.aga-box-header .dashicons {
    color: #50575e;
}

.aga-box-body {
    padding: 20px;
    line-height: 1.7;
}

.aga-box-body hr {
    border: 0;
    border-top: 1px solid #e2e4e7;
    margin: 25px 0;
}

/* Two-column layout for config page */
.aga-config-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

@media screen and (max-width: 1200px) {
    .aga-config-columns {
        grid-template-columns: 1fr;
    }
}

.aga-config-col {
    min-width: 0;
}

/* Form Fields & Typography */
.aga-field-group {
    margin-bottom: 20px;
}

.aga-field-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3338;
}

.aga-field-group input[type="text"],
.aga-field-group select {
    width: 100%;
}

.aga-field-group p.description {
    font-size: 13px;
    color: #50575e;
    margin-top: 8px;
    font-style: normal;
}

/* Mode Selector (Tabs) */
.aga-mode-selector {
    display: flex;
    border: 1px solid #b4b9be;
    border-radius: 3px;
    overflow: hidden;
}

.aga-mode-selector input[type="radio"] {
    display: none; /* Hide the actual radio button */
}

.aga-mode-selector label {
    flex: 1;
    text-align: center;
    padding: 10px 15px;
    margin: 0;
    cursor: pointer;
    background: #f3f5f6;
    color: #1d2327;
    font-weight: 600;
    border-left: 1px solid #b4b9be;
    transition: background .1s ease-in-out;
}

.aga-mode-selector label:first-of-type {
    border-left: 0;
}

.aga-mode-selector label:hover {
    background: #e9eaec;
}

.aga-mode-selector input[type="radio"]:checked + label {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

/* Mode-specific content panels */
.aga-mode-panel {
    display: none;
}

.aga-mode-panel.active {
    display: block;
}

/* Smart mapping fields grid */
.aga-mapping-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Toggle Switch */
.aga-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
}
.aga-switch input { opacity: 0; width: 0; height: 0; }
.aga-slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc; transition: .4s; border-radius: 28px;
}
.aga-slider:before {
    position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px;
    background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .aga-slider { background-color: #2271b1; }
input:checked + .aga-slider:before { transform: translateX(20px); }

/* Premium Feature Gating */
.aga-premium-locked-icon {
    color: #a00;
    font-size: 1.2em;
    vertical-align: middle;
    margin-right: 5px;
}

.aga-premium-locked-text {
    font-weight: 600;
    color: #a00;
    vertical-align: middle;
}

.aga-premium-upgrade-link {
    margin-left: 10px;
    display: inline-block;
    text-decoration: none;
    color: #2271b1;
    font-weight: 600;
}

.aga-premium-upgrade-link:hover {
    color: #0a4b78;
}

.aga-premium-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 10;
    border-radius: 4px;
}

.aga-premium-overlay .aga-premium-message {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #c3c4c7;
    padding: 20px 30px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    max-width: 400px;
    line-height: 1.5;
}

.aga-premium-overlay .aga-premium-message a.button-primary {
    margin-top: 15px;
    background: #2271b1;
    border-color: #2271b1;
    box-shadow: none;
    text-shadow: none;
}

.aga-premium-overlay .aga-premium-message a.button-primary:hover {
    background: #1a5a8e;
    border-color: #1a5a8e;
}

/* Styling for content behind overlay */
.aga-premium-gated-content {
    position: relative; /* For the blur filter */
}


/* Ensure disabled inputs are styled */
.aga-field-group input:disabled,
.aga-field-group select:disabled {
    background-color: #f9f9f9;
    cursor: not-allowed;
    opacity: 0.7;
}


/* Select2 overrides */
.select2-container--default .select2-selection--multiple {
    border: 1px solid #8c8f94;
    border-radius: 3px;
}
.select2-container .select2-selection--multiple .select2-selection__choice {
    background-color: #28a745; /* Green */
    color: black;
    border: 1px solid #218838; /* Darker green border */
    border-radius: 3px;
}
.select2-container .select2-selection--multiple .select2-selection__choice__remove {
    color: rgba(0, 0, 0, 0.5);
    margin-right: 5px;
}
.select2-container .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: black;
}
.select2-dropdown {
    border: 1px solid #8c8f94;
    border-radius: 3px;
}

#wpfooter {
    position: relative !important;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 20px;
    color: #50575e;
}