/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #d5f4e6 0%, #80e8c8 100%);
    min-height: 100vh;
    padding: 1.5rem;
}

/* Layout */
.container {
    max-width: 1280px;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.title {
    font-size: 2.5rem;
    font-weight: bold;
    color: #065f46;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #047857;
    font-size: 1rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #059669;
    color: white;
}

.btn-primary:hover {
    background: #047857;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-blue {
    background: #2563eb;
    color: white;
}

.btn-blue:hover {
    background: #1d4ed8;
}

.btn-yellow {
    background: #d97706;
    color: white;
}

.btn-yellow:hover {
    background: #b45309;
}

.btn-purple {
    background: #7c3aed;
    color: white;
}

.btn-purple:hover {
    background: #6d28d9;
}

.btn-green {
    background: #16a34a;
    color: white;
}

.btn-green:hover {
    background: #15803d;
}

.btn-red {
    background: #dc2626;
    color: white;
}

.btn-red:hover {
    background: #b91c1c;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 1rem;
    font-size: 1.125rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 4px solid transparent;
    font-weight: 600;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.tab:hover {
    color: #1f2937;
}

.tab-active {
    color: #065f46;
    border-bottom-color: #059669;
}

/* Search Mode */
.search-mode-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-mode-btn {
    padding: 1.5rem;
    border: 2px solid #d1d5db;
    border-radius: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.search-mode-btn:hover {
    border-color: #10b981;
}

.search-mode-btn-active {
    border-color: #059669;
    background: #d1fae5;
}

.search-mode-icon {
    width: 2rem;
    height: 2rem;
    margin: 0 auto 0.5rem;
    color: #059669;
}

.search-mode-label {
    font-weight: 600;
    color: #065f46;
    margin-bottom: 0.25rem;
}

.search-mode-desc {
    font-size: 0.75rem;
    color: #047857;
}

/* Keywords */
.keywords-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.keyword-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #d1d5db;
    border-radius: 9999px;
    background: white;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.keyword-btn:hover {
    border-color: #10b981;
}

.keyword-btn-active {
    background: #059669;
    color: white;
    border-color: #059669;
    box-shadow: 0 4px 6px rgba(5, 150, 105, 0.3);
}

/* Opportunity Cards */
.opp-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.opp-card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

.opp-title {
    font-size: 1.125rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-green {
    background: #d1fae5;
    color: #065f46;
}

.badge-purple {
    background: #e9d5ff;
    color: #6b21a8;
}

/* Metadata */
.opp-meta {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.meta-item-red {
    color: #dc2626;
    font-weight: 500;
}

.opp-desc {
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

/* Relevance Box */
.relevance-box {
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.relevance-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b21a8;
    margin-bottom: 0.25rem;
}

.relevance-text {
    font-size: 0.875rem;
    color: #581c87;
}

/* Button Groups */
.btn-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

/* Links */
.link {
    color: #2563eb;
    text-decoration: none;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.link:hover {
    text-decoration: underline;
}

/* Progress */
.progress-box {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #065f46;
    font-weight: 500;
}

.spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #a7f3d0;
    border-top-color: #059669;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 0;
    color: #6b7280;
}

/* Section Titles */
.section-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Pipeline Stages */
.stage-container {
    border: 2px solid;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.stage-blue {
    background: #dbeafe;
    border-color: #93c5fd;
}

.stage-yellow {
    background: #fef3c7;
    border-color: #fcd34d;
}

.stage-purple {
    background: #f3e8ff;
    border-color: #c4b5fd;
}

.stage-green {
    background: #d1fae5;
    border-color: #6ee7b7;
}

.stage-red {
    background: #fee2e2;
    border-color: #fca5a5;
}

.stage-gray {
    background: #f3f4f6;
    border-color: #d1d5db;
}

/* Text Colors */
.text-blue { color: #1e40af; }
.text-yellow { color: #92400e; }
.text-purple { color: #6b21a8; }
.text-green { color: #065f46; }
.text-red { color: #991b1b; }
.text-gray { color: #374151; }

/* Keyword Manager */
.keyword-manager {
    background: #d1fae5;
    border: 2px solid #a7f3d0;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Inputs */
.input {
    padding: 0.75rem 1rem;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    width: 100%;
}

.input:focus {
    outline: none;
    border-color: #059669;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Keyword Pills */
.keyword-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 2px solid #d1d5db;
    border-radius: 9999px;
    margin: 0.25rem;
}

.keyword-pill-text {
    font-size: 0.875rem;
    font-weight: 500;
}

.keyword-pill-remove {
    background: none;
    border: none;
    color: #dc2626;
    font-size: 1.25rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.keyword-pill-remove:hover {
    color: #991b1b;
}

/* History */
.history-card {
    background: #faf5ff;
    border: 2px solid #e9d5ff;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.history-card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.history-date {
    font-weight: bold;
    color: #6b21a8;
    margin-bottom: 0.5rem;
}

.history-info {
    font-size: 0.875rem;
    color: #7c3aed;
    margin-bottom: 0.25rem;
}

/* Icons */
.icon {
    width: 1.25rem;
    height: 1.25rem;
}

.icon-lg {
    width: 1.5rem;
    height: 1.5rem;
}

svg {
    flex-shrink: 0;
}