/* ===== COMPONENT STYLES ===== */

/* ===== FORM SECTION STYLES ===== */

.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
}

.form-section h3 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* ===== EXCEL IMPORT STYLES ===== */

.import-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.import-method {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.import-method:hover {
    border-color: var(--primary-color);
}

.import-method.active {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.import-method input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.import-method label {
    display: block;
    font-weight: 600;
    margin: 0;
    cursor: pointer;
    color: var(--text-primary);
}

.excel-upload {
    margin-top: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
}

.upload-area {
    margin-bottom: 1rem;
}

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-primary);
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-text {
    color: var(--text-secondary);
}

.upload-text strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.5rem;
}

.upload-text code {
    background: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.upload-preview {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
}

.excel-summary h4 {
    color: var(--success-color);
    margin: 0 0 0.5rem 0;
}

.excel-clients {
    max-height: 200px;
    overflow-y: auto;
    margin: 1rem 0;
}

.client-preview {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    margin-bottom: 0.5rem;
    border-radius: var(--border-radius);
}

.client-preview:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.client-preview strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.25rem;
}

.client-preview p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.more-clients {
    text-align: center;
    padding: 0.5rem;
    color: var(--text-secondary);
    font-style: italic;
}

.excel-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: flex-end;
}

.loading {
    text-align: center;
    color: var(--primary-color);
    font-weight: 600;
    padding: 1rem;
}

.error {
    text-align: center;
    color: var(--error-color);
    font-weight: 600;
    padding: 1rem;
}

/* ===== MODALS ===== */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 90%;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { 
        opacity: 0; 
        transform: translateY(-50px) scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header.error {
    background: rgba(245, 101, 101, 0.1);
    border-bottom-color: rgba(245, 101, 101, 0.2);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.error-details {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-top: 1rem;
    font-family: monospace;
    font-size: 0.875rem;
    color: var(--text-secondary);
    max-height: 200px;
    overflow-y: auto;
}

/* ===== RESULTS COMPONENTS ===== */

.results-summary {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.summary-header {
    text-align: center;
    margin-bottom: 2rem;
}

.summary-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.summary-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.metric-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.metric-change {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.metric-change.positive {
    color: var(--success-color);
}

.metric-change.negative {
    color: var(--error-color);
}

/* ===== PROSPECTS LIST ===== */

.prospects-section {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.section-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-actions {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.prospects-list {
    max-height: 600px;
    overflow-y: auto;
}

.prospect-item {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    transition: var(--transition);
    position: relative;
}

.prospect-item:last-child {
    border-bottom: none;
}

.prospect-item:hover {
    background: var(--bg-secondary);
}

.prospect-item.approved {
    background: rgba(72, 187, 120, 0.05);
    border-left: 4px solid var(--success-color);
}

.prospect-item.rejected {
    background: rgba(245, 101, 101, 0.05);
    border-left: 4px solid var(--error-color);
    opacity: 0.7;
}

.prospect-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.prospect-info {
    flex: 1;
}

.prospect-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.prospect-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.prospect-type {
    font-size: 0.875rem;
}

.confidence-score {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.confidence-bar {
    width: 60px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.confidence-fill.high {
    background: var(--success-color);
}

.confidence-fill.medium {
    background: var(--warning-color);
}

.confidence-fill.low {
    background: var(--error-color);
}

.prospect-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.action-btn.create-task {
    background: #ff7a59;
    color: white;
}

.action-btn.create-task:hover:not(:disabled) {
    background: #ff6347;
}

.action-btn.create-task.success {
    background: var(--success-color);
}

.action-btn.create-task:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.action-btn.reject {
    background: var(--error-color);
    color: white;
}

.action-btn.reject:hover {
    background: #e53e3e;
}

.action-btn.details {
    background: var(--info-color);
    color: white;
}

.action-btn.details:hover {
    background: #3182ce;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.prospect-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.detail-item {
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: var(--border-radius);
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.ai-analysis {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-top: 1rem;
}

.ai-analysis-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.ai-analysis-content {
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.5;
}

/* ===== INSIGHTS PANEL ===== */

.insights-panel {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.insights-list {
    padding: 1.5rem;
}

.insight-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
}

.insight-item:last-child {
    margin-bottom: 0;
}

.insight-item.success {
    background: rgba(72, 187, 120, 0.05);
    border-color: rgba(72, 187, 120, 0.2);
}

.insight-item.warning {
    background: rgba(237, 137, 54, 0.05);
    border-color: rgba(237, 137, 54, 0.2);
}

.insight-item.info {
    background: rgba(66, 153, 225, 0.05);
    border-color: rgba(66, 153, 225, 0.2);
}

.insight-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.insight-icon.success {
    color: var(--success-color);
}

.insight-icon.warning {
    color: var(--warning-color);
}

.insight-icon.info {
    color: var(--info-color);
}

.insight-content {
    flex: 1;
}

.insight-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.insight-message {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.insight-action {
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* ===== HUBSPOT COMPONENTS ===== */

.hubspot-status {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.status-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.status-icon.success {
    background: rgba(72, 187, 120, 0.1);
    color: var(--success-color);
}

.status-icon.error {
    background: rgba(245, 101, 101, 0.1);
    color: var(--error-color);
}

.status-icon.pending {
    background: rgba(237, 137, 54, 0.1);
    color: var(--warning-color);
}

.status-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.status-message {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.tasks-summary {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.task-stat {
    text-align: center;
}

.task-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.task-stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ===== ANIMATIONS ===== */

.slide-in {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ===== UTILITIES ===== */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }