/* ============================================================
 * COMPONENTS - BUTTONS
 * ============================================================ */

.btn-large {
    padding: 13px 20px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    border-radius: var(--radius-sm) !important;
}

.btn-send,
.btn-voice {
    width: 32px;
    height: 32px;
    background: #3366A9;
    border: 1px solid #3366A9;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(51, 102, 169, 0.2);
    padding: 0;
}

@media (max-width: 768px) {
    .btn-send,
    .btn-voice {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
    }
}

.btn-send img,
.btn-voice img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

.btn-send:hover:not(:disabled),
.btn-voice:hover:not(:disabled) {
    background: #4A7BC4;
    border-color: #4A7BC4;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(51, 102, 169, 0.3);
}

.btn-send:active:not(:disabled),
.btn-voice:active:not(:disabled) {
    transform: scale(1.02);
}

.btn-send:disabled,
.btn-voice:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-voice.listening {
    background: #4A7BC4;
    border-color: #4A7BC4;
    animation: modern-pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================================
 * COMPONENTS - MODALS
 * ============================================================ */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    gap: 16px;
}

.modal.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.modal p {
    color: var(--text-secondary);
    font-size: 14px;
}

.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;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    font-family: 'Jost', sans-serif;
    animation: slideUp 0.3s ease;
}

.modal-content h3 {
    margin: 0 0 16px 0;
    color: #333;
}

.modal-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.modal-input:focus {
    outline: none;
    border-color: #114185;
}

.modal-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: #666;
    font-size: 14px;
}

.modal-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.modal-btn:hover {
    opacity: 0.8;
}

.modal-btn-primary {
    background: #667eea;
    color: white;
}

.modal-btn-secondary {
    background: #f0f0f0;
    color: #666;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    font-family: 'Jost', sans-serif;
}

.modal-body {
    padding: 20px;
    background: var(--bg-main);
}

.modal-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: var(--text-secondary);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    color: var(--text);
    transform: scale(1.1);
}

/* ============================================================
 * COMPONENTS - UPLOAD MODAL
 * ============================================================ */

#upload-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;
    cursor: pointer;
}

#upload-modal .modal-content {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    width: 90%;
    max-width: 280px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    cursor: default;
    animation: slideUp 0.3s ease;
}

.upload-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 12px 0;
}

.upload-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #3366A9;
    transition: all 0.2s;
    font-family: 'Jost', sans-serif;
    width: 100%;
}

.upload-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.upload-btn span:first-child {
    font-weight: 500;
}

.upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.upload-icon img {
    width: 20px;
    height: 20px;
}

/* ============================================================
 * COMPONENTS - CARDS
 * ============================================================ */

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: all 0.2s;
}

.info-card:hover {
    border-color: rgba(17, 65, 133, 0.3);
    background: var(--bg-hover);
}

.info-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 14px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.help-card {
    background: #114185;
    border: none;
    border-radius: 10px;
    padding: 16px 20px;
    color: #FFFFFF;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(17, 65, 133, 0.3);
    font-family: 'Cormorant Garamond', serif;
    min-height: 62px;
    width: 100%;
    text-align: left;
    position: relative;
    z-index: 20;
}

@media (max-width: 768px) {
    .help-card {
        min-height: 62px;
        padding: 16px 20px;
        width: 100%;
        flex-direction: row;
    }
}

.help-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(17, 65, 133, 0.4);
    background: #3366A9;
}

.help-card:active {
    transform: translateY(-2px);
}

.help-card.active {
    background: #3366A9;
    box-shadow: 0 8px 20px rgba(17, 65, 133, 0.4);
}

.help-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    flex-shrink: 0;
    order: 2;
}

.help-card-icon {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .help-card-icon {
        width: 24px;
        height: 24px;
    }
}

.help-title {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #FFFFFF;
    font-family: 'Jost', sans-serif;
    order: 1;
    flex: 1;
}

@media (max-width: 768px) {
    .help-title {
        font-size: 14px;
    }
}

/* ============================================================
 * COMPONENTS - INPUTS
 * ============================================================ */

.message-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    resize: none;
    padding: 4px 8px;
    min-width: 0;
    max-height: 120px;
}

@media (max-width: 768px) {
    .message-input {
        padding: 4px 8px;
    }
}

.message-input::placeholder {
    color: var(--text-muted);
}

.input-wrapper {
    height: auto;
    min-height: 47px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 8px 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    max-width: 327px;
    margin: 0 auto 16px;
    position: relative;
}

@media (max-width: 768px) {
    .input-wrapper {
        padding: 8px 12px;
        gap: 8px;
        width: 100%;
        max-width: 327px;
    }
}

