/* Component styles - Buttons, inputs, modals */

.input-container {
    display: flex;
    gap: 10px;
}

.message-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    min-height: 44px;
    max-height: 120px;
}

.send-btn {
    padding: 12px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.send-btn:hover {
    background: #0056b3;
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.typing-indicator {
    display: none;
    color: #666;
    font-style: italic;
    font-size: 14px;
    padding: 10px;
}

.rlm-status-indicator {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 30px;
    background: rgba(40, 167, 69, 0.95);
    color: white;
    padding: 12px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    border-left: 3px solid #c33;
}

.info-message {
    background: #e8f4fd;
    color: #1976d2;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    border-left: 3px solid #1976d2;
}

/* RLM Passcode Modal */
.rlm-passcode-modal .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
}

.rlm-passcode-modal .modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    max-width: 450px;
    width: 90%;
}

.rlm-passcode-modal h3 {
    margin-bottom: 15px;
    color: #dc3545;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rlm-passcode-modal p {
    margin-bottom: 10px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.rlm-passcode-modal input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    margin: 15px 0;
}

.rlm-passcode-modal input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.rlm-passcode-modal .modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.rlm-passcode-modal button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.rlm-passcode-modal button:hover {
    opacity: 0.9;
}

.rlm-passcode-modal #rlmPasscodeSubmit {
    background: #007bff;
    color: white;
}

.rlm-passcode-modal #rlmPasscodeCancel {
    background: #6c757d;
    color: white;
}

.rlm-passcode-modal .modal-error {
    color: #dc3545;
    font-size: 13px;
    margin-top: 10px;
    min-height: 20px;
}

/* Image Upload Components */

.input-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.attach-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.1s;
    line-height: 1;
    flex-shrink: 0;
}

.attach-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.attach-btn:active {
    transform: scale(0.95);
}

.image-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    position: relative;
}

.image-preview img {
    max-width: 80px;
    max-height: 80px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.image-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 0;
}

.image-info span {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.remove-image {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    transition: background 0.2s;
    flex-shrink: 0;
}

.remove-image:hover {
    background: #c82333;
}

/* Drag and drop visual feedback */
.input-container.drag-over {
    background: #e7f3ff;
    border-color: #007bff;
}

.input-container.drag-over::after {
    content: 'Drop image here';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: #007bff;
    font-weight: 500;
    pointer-events: none;
}

/* Storage Meter */
.storage-meter {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.storage-meter-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.storage-meter-fill {
    height: 100%;
    background: #10b981;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 4px;
}

.storage-meter-text {
    font-size: 11px;
    color: #666;
    text-align: center;
}

/* Document Upload & Display */

.file-preview-container {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
}

.document-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.document-icon {
    font-size: 32px;
    line-height: 1;
}

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

.document-name {
    font-weight: 500;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-meta {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.remove-file {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.remove-file:hover {
    background: #c82333;
}

/* Document in Message */

.message-document {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 10px;
    margin: 8px 0;
    max-width: 500px;
}

.document-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.message-document .document-icon {
    font-size: 24px;
    line-height: 1;
}

.message-document .document-info {
    flex: 1;
    min-width: 0;
}

.message-document .document-name {
    font-weight: 500;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
}

.message-document .document-meta {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

.document-expand {
    width: 100%;
    margin-top: 6px;
    padding: 6px 8px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.document-expand:hover {
    background: #e9ecef;
}

.document-content {
    margin-top: 12px;
    padding: 12px;
    background: white;
    border-radius: 4px;
    max-height: 400px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
}

.document-content h1,
.document-content h2,
.document-content h3 {
    margin-top: 1em;
    margin-bottom: 0.5em;
}

.document-content code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

.document-content pre {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
}

.document-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 8px 0;
}

.document-content th,
.document-content td {
    border: 1px solid #dee2e6;
    padding: 8px;
    text-align: left;
}

.document-content th {
    background: #f8f9fa;
    font-weight: 600;
}
