/* Grant Matcher App Styles */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-light);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Navbar */
.navbar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-content h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-email {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Login Page */
.login-box {
    max-width: 400px;
    margin: 4rem auto;
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.login-box h1 {
    text-align: center;
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

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

.required {
    color: var(--danger-color);
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.btn-logout:hover {
    background: var(--border-color);
}

/* Status Bar */
.status-bar {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid var(--primary-color);
}

#status-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* App Content */
.app-content {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.header-section h1 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.header-section .subtitle {
    text-align: left;
    margin-bottom: 0;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Results Section */
.results-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.results-section > h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

/* Grant Cards */
.grant-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.grant-card:hover {
    box-shadow: var(--shadow-md);
}

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

.grant-header h3 {
    flex: 1;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.match-score {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.match-score.high {
    background: #dcfce7;
    color: #166534;
}

.match-score.medium {
    background: #fef3c7;
    color: #92400e;
}

.match-score.low {
    background: #fee2e2;
    color: #991b1b;
}

.grant-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.grant-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.grant-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.grant-section h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.grant-section p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.grant-section.concerns {
    background: #fef3c7;
    padding: 1rem;
    border-radius: 6px;
    border: none;
}

/* Assessment and Recommendations */
.overall-assessment {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.overall-assessment h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.additional-recommendations {
    background: #dbeafe;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.additional-recommendations h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.no-results h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.recommendations {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: left;
}

/* Messages */
.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--danger-color);
}

.help-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 1.5rem;
}

.cost-info {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .app-content {
        padding: 1.5rem;
    }
    
    .grant-header {
        flex-direction: column;
    }
    
    .grant-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav-content {
        padding: 1rem;
    }
    
    .nav-right {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.5rem;
    }
}
