/* Main styles for RFP Response Tool */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --success-color: #059669;
    --warning-color: #d97706;
    --error-color: #dc2626;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
}

/* Steps indicator */
.steps {
    display: flex;
    gap: 0.5rem;
    margin: 1.5rem 0;
    padding: 0;
    list-style: none;
}

.step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

.step.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.step.completed {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.step.active .step-number,
.step.completed .step-number {
    background: rgba(255, 255, 255, 0.2);
}

.step-label {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Cards */
.card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

/* File upload zone */
.upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: 0.75rem;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.upload-zone-icon {
    font-size: 3rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
}

.upload-zone-text {
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.upload-zone-hint {
    font-size: 0.875rem;
    color: var(--gray-400);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

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

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

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

/* Request list */
.request-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.request-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 1rem;
}

.request-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.request-number {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.request-text {
    color: var(--gray-700);
    font-size: 0.875rem;
}

/* Document list */
.document-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.document-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 1rem;
}

.document-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.document-bates {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.document-description {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    resize: vertical;
}

/* Review grid */
.review-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.review-request {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    overflow: hidden;
}

.review-request-header {
    background: var(--gray-50);
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.review-request-body {
    padding: 1rem;
}

.review-section {
    margin-bottom: 1rem;
}

.review-section:last-child {
    margin-bottom: 0;
}

.review-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

/* Checkbox grid */
.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--gray-100);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s;
}

.checkbox-item:hover {
    background: var(--gray-200);
}

.checkbox-item.selected {
    background: var(--primary-color);
    color: white;
}

.checkbox-item input {
    display: none;
}

/* Multi-select */
.multi-select {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.multi-select-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--gray-100);
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.multi-select-item.selected {
    background: var(--success-color);
    color: white;
}

/* AI Notes */
.ai-notes {
    background: rgba(37, 99, 235, 0.05);
    border-left: 3px solid var(--primary-color);
    padding: 0.75rem;
    border-radius: 0 0.375rem 0.375rem 0;
    font-size: 0.875rem;
    color: var(--gray-700);
}

/* Loading state */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--gray-500);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.75rem;
}

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

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-error {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.2);
    color: var(--error-color);
}

.alert-success {
    background: rgba(5, 150, 105, 0.1);
    border: 1px solid rgba(5, 150, 105, 0.2);
    color: var(--success-color);
}

.alert-info {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.2);
    color: var(--primary-color);
}

/* Actions bar */
.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

/* Data tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: top;
}

.data-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.table-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: inherit;
    background: white;
}

.table-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.table-input::placeholder {
    color: var(--gray-400);
}

/* Icon buttons */
.btn-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.15s;
}

.btn-icon:hover {
    background: var(--error-color);
    color: white;
}

/* Header Navigation */
.header-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.15s;
}

.nav-btn:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

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

/* Dropdown Menu */
.dropdown-menu {
    padding: 0.5rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--gray-700);
    text-decoration: none;
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--gray-100);
}

.dropdown-item.active {
    background: var(--gray-100);
    font-weight: 500;
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0.5rem 0;
}

/* Objections Management */
.objections-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.objection-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    overflow: hidden;
}

.objection-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-bottom: 1px solid var(--gray-200);
}

.objection-item-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.objection-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

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

.objection-item-body {
    padding: 1rem;
}

.objection-field {
    margin-bottom: 0.75rem;
}

.objection-field:last-child {
    margin-bottom: 0;
}

.objection-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.objection-field p {
    font-size: 0.875rem;
    color: var(--gray-700);
    margin: 0;
}

/* Small buttons */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal {
    background: white;
    border-radius: 0.75rem;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

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

/* Form elements */
.form-group {
    margin-bottom: 1rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 0.15s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input:disabled {
    background: var(--gray-100);
    color: var(--gray-500);
    cursor: not-allowed;
}

.form-input::placeholder {
    color: var(--gray-400);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

/* Responsive */
@media (max-width: 768px) {
    .steps {
        flex-direction: column;
    }

    .document-list {
        grid-template-columns: 1fr;
    }

    .checkbox-grid {
        flex-direction: column;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }

    .header-nav {
        gap: 0.25rem;
    }

    .nav-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }

    .objection-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .modal {
        max-height: 100vh;
        border-radius: 0;
    }
}

/* Inline Edit Icon Button */
.edit-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.875rem;
    color: var(--gray-400);
    border-radius: 4px;
    transition: color 0.15s, background-color 0.15s;
    line-height: 1;
}

.edit-icon-btn:hover {
    color: var(--primary-color);
    background-color: var(--gray-100);
}

/* Template Type Badge */
.template-type-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.template-type-badge.type-rfp {
    background-color: #dbeafe;
    color: #1e40af;
}

.template-type-badge.type-opposition {
    background-color: #fef3c7;
    color: #92400e;
}

/* Template Tiles */
.template-tile {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 0.75rem;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.template-tile:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.template-tile-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.template-tile-header > span:first-child {
    display: flex;
    align-items: center;
}

.template-upload-tile {
    border: 2px dashed var(--gray-300);
    background: var(--gray-50);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    transition: border-color 0.15s, background-color 0.15s;
}

.template-upload-tile:hover {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.template-upload-tile.dragover {
    border-color: var(--primary-color);
    background: #dbeafe;
}

.template-upload-tile.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.template-download-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 0.15s;
    border-radius: 4px;
}

.template-download-btn:hover {
    opacity: 1;
    background: var(--gray-100);
}
