* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.container {
    background: white;
    border-radius: 0 0 20px 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    width: 100%;
    text-align: center;
}

.platform-tabs {
    display: flex;
    margin-bottom: 0;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    background: white;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    width: 100%;
}

.platform-tab {
    flex: 1;
    background: #f8f9fa;
    color: #666;
    padding: 15px 20px;
    font-size: 1.1em;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.platform-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.platform-tab:hover:not(.active) {
    background: #e9ecef;
}

h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2.5em;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1em;
    cursor: pointer;
    margin: 10px;
    transition: transform 0.2s;
    width: 200px;
}

.button:hover {
    transform: translateY(-2px);
}


.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-container {
    margin: 30px 0;
    text-align: left;
}

.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

input, textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.2s;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
}

textarea {
    resize: vertical;
    font-family: inherit;
}

.char-count {
    font-weight: normal;
    color: #666;
    font-size: 0.9em;
    margin-left: 8px;
}
.char-count-over {
    color: #c00;
}
.input-group .action-btn {
    margin-top: 8px;
}

.status {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    display: none;
}

.status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.loading {
    display: none;
    margin-top: 20px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.steps-container {
    display: none;
    margin-top: 20px;
    text-align: left;
}

.step {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: #f8f9fa;
    border-left: 4px solid #e9ecef;
}

.step.active {
    background: #e3f2fd;
    border-left-color: #2196f3;
}

.step.completed {
    background: #e8f5e8;
    border-left-color: #4caf50;
}

.step.failed {
    background: #ffebee;
    border-left-color: #f44336;
}

.step.pending {
    background: #f8f9fa;
    border-left-color: #e9ecef;
}

.step.disabled {
    background: #f5f5f5;
    border-left-color: #ccc;
    opacity: 0.6;
    cursor: not-allowed;
}

.step.disabled .step-title {
    color: #999;
}

.step.disabled .step-description {
    color: #bbb;
    font-size: 0.85em;
    font-style: italic;
}

.step-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.view-btn {
    background: #007bff;
    color: white;
}

.view-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}


.action-btn:active {
    transform: translateY(0);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    display: flex;
    flex-direction: column;
}

.modal-content-wide {
    width: 560px;
    max-width: 95vw;
}

.modal-section {
    margin-bottom: 1.25rem;
}

.modal-section-title {
    margin: 0 0 0.75rem 0;
    font-size: 1em;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.35rem;
}

.source-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1.5rem;
    font-size: 0.9em;
    color: #666;
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    border-radius: 6px;
}

.input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.input-group-checkbox {
    display: flex;
    align-items: center;
}

.input-group-checkbox label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

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

.modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.step-desc {
    margin: 0.5rem 0 1rem;
    color: #666;
    font-size: 0.95em;
}

.map-agents-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-top: 0.5rem;
}

.map-agents-left {
    flex: 0 0 380px;
    min-width: 0;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e9ecef;
}

.map-agents-right {
    flex: 1;
    min-width: 0;
}

.agents-list-title {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    color: #333;
}

.agents-list {
    margin-top: 0;
    max-height: 420px;
    overflow-y: auto;
}

.agent-row {
    padding: 10px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #fafafa;
}

.agent-info {
    width: 100%;
}

.agent-name-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}

.agent-name-row strong {
    flex: 1;
    min-width: 0;
}

.agent-id-or-add {
    flex-shrink: 0;
}

.agent-id-or-add .mapped-id {
    font-size: 0.75em;
    color: #28a745;
    word-break: break-all;
    max-width: 140px;
    display: inline-block;
    text-align: right;
}

.agent-property-count {
    display: block;
    font-size: 0.8em;
    color: #0d6efd;
    margin-bottom: 2px;
}

.agent-line {
    display: block;
    color: #666;
    font-size: 0.85em;
    margin-bottom: 2px;
}

.agent-link-row {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #eee;
}

.agent-link-row .link-btn {
    padding: 4px 10px;
    font-size: 0.85em;
}

.action-btn.small {
    padding: 4px 10px;
    font-size: 0.85em;
}

/* Report Layout */
.report-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

.report-column {
    display: flex;
    flex-direction: column;
}

.report-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #007bff;
}

.report-section:first-child {
    border-left-color: #28a745;
}

.report-section:last-child {
    border-left-color: #dc3545;
}

.section-title {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.3em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-summary {
    background: white;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.section-summary .summary-label {
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

.subsection {
    margin-bottom: 20px;
}

.subsection:last-child {
    margin-bottom: 0;
}

.subsection-title {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.property-list {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.property-cid {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
    color: white;
    transition: transform 0.2s ease;
}

.property-cid:hover {
    transform: translateY(-1px);
}

.buy-cid {
    background: #007bff;
}

.rent-cid {
    background: #6f42c1;
}

.remove-cid {
    background: #dc3545 !important;
}

.no-properties {
    color: #6c757d;
    font-style: italic;
    font-size: 0.9em;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .report-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .report-section {
        padding: 15px;
    }
    
    .property-list {
        max-height: 150px;
    }
}

.step-icon {
    margin-right: 12px;
    font-size: 1.2em;
}

.step-content {
    flex: 1;
}

.step-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.step-live-message {
    font-size: 0.85em;
    color: #555;
    margin-top: 4px;
    line-height: 1.35;
}

.step.active .step-live-message {
    color: #1976d2;
}

.step-description {
    font-size: 0.9em;
    color: #666;
}

/* Map agents panel - left side (mirror of Activity Log) */
.map-agents-panel {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 350px;
    max-height: calc(100vh - 40px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.map-agents-panel-header {
    background: rgba(102, 126, 234, 0.2);
    padding: 10px 15px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.map-agents-panel-title {
    color: #333;
    font-weight: 600;
    font-size: 0.95em;
}

.map-agents-panel-close {
    background: rgba(0, 0, 0, 0.08);
    border: none;
    color: #666;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 1.2em;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
}

.map-agents-panel-close:hover {
    background: rgba(0, 0, 0, 0.12);
    color: #333;
}

.map-agents-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 15px;
    min-height: 0;
}

.map-agents-panel-footer {
    padding: 12px 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.notifications-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 350px;
    max-height: calc(100vh - 40px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.notifications-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 10px;
}

.notification {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-left: 4px solid #667eea;
    opacity: 0;
    transform: translateX(100%);
    animation: slideIn 0.3s ease-out forwards;
    margin-bottom: 10px;
}

.notification.success {
    border-left-color: #4caf50;
    background: #f8fff8;
}

.notification.error {
    border-left-color: #f44336;
    background: #fff8f8;
}

.notification.warning {
    border-left-color: #ff9800;
    background: #fffbf0;
}

.notification.info {
    border-left-color: #2196f3;
    background: #f0f8ff;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.notification-title {
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover {
    color: #666;
}

.notification-message {
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
}

.notification-time {
    color: #999;
    font-size: 0.8em;
    margin-top: 8px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.notification.removing {
    animation: slideOut 0.3s ease-in forwards;
}

/* Custom scrollbar for notifications content */
.notifications-content::-webkit-scrollbar {
    width: 6px;
}

.notifications-content::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.notifications-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.notifications-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

.log-header {
    background: rgba(255,255,255,0.1);
    padding: 10px 15px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.log-title {
    color: white;
    font-weight: 600;
    font-size: 0.9em;
}

.clear-log-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    cursor: pointer;
    transition: background 0.2s;
}

.clear-log-btn:hover {
    background: rgba(255,255,255,0.3);
}

.card-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 500px;
    width: 90%;
}