.input-wrapper:focus-within {
    border-color: var(--border-active);
    box-shadow: var(--shadow-glow);
}

.message-input-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    min-width: 0;
}

.hint-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0;
    margin: 0;
}

@media (max-width: 768px) {
    .hint-icon {
        width: 32px;
        height: 32px;
    }
}

.hint-icon img {
    width: 16px;
    height: 16px;
}

.hint-icon:hover {
    background: var(--bg-hover);
    border-color: var(--border-dark);
    transform: scale(1.05);
}

.auth-input {
    width: 100%;
    background: transparent;
    border: 2px solid #114185;
    color: #1C1C1C;
    padding: 14px 8px;
    border-radius: 14px;
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    font-weight: 400;
    resize: none;
    transition: all 0.3s;
    line-height: 1.5;
}

.auth-input:focus {
    outline: none;
    border-color: #114185;
    /* background: #FFFFFF; */
    box-shadow: 0 0 0 3px rgba(17, 65, 133, 0.1);
}

.auth-input::placeholder {
    /* color: #9CA3AF; */
    font-family: 'Jost', sans-serif;
    font-weight: 400;
    font-size: 14px;
}

/* ============================================================
 * COMPONENTS - BADGES
 * ============================================================ */

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-active {
    background: rgba(5, 150, 105, 0.15);
    color: #059669;
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.badge-inactive {
    background: rgba(220, 38, 38, 0.15);
    color: #DC2626;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

/* ============================================================
 * COMPONENTS - DROPDOWNS
 * ============================================================ */

.examples-dropdown,
.tips-dropdown {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    animation: slideDown 0.3s ease;
    margin-top: 10px;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    max-height: 300px;
}

@media (max-width: 768px) {
    .examples-dropdown,
    .tips-dropdown {
        max-width: 100%;
        border-radius: 10px;
    }
}

.examples-dropdown.hidden,
.tips-dropdown.hidden {
    display: none !important;
}

.examples-list,
.tips-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.example-item,
.tip-item {
    padding: 16px 20px;
    background: #EFEFEF;
    color: #AAAAAA;
    cursor: pointer;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 400;
    text-align: left;
    font-family: 'Jost', sans-serif;
    transition: all 0.3s ease;
    min-height: 50px;
    display: flex;
    align-items: left;
    border: none;
}

@media (max-width: 768px) {
    .example-item,
    .tip-item {
        font-size: 13px;
    }
}

.tip-item {
    flex-direction: column;
    justify-content: center;
    border: 2px solid var(--border);
}

.example-item:hover,
.tip-item:hover {
    transform: translateX(4px);
}

.example-item:active,
.tip-item:active {
    transform: translateX(2px);
}

/* ============================================================
 * COMPONENTS - SETTINGS BUTTON
 * ============================================================ */

.settings-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #DC3545;
    transition: all 0.2s;
    font-family: 'Jost', sans-serif;
    width: 100%;
}

.settings-btn:hover {
    background: rgba(220, 53, 69, 0.2);
    border-color: #DC3545;
    transform: translateX(2px);
}

.settings-btn:active {
    transform: translateX(1px);
}

.settings-btn-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #DC3545;
    border-color: rgba(220, 53, 69, 0.3);
}

.settings-btn-danger:hover {
    background: rgba(220, 53, 69, 0.2);
    border-color: #DC3545;
    color: #DC3545;
}

/* ============================================================
 * COMPONENTS - ATTACHED FILES - LIGHT THEME
 * ============================================================ */

.attached-files-container {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px;
    max-height: 150px;
    overflow-y: auto;
    background: var(--bg-main);
    flex-shrink: 0;
}

.attached-files-container.show {
    display: flex;
}

.attached-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    font-family: 'Jost', sans-serif;
    transition: all 0.2s;
    animation: slideDown 0.3s ease;
}

.attached-file-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-dark);
}

.file-icon {
    font-size: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    color: var(--text);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'Jost', sans-serif;
}

.file-size {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'Jost', sans-serif;
}

.file-remove-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
    font-weight: 600;
}

.file-remove-btn:hover {
    background-color: rgba(220, 38, 38, 0.1);
    color: #DC2626;
}

.file-remove-btn:active {
    transform: scale(0.9);
}

/* ============================================================
 * COMPONENTS - TABLE EXPORT
 * ============================================================ */

.assistant-table {
    position: relative;
}

.table-export-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--primary-lighter);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Jost', sans-serif;
    position: absolute;
    top: -20px;
    right: 0;
    z-index: 10;
}

.table-export-btn:hover {
    background: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

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