/* Find Partners & Manage Partners */

.find-partners,
.manage-partners {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
}

.find-partners *, .find-partners *::before, .find-partners *::after,
.manage-partners *, .manage-partners *::before, .manage-partners *::after {
    box-sizing: border-box;
}

/* Auth/Not Merchant State */
.fp-auth-required {
    text-align: center;
    padding: 60px 20px;
    max-width: 400px;
    margin: 0 auto;
}

.fp-auth-icon {
    margin-bottom: 16px;
}

.fp-auth-required h3 {
    margin: 0 0 8px;
    font-size: 20px;
    color: #333;
}

.fp-auth-required p {
    margin: 0 0 20px;
    color: #666;
    font-size: 14px;
}

/* Search Bar */
.fp-search-bar {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 24px;
}

.fp-search-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: stretch;
}

.fp-search-field {
    flex: 0 0 auto;
}

.fp-search-text {
    flex: 1 1 200px;
}

.fp-search-text input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.fp-search-text input:focus {
    border-color: #4a90d9;
}

.fp-search-radius select,
.fp-search-category select {
    padding: 10px 14px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    outline: none;
}

.fp-search-category {
    flex: 0 1 180px;
    min-width: 120px;
}

.fp-search-category select {
    width: 100%;
}

.fp-location-info {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}

@media (max-width: 640px) {
    .fp-search-row {
        flex-direction: column;
    }
    .fp-search-field {
        flex: 1 1 100%;
    }
    .fp-search-category {
        flex: 1 1 100%;
    }
}

/* Buttons */
.fp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.fp-btn-primary {
    background: #4a90d9;
    color: #fff;
}

.fp-btn-primary:hover {
    background: #3a7bc8;
}

.fp-btn-outline {
    background: #fff;
    color: #4a90d9;
    border: 1px solid #4a90d9;
}

.fp-btn-outline:hover {
    background: #f0f5ff;
}

.fp-btn-danger {
    background: #fff;
    color: #dc3545;
    border: 1px solid #dc3545;
}

.fp-btn-danger:hover {
    background: #fff5f5;
}

.fp-btn-accept {
    background: #28a745;
    color: #fff;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.fp-btn-accept:hover {
    background: #218838;
}

/* Loading */
.fp-loading {
    text-align: center;
    padding: 48px 20px;
    color: #666;
}

.fp-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e0e0;
    border-top-color: #4a90d9;
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: fp-spin 0.8s linear infinite;
}

@keyframes fp-spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.fp-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.fp-empty h3 {
    margin: 16px 0 8px;
    color: #333;
}

.fp-empty p {
    margin: 0;
    font-size: 14px;
}

/* Card Grid */
.fp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

/* Card */
.fp-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}

.fp-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.fp-card-logo {
    display: flex;
    justify-content: center;
    padding: 20px 20px 12px;
    background: linear-gradient(135deg, #f8f9fa, #eef2f7);
}

.fp-card-logo img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: contain;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.fp-card-body {
    flex: 1;
    padding: 0 16px 12px;
    text-align: center;
}

.fp-card-name {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fp-card-name a {
    color: #333;
    text-decoration: none;
}

.fp-card-name a:hover {
    color: #4a90d9;
}

.fp-card-category {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    background: #e8f4fd;
    color: #2c6fa0;
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 6px;
}

.fp-card-location {
    margin: 0 0 4px;
    font-size: 13px;
    color: #666;
}

.fp-card-distance {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f0f0f0;
    color: #555;
    font-size: 11px;
    font-weight: 500;
}

.fp-card-action {
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
}

.fp-card-action .fp-btn,
.fp-card-action .fp-btn-partner-up {
    width: 100%;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
}

.fp-card-action .fp-btn-partner-up {
    background: #4a90d9;
    color: #fff;
    transition: background 0.2s;
}

.fp-card-action .fp-btn-partner-up:hover {
    background: #3a7bc8;
}

.fp-btn-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: none;
}

.fp-btn-pending {
    background: #f0f0f0;
    color: #888;
    cursor: default;
}

.fp-btn-partner {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Load More */
.fp-load-more {
    text-align: center;
    padding: 24px 0;
}

.fp-result-count {
    margin-top: 8px;
    font-size: 13px;
    color: #888;
}

/* Toast */
.fp-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s;
}

.fp-toast-show {
    opacity: 1;
    transform: translateY(0);
}

.fp-toast-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.fp-toast-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.fp-toast-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ===== Manage Partners Specific Styles ===== */

/* Tabs */
.mp-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e8e8e8;
    margin-bottom: 20px;
}

.mp-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.mp-tab:hover {
    color: #555;
}

.mp-tab.active {
    color: #4a90d9;
    border-bottom-color: #4a90d9;
}

.mp-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #e0e0e0;
    color: #666;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
}

.mp-tab.active .mp-tab-badge {
    background: #4a90d9;
    color: #fff;
}

/* Partner List Cards (horizontal for manage view) */
.mp-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mp-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow 0.2s;
}

.mp-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.mp-card-logo img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: contain;
    border: 1px solid #eee;
}

.mp-card-info {
    flex: 1;
    min-width: 0;
}

.mp-card-info h5 {
    margin: 0 0 2px;
    font-size: 15px;
    font-weight: 600;
}

.mp-card-info h5 a {
    color: #333;
    text-decoration: none;
}

.mp-card-info h5 a:hover {
    color: #4a90d9;
}

.mp-card-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #888;
    flex-wrap: wrap;
}

.mp-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.mp-card-stats {
    display: flex;
    gap: 16px;
    text-align: center;
}

.mp-card-stat-val {
    font-size: 16px;
    font-weight: 600;
    color: #4a90d9;
}

.mp-card-stat-lbl {
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
}

.mp-card-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.mp-card-actions .fp-btn {
    padding: 6px 14px;
    font-size: 12px;
}

@media (max-width: 768px) {
    .mp-card {
        flex-wrap: wrap;
    }
    .mp-card-stats {
        width: 100%;
        justify-content: space-around;
        padding-top: 12px;
        border-top: 1px solid #f0f0f0;
    }
    .mp-card-actions {
        width: 100%;
        justify-content: flex-end;
        padding-top: 12px;
    }
}

/* Empty Tab State */
.mp-empty-tab {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.mp-empty-tab p {
    margin: 8px 0 0;
    font-size: 14px;
}

/* Edit Offer Modal */
.mp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mp-modal {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 460px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.mp-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mp-modal-header h4 {
    margin: 0;
    font-size: 16px;
}

.mp-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
}

.mp-modal-body {
    padding: 20px;
}

.mp-form-group {
    margin-bottom: 16px;
}

.mp-form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 14px;
}

.mp-form-group input,
.mp-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.mp-form-group input:focus,
.mp-form-group textarea:focus {
    border-color: #4a90d9;
}

.mp-form-group small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #888;
}

.mp-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e8e8e8;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
