/* 약관 동의 모달 스타일 */
.cas-gpt-terms-modal-content {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.terms-content {
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f9f9f9;
    margin-bottom: 20px;
}

.terms-section {
    margin-bottom: 20px;
}

.terms-section h4 {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid #ddd;
}

.terms-section p {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 8px 0;
}

.terms-agreement {
    margin: 20px 0;
    padding: 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.terms-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
}

.terms-checkbox input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.terms-checkbox .checkmark {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    display: inline-block;
    position: relative;
    cursor: pointer;
}

.terms-checkbox input[type="checkbox"]:checked + .checkmark {
    background-color: #007cba;
    border-color: #007cba;
}

.terms-checkbox input[type="checkbox"]:checked + .checkmark:after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.terms-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.terms-actions .cas-gpt-btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.terms-actions .cas-gpt-btn-primary {
    background-color: #007cba;
    color: white;
    border: none;
}

.terms-actions .cas-gpt-btn-primary:hover:not(:disabled) {
    background-color: #005a87;
}

.terms-actions .cas-gpt-btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.terms-actions .cas-gpt-btn-secondary {
    background-color: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
}

.terms-actions .cas-gpt-btn-secondary:hover {
    background-color: #e0e0e0;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .cas-gpt-terms-modal-content {
        max-width: 95%;
        margin: 20px;
    }
    
    .terms-content {
        max-height: 300px;
        padding: 12px;
    }
    
    .terms-actions {
        flex-direction: column;
    }
    
    .terms-actions .cas-gpt-btn {
        width: 100%;
        padding: 14px 24px;
    }
}

/* 대화 기록 모달 스타일 */
.cas-gpt-history-modal-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.history-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.history-search {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 300px;
}

.history-search input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.history-filters select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.history-container {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f9f9f9;
}

.history-session {
    margin-bottom: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: left;
}

.history-session-header {
    background: #007cba;
    color: white;
    padding: 8px 16px;
    display: flex;
    justify-content: left;
    align-items: center;
}

.history-session-header h4 {
    margin: 0;
    font-size: 14px;
}

.history-conversations {
    padding: 0;
}

.history-conversation {
    font-size: 15px;
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.history-conversation:hover {
    background-color: #f0f8ff;
}

.history-conversation:last-child {
    border-bottom: none;
}

.conversation-user,
.conversation-ai {
    margin-bottom: 8px;
    line-height: 1.4;
}

.conversation-user strong,
.conversation-ai strong {
    color: #007cba;
    margin-right: 8px;
}

.conversation-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

.conversation-time {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
}

.search-results-header {
    background: #e8f4fd;
    padding: 12px 16px;
    border-bottom: 1px solid #007cba;
    margin-bottom: 0;
}

.search-results-header h4 {
    margin: 0;
    color: #007cba;
    font-size: 14px;
}

.history-conversation.search-result {
    background: #fffacd;
    border-left: 4px solid #ffd700;
}

.history-conversation.search-result:hover {
    background: #fff8dc;
}

mark {
    background-color: #ffd700;
    padding: 1px 2px;
    border-radius: 2px;
}

.history-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 8px;
}

.history-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.conversation-detail-modal {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.conversation-detail-header {
    background: #007cba;
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conversation-detail-header h3 {
    margin: 0;
    font-size: 16px;
}

.close-detail {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.conversation-detail-body {
    padding: 20px;
}

.conversation-detail-user,
.conversation-detail-ai {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.conversation-detail-user {
    background: #f8f9fa;
}

.conversation-detail-ai {
    background: #f8f9fa;
}

.conversation-detail-user strong,
.conversation-detail-ai strong {
    color: #007cba;
    display: block;
    margin-bottom: 8px;
}

.conversation-detail-meta {
    background: #f0f0f0;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
}

.conversation-detail-meta p {
    margin: 4px 0;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .cas-gpt-history-modal-content {
        max-width: 95%;
        margin: 10px;
    }
    
    .history-controls {
        flex-direction: column;
    }
    
    .history-search {
        min-width: auto;
    }
    
    .history-container {
        max-height: 400px;
    }
    
    .history-session-header {
        text-align: center;
    }
    
    .conversation-meta {
        flex-direction: column;
        gap: 8px;
    }
}
