/**
 * AG Antique Cabinet Styles
 * Version: 1.3.0
 *
 * Ці стилі зберігаються в плагіні і не залежать від теми.
 * Після оновлення теми або WordPress - стилі залишаться.
 */

/* ===== General ===== */
.ag-my-searches {
    padding: 20px 0;
}

.ag-searches-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.ag-searches-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 400;
}

.ag-btn-new-search {
    background: #333 !important;
    color: #fff !important;
    border: none !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
}

.ag-btn-new-search:hover {
    background: #555 !important;
}

/* ===== Empty State ===== */
.ag-no-searches {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 4px;
}

.ag-no-searches p {
    margin: 0 0 10px;
    font-size: 16px;
    color: #666;
}

.ag-hint {
    font-size: 14px !important;
    color: #999 !important;
}

/* ===== Search Items ===== */
.ag-searches-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ag-search-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    transition: box-shadow 0.2s;
}

.ag-search-item:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.ag-search-info {
    flex: 1;
}

.ag-search-name {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 500;
}

.ag-search-info p {
    margin: 0 0 5px;
    font-size: 14px;
    color: #666;
}

.ag-search-info p strong {
    color: #333;
}

.ag-search-notify .ag-on {
    color: #2ecc71;
}

.ag-search-notify .ag-off {
    color: #999;
}

.ag-search-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    margin-left: 20px;
}

.ag-search-actions .button {
    padding: 8px 15px !important;
    font-size: 13px !important;
}

.ag-btn-delete {
    color: #e74c3c !important;
    border-color: #e74c3c !important;
}

.ag-btn-delete:hover {
    background: #e74c3c !important;
    color: #fff !important;
}

/* ===== Modal ===== */
.ag-search-form-modal,
.ag-results-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ag-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.ag-modal-content {
    position: relative;
    background: #fff;
    border-radius: 4px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    animation: agModalAppear 0.2s ease;
}

.ag-modal-wide {
    max-width: 800px;
}

