@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #1C411E;
    --primary-dark: #153317;
    --secondary: #2d5a30;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --bg: #F7F6F0;
    --card-bg: #ffffff;
    --text: #111827;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-direction: column;
}

.logo img {
    height: auto;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
}

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

/* Search Card */
.search-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

#company-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    transition: all 0.2s;
    outline: none;
}

#company-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(28, 65, 30, 0.1);
}

.input-examples {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

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

.example-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.example-btn:hover {
    border-color: var(--primary);
    background: rgba(28, 65, 30, 0.05);
    color: var(--primary);
}

/* Depth Selector */
.depth-selector label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.depth-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.depth-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid var(--border);
    background: var(--card-bg);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.depth-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.depth-btn.active {
    border-color: var(--primary);
    background: rgba(28, 65, 30, 0.05);
}

.depth-icon {
    font-size: 1.5rem;
}

.depth-name {
    font-weight: 600;
    color: var(--text);
}

.depth-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Search Button */
.search-btn {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: var(--primary);
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1.5rem;
    position: relative;
}

.search-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.search-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.search-btn.loading .btn-text {
    visibility: hidden;
}

.btn-loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.search-btn.loading .btn-loader {
    display: block;
}

.spinner {
    animation: rotate 1s linear infinite;
    width: 24px;
    height: 24px;
}

.spinner circle {
    stroke: white;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

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

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Results Section */
.results-section {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.results-section.hidden {
    display: none;
}

.results-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.results-header h2 {
    font-size: 1.875rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.results-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.meta-badge {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    background: rgba(28, 65, 30, 0.1);
    color: var(--primary);
    border-radius: 0.375rem;
}

.meta-timestamp {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Result Card */
.result-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.result-card:last-child {
    margin-bottom: 0;
}

.result-header {
    display: flex;
    align-items: start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.result-number {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.875rem;
}

.result-info {
    flex-grow: 1;
    min-width: 0;
}

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

.result-url {
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    word-break: break-all;
}

.result-url:hover {
    text-decoration: underline;
}

.result-content {
    line-height: 1.7;
    color: var(--text);
    white-space: pre-wrap;
}

/* Funding Summary Card */
.funding-summary-card {
    background: linear-gradient(135deg, #f0f5f0 0%, #e8efe8 100%);
    border: 2px solid var(--primary);
    border-radius: 1rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.funding-section {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow);
}

.funding-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.funding-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
}

/* Results Actions */
.results-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: 2px solid var(--primary);
    background: var(--primary);
    color: white;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.action-btn.secondary {
    background: transparent;
    color: var(--primary);
}

.action-btn.secondary:hover {
    background: rgba(28, 65, 30, 0.1);
}

/* Error Message */
.error-message {
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: start;
    margin-bottom: 2rem;
}

.error-message.hidden {
    display: none;
}

.error-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.error-title {
    font-weight: 700;
    color: var(--error);
    margin-bottom: 0.25rem;
}

.error-text {
    color: #991b1b;
}

/* Footer */
footer {
    margin-top: auto;
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

footer a {
    color: var(--primary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .search-card {
        padding: 1.5rem;
    }

    .depth-options {
        grid-template-columns: 1fr;
    }

    .results-actions {
        flex-direction: column;
    }

    .action-btn {
        justify-content: center;
    }
}
