/**
 * Member Dashboard Styles
 */

.agl-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.agl-dashboard-notice {
    padding: 20px;
    background: #fef3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    color: #856404;
    text-align: center;
}

/* Header */
.agl-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e5e5;
}

.agl-dashboard-welcome h1 {
    margin: 0 0 5px 0;
    font-size: 28px;
    color: #1a1a1a;
}

.agl-dashboard-welcome p {
    margin: 0;
    color: #666;
}

.agl-dashboard-membership {
    text-align: right;
}

.agl-membership-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.agl-location-count {
    display: block;
    margin-top: 8px;
    color: #666;
    font-size: 13px;
}

/* Filters */
.agl-dashboard-filters {
    margin-bottom: 24px;
    padding: 16px 20px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.agl-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 12px;
}

.agl-filter-row-secondary {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
}

.agl-filter-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 13px;
}

.agl-filter-field input,
.agl-filter-field select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
}

.agl-filter-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.agl-filter-row-advanced {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    padding-top: 8px;
    border-top: 1px dashed #e5e7eb;
}

.agl-filter-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
}

.agl-filter-results {
    font-size: 13px;
    color: #6b7280;
}

/* Load More */
.agl-dashboard-load-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    gap: 10px;
}

#agl-load-more-sentinel {
    width: 100%;
    height: 1px;
}

/* Locations Grid */
.agl-dashboard-locations {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.agl-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px dashed #e5e5e5;
}

.agl-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.agl-empty-state h3 {
    margin: 0 0 8px 0;
    color: #1a1a1a;
}

.agl-empty-state p {
    margin: 0;
    color: #666;
}

/* Location Card */
.agl-location-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s, transform 0.2s;
}

.agl-location-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.agl-location-image {
    position: relative;
    height: 160px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
}

.agl-location-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agl-location-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    opacity: 0.5;
}

.agl-status-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.agl-company-owned-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(2, 132, 199, 0.95);
    color: #fff;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.agl-status-publish {
    background: #dcfce7;
    color: #16a34a;
}

.agl-status-draft {
    background: #fef3c7;
    color: #d97706;
}

.agl-status-pending {
    background: #dbeafe;
    color: #2563eb;
}

.agl-location-info {
    padding: 16px 20px;
}

.agl-location-info h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #1a1a1a;
}

.agl-location-address {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.agl-location-actions {
    display: flex;
    gap: 8px;
    padding: 0 20px 20px;
}

/* Buttons */
.agl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.agl-btn-edit {
    flex: 1;
    background: #3b82f6;
    color: white;
}

.agl-btn-edit:hover {
    background: #2563eb;
}

.agl-btn-filter {
    flex: 1;
    background: #3b82f6;
    color: white;
}

.agl-btn-filter:hover {
    background: #2563eb;
}

.agl-btn-view {
    flex: 1;
    background: #f3f4f6;
    color: #374151;
}

.agl-btn-view:hover {
    background: #e5e7eb;
}

.agl-btn-view.is-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.agl-btn-save {
    background: #10b981;
    color: white;
}

.agl-btn-save:hover {
    background: #059669;
}

.agl-btn-cancel {
    background: #f3f4f6;
    color: #374151;
}

.agl-btn-upload {
    background: #f3f4f6;
    color: #374151;
    border: 2px dashed #d1d5db;
}

.agl-btn-upload:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

/* Modal */
.agl-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.agl-modal-container {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.agl-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
}

.agl-modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.agl-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

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

.agl-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.agl-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e5e5e5;
    background: #f9fafb;
}

/* Tabs */
.agl-tabs {
    display: flex;
    border-bottom: 1px solid #e5e5e5;
    background: #f9fafb;
    overflow-x: auto;
}

.agl-tab {
    padding: 14px 20px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.agl-tab:hover {
    color: #333;
}

.agl-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.agl-tab-content {
    display: none;
    padding: 24px;
}

.agl-tab-content.active {
    display: block;
}

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

.agl-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
}

.agl-form-group input[type="text"],
.agl-form-group input[type="email"],
.agl-form-group input[type="tel"],
.agl-form-group input[type="url"],
.agl-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.agl-form-group input:focus,
.agl-form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.agl-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.agl-char-count {
    display: block;
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* Images Grid */
.agl-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.agl-image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
}

.agl-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agl-image-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.agl-image-logo-toggle {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.agl-image-logo-toggle.is-logo {
    background: rgba(14, 116, 144, 0.95);
}

.agl-image-feature-toggle {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(16, 185, 129, 0.85);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.agl-image-feature-toggle.is-featured {
    background: rgba(5, 150, 105, 0.95);
}

.agl-image-item.is-logo {
    border-color: rgba(14, 116, 144, 0.85);
    box-shadow: 0 0 0 2px rgba(14, 116, 144, 0.25);
}

.agl-image-item.is-featured {
    border-color: rgba(5, 150, 105, 0.85);
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.25);
}

.agl-featured-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(16, 185, 129, 0.9);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.agl-logo-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(14, 116, 144, 0.95);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

/* Hours Editor */
.agl-hours-editor {
    margin-top: 16px;
}

.agl-hours-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.agl-day-name {
    width: 100px;
    font-weight: 500;
}

.agl-time-input {
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
}

.agl-closed-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    cursor: pointer;
}

/* Display Toggles */
.agl-display-toggles {
    display: grid;
    gap: 12px;
}

.agl-display-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 8px;
    cursor: pointer;
}

.agl-display-toggle.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.agl-toggle-text {
    flex: 1;
}

.agl-upgrade-hint {
    font-size: 11px;
    color: #3b82f6;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 640px) {
    .agl-dashboard-header {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .agl-dashboard-membership {
        text-align: center;
    }

    .agl-dashboard-locations {
        grid-template-columns: 1fr;
    }

    .agl-filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .agl-form-row {
        grid-template-columns: 1fr;
    }

    .agl-hours-row {
        flex-wrap: wrap;
    }

    .agl-day-name {
        width: 100%;
    }
}