@keyframes agModalAppear {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ag-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ag-modal-close:hover {
    color: #333;
}

.ag-modal-title {
    margin: 0 0 25px;
    font-size: 20px;
    font-weight: 500;
}

/* ===== Form ===== */
.ag-form-group {
    margin-bottom: 20px;
}

.ag-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.ag-form-group input[type="text"],
.ag-form-group input[type="number"],
.ag-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.ag-form-group input:focus,
.ag-form-group textarea:focus {
    border-color: #333;
    outline: none;
}

.ag-categories-select {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
}

.ag-cat-checkbox {
    display: block;
    padding: 5px 0;
    font-weight: normal !important;
    cursor: pointer;
}

.ag-cat-checkbox input {
    margin-right: 8px;
}

.ag-price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ag-price-inputs input {
    width: 120px !important;
}

.ag-checkbox-label {
    font-weight: normal !important;
    cursor: pointer;
}

.ag-checkbox-label input {
    margin-right: 8px;
}

.ag-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.ag-form-actions .button-primary {
    background: #333 !important;
    border-color: #333 !important;
}

/* ===== Results ===== */
.ag-results-count {
    margin-bottom: 20px;
    padding: 10px 15px;
    background: #f9f9f9;
    border-radius: 4px;
    font-size: 14px;
}

.ag-results-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.ag-result-item {
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.ag-result-item:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ag-result-img {
    height: 150px;
    background-size: cover;
    background-position: center;
    background-color: #f5f5f5;
}

.ag-result-info {
    padding: 12px;
}

.ag-result-info h4 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
}

.ag-result-info h4 a {
    color: #333;
    text-decoration: none;
}

.ag-result-info h4 a:hover {
    text-decoration: underline;
}

.ag-result-price {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* ===== My Offers ===== */
.ag-my-offers {
    padding: 20px 0;
}

.ag-offers-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.ag-offers-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 400;
}

/* Grid layout: 3 columns */
.ag-offers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.ag-offer-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.ag-offer-card:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.ag-offer-card-img {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f5f5f5;
}

.ag-offer-card-img a {
    display: block;
    width: 100%;
    height: 100%;
}

.ag-offer-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ag-offer-card-noimg {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
}

.ag-offer-card-img .ag-offer-badge {
    position: absolute;
    top: 10px;
    left: 10px;
}

.ag-offer-card-body {
    padding: 15px;
}

.ag-offer-card-title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ag-offer-card-title a {
    color: #333;
    text-decoration: none;
}

.ag-offer-card-title a:hover {
    text-decoration: underline;
}

.ag-offer-card-prices {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 13px;
}

.ag-offer-original {
    color: #999;
    text-decoration: line-through;
}

.ag-offer-arrow {
    color: #ccc;
}

.ag-offer-offered {
    font-weight: 600;
    color: #333;
}

.ag-offer-discount {
    color: #2e7d32;
    font-weight: 500;
    font-size: 12px;
}

.ag-offer-counter {
    margin-bottom: 8px;
    padding: 6px 10px;
    background: #e3f2fd;
    border-radius: 4px;
    font-size: 13px;
    color: #1565c0;
}

.ag-offer-card-date {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

.ag-offer-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
}

.ag-offer-badge-pending { background: #fff3e0; color: #e65100; }
.ag-offer-badge-accepted { background: #e8f5e9; color: #2e7d32; }
.ag-offer-badge-rejected { background: #ffebee; color: #c62828; }
.ag-offer-badge-counter { background: #e3f2fd; color: #1565c0; }
.ag-offer-badge-cancelled { background: #f5f5f5; color: #757575; }

.ag-offer-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ag-offer-card-actions .button {
    padding: 5px 12px !important;
    font-size: 12px !important;
    flex: 1;
    text-align: center;
}

.ag-offer-card-actions .ag-counter-wrap {
    flex-basis: 100%;
}

.ag-btn-cancel-offer {
    color: #e74c3c !important;
    border-color: #e74c3c !important;
}

.ag-btn-cancel-offer:hover {
    background: #e74c3c !important;
    color: #fff !important;
}

.ag-offers-show-more {
    text-align: center;
    margin-top: 30px;
}

.ag-btn-show-more-offers {
    padding: 10px 40px !important;
}

/* ===== Notification Badge ===== */
.nm-menu-account .ag-offers-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #e65100;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
}

.nm-menu-account {
    position: relative;
}

.nm-menu-account a {
    position: relative;
}

/* ===== Dashboard Offers Widget ===== */
.ag-dashboard-offers {
    margin: 20px 0;
    padding: 25px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
}

.ag-dashboard-offers-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.ag-dashboard-offers h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}

.ag-dashboard-offers-stats {
    display: flex;
    gap: 8px;
}

.ag-dash-chip {
    display: inline-block;
    padding: 4px 12px;
    background: #f5f5f5;
    border-radius: 20px;
    font-size: 12px;
    color: #666;
}

.ag-dashboard-offers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.ag-dash-offer {
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.ag-dash-offer:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.ag-dash-offer-img {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f5f5f5;
}

.ag-dash-offer-img a {
    display: block;
    width: 100%;
    height: 100%;
}

.ag-dash-offer-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ag-dash-offer-img .ag-offer-badge {
    position: absolute;
    top: 8px;
    left: 8px;
}

.ag-dash-offer-body {
    padding: 12px;
}

.ag-dash-offer-title {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ag-dash-offer-title a {
    color: #333;
    text-decoration: none;
}

.ag-dash-offer-title a:hover {
    text-decoration: underline;
}

.ag-dashboard-offers-link {
    font-size: 14px;
    color: #8B7355;
    text-decoration: none;
}

.ag-dashboard-offers-link:hover {
    text-decoration: underline;
}

/* Counter input for user counter-offer */
.ag-counter-wrap {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.ag-counter-input {
    width: 90px !important;
    height: 32px !important;
    padding: 4px 8px !important;
    font-size: 13px !important;
    border: 1px solid #ccc !important;
    border-radius: 3px !important;
}

.ag-btn-customer-counter {
    background: #8B7355 !important;
    color: #fff !important;
    border-color: #8B7355 !important;
    white-space: nowrap;
}

.ag-btn-customer-counter:hover {
    background: #6d5a43 !important;
    border-color: #6d5a43 !important;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .ag-searches-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .ag-search-item {
        flex-direction: column;
    }

    .ag-search-actions {
        margin-left: 0;
        margin-top: 15px;
        width: 100%;
    }

    .ag-search-actions .button {
        flex: 1;
    }

    .ag-offers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .ag-dashboard-offers-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ag-dashboard-offers-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .ag-modal-content {
        padding: 20px;
    }

    .ag-price-inputs {
        flex-wrap: wrap;
    }

    .ag-price-inputs input {
        width: 100% !important;
    }

    .ag-results-list {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .ag-results-list {
        grid-template-columns: 1fr;
    }

    .ag-offers-grid {
        grid-template-columns: 1fr;
    }
}
