/* resources/js/components/ContentManager.css */

.content-manager {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #24292e;
}

.content-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e1e5e9;
}

.content-header h2 {
    color: #24292e;
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
}

.content-header p {
    color: #586069;
    margin: 0;
    font-size: 16px;
}

/* Upload Section Styles */
.upload-section {
    background: #f6f8fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.upload-methods {
    margin-bottom: 20px;
}

.method-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.method-tabs .tab {
    background: #ffffff;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #586069;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.method-tabs .tab:hover {
    background: #f3f4f6;
    border-color: #c6cbd1;
}

.method-tabs .tab.active {
    background: #0366d6;
    color: white;
    border-color: #0366d6;
}

.file-tab {
    position: relative;
    overflow: hidden;
}

.file-support-info {
    margin-top: 8px;
    padding-left: 4px;
}

.file-support-info small {
    color: #6a737d;
    font-size: 12px;
    font-style: italic;
    display: block;
}

/* Text Input Section */
.text-input-section {
    margin-top: 20px;
}

.content-textarea {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        sans-serif;
    font-size: 14px;
    line-height: 1.45;
    resize: vertical;
    box-sizing: border-box;
}

.content-textarea:focus {
    outline: none;
    border-color: #0366d6;
    box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.1);
}

.input-stats {
    display: flex;
    gap: 20px;
    margin-top: 8px;
    font-size: 12px;
    color: #6a737d;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.ingest-button {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px; /* Ensure consistent button height */
    box-sizing: border-box; /* Include padding in size calculations */
    overflow: hidden; /* Prevent content from overflowing */
}

.ingest-button:hover:not(:disabled) {
    background: #22863a;
}

.ingest-button:disabled {
    background: #94d3a2;
    cursor: not-allowed;
}

.clear-button {
    background: #6a737d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.clear-button:hover:not(:disabled) {
    background: #586069;
}

/* Loading spinner */
.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0; /* Prevent spinner from shrinking */
    display: inline-block; /* Ensure proper inline behavior */
}

/* Loading spinner within buttons */
.ingest-button .loading-spinner,
.clear-kb-button .loading-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    margin-right: 0; /* Remove any margin since gap handles spacing */
    flex-shrink: 0;
}

/* Ensure button content stays aligned and contained */
.ingest-button > *,
.clear-kb-button > * {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Loading state text in buttons */
.ingest-button:disabled,
.clear-kb-button:disabled {
    justify-content: center;
}

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

/* Message styles */
.success-message,
.error-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 14px;
    line-height: 1.4;
}

.success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.message-icon {
    font-weight: bold;
    font-size: 16px;
    margin-top: 1px;
}

.message-text {
    flex: 1;
}

/* Knowledge Base Controls */
.knowledge-base-controls {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.control-section h3 {
    color: #24292e;
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.control-section p {
    color: #586069;
    margin: 0 0 15px 0;
    font-size: 14px;
}

.clear-kb-button {
    background: #d73a49;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px; /* Ensure consistent button height */
    box-sizing: border-box; /* Include padding in size calculations */
    overflow: hidden; /* Prevent content from overflowing */
}

.clear-kb-button:hover:not(:disabled) {
    background: #cb2431;
}

.clear-kb-button:disabled {
    background: #f97583;
    cursor: not-allowed;
}

.kb-note {
    display: block;
    margin-top: 8px;
    color: #6a737d;
    font-size: 12px;
    line-height: 1.4;
}

/* Content tabs */
.content-tabs {
    display: flex;
    gap: 10px;
    margin: 30px 0 20px 0;
    border-bottom: 1px solid #e1e5e9;
}

.content-tabs .tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #586069;
    transition: all 0.2s ease;
}

.content-tabs .tab:hover {
    color: #24292e;
}

.content-tabs .tab.active {
    color: #0366d6;
    border-bottom-color: #0366d6;
}

/* Loading container */
.loading-container {
    text-align: center;
    padding: 40px 20px;
    color: #586069;
}

.loading-container .loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e1e5e9;
    border-top: 3px solid #0366d6;
    margin: 0 auto 15px auto;
}

/* Additional utility classes */
.text-center {
    text-align: center;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}
